/* أوبتس — فريق السهولة 2026-11-12 (RULES-UX.md). ترتيب وأماكن ومقاسات بس؛ الألوان من رموز الصفحة والهوية (ما نضيف لون). */

/* ١. رأس الصفحة: «محادثة جديدة» بضغطة وحدة على الجوال، وكلمة جنب أيقونات الملفات/الاستوديو/المخرجات على الشاشات العريضة */
#newChatTop { display: none; }
@media (max-width: 760px) {
  #newChatTop { display: grid; place-items: center; }
  .top .burger, .top .ib { flex: none; }
  .top { gap: 0; padding-inline: 6px; }   /* room for the model name next to five 44px buttons */
  .top .model-wrap { min-width: 0; flex: 0 1 auto; }
  .top .model-btn { max-width: 100%; min-width: 0; overflow: hidden; }
  .top #modelName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}
.top .ux-lbl { display: none; }
@media (min-width: 1200px) {
  .top .ib.ux-l { width: auto; display: inline-flex; align-items: center; gap: 6px; padding-inline: 10px 12px; border-radius: 10px; }
  .top .ib.ux-l .ux-lbl { display: inline; font-size: 13.5px; line-height: 1; white-space: nowrap; }
}

/* ٢. الشاشة الأولى على الجوال: صندوق الكتابة تحت بمتناول الإبهام (كان بنص الشاشة) */
@media (max-width: 760px) {
  .hero { justify-content: flex-end; padding-bottom: env(safe-area-inset-bottom); }
  .hero h1 { margin-block: auto 18px; }
  .hero #heroSlot { order: 3; width: 100%; }
  .hero .ux-starts { order: 2; margin: 0 0 10px; }
}

/* ٣. بدايات سريعة تحت صندوق الكتابة: كل وحدة توصلك لميزة بضغطة */
.ux-starts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; max-width: 760px; }
.ux-starts button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--silver); background: transparent; font-size: 14px; }
.ux-starts button:hover { border-color: var(--line2); color: var(--accent); background: var(--panel2); }
.ux-starts svg { width: 16px; height: 16px; flex: none; }
@media (pointer: coarse) { .ux-starts button { min-height: 44px; } }
@media (max-width: 380px) { .ux-starts button { padding: 0 12px; font-size: 13.5px; } }

/* ٤. الحساب أسفل الشريط الجانبي: الاسم والباقة زر يفتح «الحساب والباقة» */
.user button.who { text-align: start; color: inherit; font: inherit; padding: 6px 8px; margin: -6px -8px; border-radius: 10px; min-height: 44px; display: block; }
.user button.who:hover { background: var(--panel2); }
.user button.who #who { display: block; overflow: hidden; text-overflow: ellipsis; }

/* ٥. الإعدادات: «متقدم» مطوي، وأفعال الباقة فوق، والخروج بعيد عن الأساسي */
details.ux-adv { margin-top: 18px; }
details.ux-adv > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px;
  color: var(--silver); font-size: 14px; border-radius: 10px; }
details.ux-adv > summary::-webkit-details-marker { display: none; }
details.ux-adv > summary::after { content: ""; width: 8px; height: 8px; border-inline-end: 1.6px solid currentColor; border-block-end: 1.6px solid currentColor;
  transform: rotate(45deg); margin-inline-start: auto; transition: transform var(--op-base, .18s); }
details.ux-adv[open] > summary::after { transform: rotate(-135deg); }
details.ux-adv > summary:hover { color: var(--accent); }
details.ux-adv > .card-set { margin-top: 4px; }

.ux-acc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.ux-acc-acts .btn { min-height: 40px; display: inline-grid; place-items: center; }
.ux-out { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.ux-out .acts { margin-top: 8px; }
@media (pointer: coarse) { .ux-acc-acts .btn { min-height: 44px; } }

/* باقات الرصيد: صفوف واضحة بزر بدل رابط أزرق صغير */
.topups ul { list-style: none; padding: 0; margin: 8px 0 0; }
.topups li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.topups li a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; }
.topups li a:hover { border-color: var(--line2); background: var(--panel2); }
.topups.ux-flash { animation: uxFlash 1.2s var(--op-ease, ease) 1; border-radius: 12px; }
@keyframes uxFlash { 0% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }

/* ٦. الأوراق: الأساسي بآخر صف الأزرار (جهة النهاية)، وبالجوال شريط لاصق تحت */
#studio .acts { justify-content: flex-end; }
#studio .acts:has(#stGo:not([hidden])) #stQuote { background: transparent; color: var(--silver); border: 1px solid var(--line); font-weight: 500; }
@media (max-width: 760px) {
  #studio .acts { position: sticky; bottom: 0; z-index: 2; margin: 14px -18px 0; padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
    background: var(--panel); border-top: 1px solid var(--line); }
  #studio .acts .btn { flex: 1; min-height: 48px; }
}

/* ٧. حذف محادثة بلا حوار: إشعار بزر «تراجع» */
.toast.ux-act { display: flex; align-items: center; gap: 12px; }
.toast .ux-undo { color: var(--accent); font-weight: 600; min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); }
.toast .ux-undo:hover { background: var(--panel2); }
@media (pointer: coarse) { .toast .ux-undo { min-height: 44px; } }

/* ٨. البحث بلا نتيجة: زر يرجّعك للقائمة */
.empty .ux-clear { display: block; margin: 10px auto 0; }

/* ٩. تبويب التطبيقات */
.ux-apps .ux-app { gap: 12px; }
.ux-apps .ux-app .lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ux-apps .ux-app .ux-app-n { font-weight: 600; }
.ux-apps .ux-app .btn { flex: none; min-width: 72px; min-height: 36px; display: inline-grid; place-items: center; }
@media (pointer: coarse) { .ux-apps .ux-app .btn { min-height: 44px; } }
.ux-apps-q { width: 100%; margin: 4px 0 10px; min-height: 44px; }

/* ١٠. شريط الموقع الجاهز: «انشره» جنب «معاينة» */
.sitebar .ux-pub { margin-inline-start: 0; }
