/* مراح ذكي — المظهر «النُّحاس» (المظهر الوحيد، قرار المالك 2026-10-28).
 *
 * طبقة فوق styles.css: قواعد التخطيط والمكوّنات الخاصة بـ copper مقيّدة بـ html[data-ui="copper"]، وألوان الطابع كلها في
 * web/css/system.css. أنماط فقط — لا منطق ولا تغيير في المحتوى أو الوظائف. لا transform في الحركات
 * (الزر العائم يتموضع به) — scale/translate/rotate المستقلّة فقط. */

@font-face {
  font-family: 'Copper Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/app/fonts/cairo-var.ttf) format('truetype');
}

/* ملاحظة: ألوان الرموز الأربعة عشر (--bg … --warn-soft) صارت في web/css/tokens.css المولَّد من
 * seed/design_tokens.json (المصدر الوحيد للويب وiOS وأندرويد). لا تُعِدها هنا. */

/* ─────────────── الرموز ─────────────── */
/* ألوان الطابع (--teal-* و--cu-* و--phase و--on-phase* و--d-plate* و--c-lift) مصدرها web/css/system.css وحده. هنا ما ليس لوناً فقط. */

html[data-ui="copper"] {
  --radius: 20px;
  --radius-sm: 14px;

  --c-ease: cubic-bezier(.23, 1, .32, 1);
  --c-drawer: cubic-bezier(.32, .72, 0, 1);
  --c-font: 'Copper Sans', 'Cairo', system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

/* ─────────────── الحرف وأسطح المتصفح ─────────────── */

html[data-ui="copper"][lang="ar"] body,
html[data-ui="copper"]:not([lang]) body { font-family: var(--c-font); }
html[data-ui="copper"] body {
  background: var(--bg);
  color: var(--ink);
  caret-color: var(--cu-2);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
html[data-ui="copper"] ::selection { background: var(--teal-1); color: var(--on-phase); }
html[data-ui="copper"] * { scrollbar-width: thin; scrollbar-color: var(--cu-line) transparent; }
html[data-ui="copper"] :focus-visible { outline: 3px solid var(--cu-2); outline-offset: 2px; box-shadow: none; }
html[data-ui="copper"] button,
html[data-ui="copper"] .daily-action,
html[data-ui="copper"] .disclose-row { -webkit-user-select: none; user-select: none; }

html[data-ui="copper"] h1,
html[data-ui="copper"] h2,
html[data-ui="copper"] h3 { font-weight: 800; letter-spacing: -.01em; text-wrap: balance; color: var(--head); }
html[data-ui="copper"] .stat .value,
html[data-ui="copper"] .herd-total-value,
html[data-ui="copper"] td, html[data-ui="copper"] th,
html[data-ui="copper"] .vacc-chip strong { font-variant-numeric: tabular-nums; }

html[data-ui="copper"] .section-kicker { display: none; }
html[data-ui="copper"] .page-intro { margin: 4px 2px 16px; }
html[data-ui="copper"] .page-intro h1 { font-size: 2rem; line-height: 1.15; }
html[data-ui="copper"] .page-intro p { margin: 4px 0 0; color: var(--ink); font-weight: 600; font-size: 1.05rem; }

html[data-ui="copper"] .ui-icon > .ui-line { stroke-width: 1.9; }

/* ─────────────── الأسطح: ورق كريمي بظل مرتفع خفيف ─────────────── */

html[data-ui="copper"] .card {
  border: 1px solid color-mix(in srgb, var(--cu-line) 55%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--c-lift);
}
html[data-ui="copper"] .card .card { background: var(--surface-2); box-shadow: none; }

html[data-ui="copper"] .stat {
  border: 1px solid color-mix(in srgb, var(--cu-line) 45%, transparent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--c-lift);
}
html[data-ui="copper"] .stat .value { font-size: 1.6rem; font-weight: 800; color: var(--head); }

html[data-ui="copper"] .banner {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
}
html[data-ui="copper"] .banner.bad { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
html[data-ui="copper"] .pill { border-radius: 99px; font-weight: 700; }

html[data-ui="copper"] table { font-size: .94rem; }
html[data-ui="copper"] th { color: var(--head); font-weight: 800; font-size: .8rem; border-bottom: 1px solid var(--cu-line); }
html[data-ui="copper"] tr + tr td { border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }

/* ─────────────── الأفعال ─────────────── */

html[data-ui="copper"] .primary,
html[data-ui="copper"] button.primary {
  border-radius: 16px;
  font-weight: 800;
  transition: scale .16s var(--c-ease), filter .2s;
} /* لون الزر الرئيسي في system.css (--action-bg) */
html[data-ui="copper"] .primary:hover { filter: brightness(1.06); }
html[data-ui="copper"] .ghost { transition: scale .16s var(--c-ease), border-color .2s, background-color .2s; } /* لون الزر الثانوي في system.css (--action2-*) */
html[data-ui="copper"] .linkish,
html[data-ui="copper"] .text-action { color: var(--head); font-weight: 800; text-decoration: underline; text-decoration-color: var(--cu-2); text-decoration-thickness: 2px; text-underline-offset: 4px; }
html[data-ui="copper"] button.primary.danger,
html[data-ui="copper"] button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

html[data-ui="copper"] input,
html[data-ui="copper"] select,
html[data-ui="copper"] textarea {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px 3px rgba(96, 58, 28, .08);
  transition: border-color .15s;
}
html[data-ui="copper"] input:focus,
html[data-ui="copper"] select:focus,
html[data-ui="copper"] textarea:focus {
  border-color: var(--cu-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cu-2) 25%, transparent);
  outline: none;
}
html[data-ui="copper"] label { font-weight: 700; }

/* شرائح الفلترة والأقسام: كبسولة بحدّ نحاسي، والمختار لوح أخضر بنص كريمي */
html[data-ui="copper"] .chip,
html[data-ui="copper"] .herd-category-strip button {
  min-height: 42px;
  border: 1.5px solid var(--cu-line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--head);
  font-weight: 800;
  box-shadow: var(--c-lift);
  transition: background-color .22s var(--c-ease), color .2s, border-color .2s;
}
/* الحالة النشطة للشريحة في system.css؛ تبويبات الأقسام في ui_kit.css */

/* ─────────────── الشريط العلوي: أخضر داكن، والورقة تعلوه بحافة منحنية ─────────────── */

html[data-ui="copper"] { --topbar-height: 0px; }
html[data-ui="copper"] .topbar {
  position: relative;
  flex-wrap: wrap;
  height: auto;
  min-height: 0;
  padding: calc(18px + env(safe-area-inset-top)) 20px 12px;   /* DP-13: كان 44px لزخرفة ::after الملغاة (system.css) */
  border-bottom: 0;
  color: var(--on-phase); /* الخلفية في system.css */
}
/* DP-22 الآيباد العمودي 600–899: حشوة القشرة 16px كالمحتوى (كانت 20px). من 900 تتولاها css/frame.css */
@media (min-width: 600px) and (max-width: 899.98px) {
  html[data-ui="copper"] .topbar { padding-inline: 16px; }
}
html[data-ui="copper"] .topbar::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cu-3), var(--cu-1), var(--cu-3));
  opacity: .9;
}
html[data-ui="copper"] .topbar::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 28px;
  border-radius: 28px 28px 0 0;
  background: var(--bg);
  pointer-events: none;
}

/* الشعار الفاتح (أخضر الشعار يذوب على الأخضر الداكن) */
html[data-ui="copper"] .topbar .brand-wordmark {
  content: url(/app/brand/header-arabic-header-for-dark.svg);
  width: 112px;
  height: 60px;
}
/* اسم المزرعة في بطاقة الرئيسية وحسابي؛ في الرأس يبقى للقارئات فقط */
html[data-ui="copper"] .topbar .who-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* الأيقونات بلا إطار بلون الكريم؛ الترتيب من اليسار: الحساب ثم الدردشة ثم السلة ثم الجرس */
html[data-ui="copper"] #alerts-bell { order: 1; }
html[data-ui="copper"] #cart-button { order: 2; }
html[data-ui="copper"] #chat-button { order: 3; }
html[data-ui="copper"] #settings-gear { order: 4; }
html[data-ui="copper"] .topbar .bell,
html[data-ui="copper"] .topbar .icon-btn {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--on-phase);
}
html[data-ui="copper"] .topbar .bell .badge,
html[data-ui="copper"] .topbar .chat-badge,
html[data-ui="copper"] .topbar .cart-badge {
  background: linear-gradient(180deg, var(--cu-1), var(--cu-2));
  color: var(--cu-ink);
  font-weight: 800;
}
/* الصورة الشخصية بحلقة نحاسية */
html[data-ui="copper"] #settings-gear .profile-avatar { box-shadow: 0 0 0 2.5px var(--cu-2), 0 0 0 5px rgba(228, 173, 124, .22); }
html[data-ui="copper"] #settings-gear .profile-avatar.is-default { background: transparent; width: 44px !important; height: 44px !important; }
html[data-ui="copper"] #settings-gear .profile-avatar.is-default img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* ─────────────── التنقّل ─────────────── */

@media (min-width: 861px) {
    html[data-ui="copper"] .tabs button {
    border: 1.5px solid transparent;
    border-radius: 99px;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
  }
  html[data-ui="copper"] .tabs button:hover { color: var(--head); border-color: var(--cu-line); }
    html[data-ui="copper"] .tabs button:is([aria-selected="true"], [aria-current="page"]) .ui-tone { opacity: 0; }
}

/* الجوال: شريط نحاسي مصقول بكامل العرض، الأيقونة فوق الاسم، والنشط لوح أخضر */
@media (max-width: 860px) {
  html[data-ui="copper"] .bottombar {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    inset-inline: 0;
    bottom: 0;
    height: calc(72px + env(safe-area-inset-bottom));
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    gap: 4px;
    border: 0;
    border-radius: 26px 26px 0 0;
    /* خلفية الشريط السفلي في system.css */
  }
  html[data-ui="copper"] .bottombar button {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    height: auto;
    padding: 4px 2px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    color: var(--cu-ink);
    transition: background-color .2s ease, color .2s ease, scale .16s var(--c-ease);
  }
  html[data-ui="copper"] .bottombar button:active { scale: .96; }
  html[data-ui="copper"] .bottombar .nav-icon-shell { position: relative; background: transparent; width: auto; height: auto; padding: 0; margin: 0; border-radius: 0; display: grid; place-items: center; }
  html[data-ui="copper"] .bottombar button svg.ui-icon { width: 24px; height: 24px; }
  html[data-ui="copper"] .bottombar .ui-tone { opacity: 0; }
    html[data-ui="copper"] .bottombar button:is([aria-selected="true"], [aria-current="page"]) {
    border-color: rgba(228, 173, 124, .6);
    background: linear-gradient(180deg, var(--teal-1), var(--teal-3));
    color: var(--on-phase);
    box-shadow: 0 6px 14px -8px rgba(7, 43, 39, .9), inset 0 1px 0 rgba(255, 255, 255, .14);
  }
      html[data-ui="copper"] .fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
  html[data-ui="copper"] main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
}

/* زر التسجيل العائم: قرص نحاسي */
html[data-ui="copper"] .fab {
  border: 1px solid rgba(255, 238, 214, .6);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--cu-1), var(--cu-3));
  color: var(--cu-ink);
  font-weight: 800;
  box-shadow: 0 12px 24px -12px rgba(58, 32, 19, .7);
}
@media (max-width: 860px) {
  html[data-ui="copper"] .fab {
    width: 58px;
    height: 58px;
    min-height: 0;
    padding: 0;
    left: 12px;
    right: auto;
    gap: 0;
    justify-content: center;
    transform: none;
  }
  html[data-ui="copper"] .fab:active { transform: none; }
  html[data-ui="copper"] .fab span { display: none; }
  html[data-ui="copper"] .fab svg { width: 26px; height: 26px; }
}

/* ─────────────── الرئيسية والقطيع: البطاقة الرئيسية كريمية بحبر محمرّ ─────────────── */

html[data-ui="copper"] .herd-total-card,
html[data-ui="copper"] .market-shell-head {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--cu-line) 55%, transparent);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--c-lift);
}
html[data-ui="copper"] .herd-total-card::before,
html[data-ui="copper"] .herd-total-card::after { content: none; }
html[data-ui="copper"] .season-peek-button { color: var(--head); font-weight: 800; }
html[data-ui="copper"] .herd-total-card p { color: var(--muted); }
html[data-ui="copper"] .card.dashboard-daily-actions,
html[data-ui="copper"] .card.herd-browser { padding: 0; border: 0; background: transparent; box-shadow: none; }
html[data-ui="copper"] .card.herd-browser .section-heading { flex-wrap: wrap; row-gap: 4px; }
html[data-ui="copper"] .card.herd-browser .section-heading h2 { white-space: nowrap; }

/* عمل اليوم: التعليف زر عريض بحدّ نحاسي، والبقية بلاطات بأيقونة داخل قرص رمادي دافئ */
html[data-ui="copper"] .operation-shortcuts { gap: 10px; }
html[data-ui="copper"] .daily-action {
  border: 1.5px solid var(--cu-line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--head);
  font-weight: 800;
  box-shadow: var(--c-lift);
  transition: scale .16s var(--c-ease), border-color .15s;
}
html[data-ui="copper"] .daily-action .daily-action-symbol,
html[data-ui="copper"] .daily-action .daily-action-symbol .ui-icon { border-radius: 50%; background: transparent; color: var(--cu-3); }
/* DP-17 اختصارات التسجيل: شبكة 6 مسارات، كل بلاطة مساران، والصف الأخير الناقص يتمدد (مستقل عن عدد الأزرار؛ العدّ بـ«of» يستثني بلاطة التعليف الممتدة) */
html[data-ui="copper"] .dashboard-daily-actions .operation-shortcuts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
html[data-ui="copper"] .dashboard-daily-actions .operation-shortcuts .daily-action {
  flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 8px; min-height: 100px; padding: 12px 6px; font-size: .84rem; border-radius: 22px;
  background: var(--surface-2); border-color: transparent;
}
html[data-ui="copper"] body .dashboard-daily-actions .operation-shortcuts .daily-action:not(.daily-action-feed):nth-child(n) { grid-column: span 2; }
html[data-ui="copper"] body .dashboard-daily-actions .operation-shortcuts .daily-action:nth-child(3n+1 of .daily-action:not(.daily-action-feed)):nth-last-child(2 of .daily-action:not(.daily-action-feed)),
html[data-ui="copper"] body .dashboard-daily-actions .operation-shortcuts .daily-action:nth-child(3n+2 of .daily-action:not(.daily-action-feed)):nth-last-child(1 of .daily-action:not(.daily-action-feed)) { grid-column: span 3; }
html[data-ui="copper"] body .dashboard-daily-actions .operation-shortcuts .daily-action:nth-child(3n+1 of .daily-action:not(.daily-action-feed)):nth-last-child(1 of .daily-action:not(.daily-action-feed)) { grid-column: 1 / -1; }
html[data-ui="copper"] .dashboard-daily-actions .operation-shortcuts .daily-action .daily-action-symbol { width: 44px; height: 44px; background: color-mix(in srgb, var(--cu-line) 38%, transparent); }
html[data-ui="copper"] .dashboard-daily-actions .operation-shortcuts .daily-action .ui-icon { width: 22px; height: 22px; }
html[data-ui="copper"] .daily-action-feed,
html[data-ui="copper"] .dashboard-daily-actions .operation-shortcuts .daily-action-feed {
  grid-column: 1 / -1; flex-direction: row; justify-content: space-between; gap: 14px; min-height: 68px;
  padding: 0 20px; font-size: 1.15rem; border-radius: 20px;
  background: var(--surface); border: 1.5px solid var(--cu-line); color: var(--head);
}
html[data-ui="copper"] .dashboard-daily-actions .operation-shortcuts .daily-action-feed .daily-action-symbol { width: 40px; height: 40px; background: transparent; }
html[data-ui="copper"] .herd-lot-card .herd-lot-symbol { border-radius: 14px; background: var(--surface-2); color: var(--cu-3); }
html[data-ui="copper"] .herd-search::placeholder { color: var(--muted); opacity: .8; }
html[data-ui="copper"] .tagged-animal-card { border: 1px solid var(--line); border-radius: 16px; }

html[data-ui="copper"] .disclose-row,
html[data-ui="copper"] .context-link {
  border: 1px solid color-mix(in srgb, var(--cu-line) 55%, transparent);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--c-lift);
  transition: scale .16s var(--c-ease), border-color .15s;
}
html[data-ui="copper"] .disclose-row-copy strong { color: var(--head); font-weight: 800; }
html[data-ui="copper"] .disclose-row-go,
html[data-ui="copper"] .context-link svg { color: var(--accent-ink); }   /* FX2-14: علامة تنقّل ≥3:1 (كانت --cu-3 = accent: 1.99:1 نهاراً) */
/* التحصين: العدّادات كبسولات، والحالة علامة لا لون وحده */
html[data-ui="copper"] .vacc-chip {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--c-lift);
  transition: scale .16s var(--c-ease), background-color .2s;
}
html[data-ui="copper"] .vacc-chip strong { font-size: 1.45rem; font-weight: 800; color: var(--head); }
html[data-ui="copper"] .vacc-chip[aria-pressed="true"] { border-color: var(--cu-2); background: linear-gradient(180deg, var(--teal-1), var(--teal-2)); }
html[data-ui="copper"] .vacc-chip[aria-pressed="true"] strong,
html[data-ui="copper"] .vacc-chip[aria-pressed="true"] span { color: var(--on-phase); }
html[data-ui="copper"] .vacc-row,
html[data-ui="copper"] .vs-row { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--c-lift); }
html[data-ui="copper"] .vacc-dot { position: relative; width: 13px; height: 13px; border: 2.5px solid var(--muted); border-radius: 50%; background: transparent; }
html[data-ui="copper"] .vacc-row.is-ok .vacc-dot { border-color: var(--teal-1); background: var(--teal-1); }
html[data-ui="copper"] .vacc-row.is-soon .vacc-dot { border-color: var(--cu-2); }
html[data-ui="copper"] .vacc-row.is-due .vacc-dot { border-radius: 3px; border-color: var(--d-mark); background: var(--d-mark); }

/* مهام اليوم */
html[data-ui="copper"] .task-row { position: relative; min-height: 52px; gap: 14px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
html[data-ui="copper"] .task-row + .task-row { border-top: 1px solid var(--line); }
html[data-ui="copper"] .task-state-icon {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 2.5px solid var(--cu-2); border-radius: 50%; background: transparent; color: transparent;
  transition: background-color .2s ease, color .2s ease, scale .2s var(--c-ease);
}
html[data-ui="copper"] .task-row.on .task-state-icon { background: var(--teal-1); border-color: var(--teal-1); color: var(--on-phase); scale: 1.06; }
html[data-ui="copper"] .task-state-icon .ui-icon { width: 16px; height: 16px; }
html[data-ui="copper"] .task-row:not(.on) .task-state-icon .ui-icon { opacity: 0; }
html[data-ui="copper"] .task-row.on > span:last-child { opacity: .5; text-decoration: line-through; text-decoration-thickness: 2px; }
html[data-ui="copper"] .dashboard-tasks .dashboard-section-heading { flex-wrap: wrap; row-gap: 10px; align-items: center; }
html[data-ui="copper"] .dashboard-tasks .text-action { text-decoration: none; border: 1.5px solid var(--cu-line); border-radius: 999px; padding: 0 16px; min-height: 44px; background: var(--surface); }
html[data-ui="copper"] .dashboard-tasks .task-context-content > .card { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; }
html[data-ui="copper"] .dashboard-tasks .task-context-content > .card h2 { font-size: 1rem; margin: 6px 0 8px; }

/* ─────────────── حسابي: بطاقة الهوية خضراء بنص كريمي ─────────────── */

html[data-ui="copper"] .account-profile-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  gap: 14px;
  border: 1px solid var(--cu-2);
  border-radius: 24px;
  background: linear-gradient(165deg, var(--teal-1), var(--teal-3));
  color: var(--on-phase);
  box-shadow: 0 12px 24px -14px rgba(7, 43, 39, .8);
}
html[data-ui="copper"] .account-profile-hero > .ghost { width: auto; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
html[data-ui="copper"] .account-profile-hero > .ghost img,
html[data-ui="copper"] .account-profile-hero > .ghost .avatar { border: 3px solid var(--cu-2); }
html[data-ui="copper"] .account-profile-hero h1 { color: var(--on-phase); }
html[data-ui="copper"] .account-profile-hero small,
html[data-ui="copper"] .account-profile-hero .account-farm-name { color: var(--on-phase-soft); }
html[data-ui="copper"] .account-profile-hero .account-farm-name strong { color: var(--on-phase); }
html[data-ui="copper"] .account-profile-hero .account-farm-name { border-top-color: rgba(228, 173, 124, .35); }
html[data-ui="copper"] .account-badges span { border-radius: 99px; border-color: rgba(228, 173, 124, .55); background: transparent; color: var(--on-phase); }
html[data-ui="copper"] .account-groups { gap: 26px; margin-top: 22px; }
html[data-ui="copper"] .account-action-grid { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--c-lift); }
html[data-ui="copper"] .account-action-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
html[data-ui="copper"] .account-action-card:hover { transform: none; background: var(--surface-2); }
html[data-ui="copper"] .account-action-icon { border-radius: 14px; background: linear-gradient(180deg, var(--cu-1), var(--cu-3)); color: var(--cu-ink); }
html[data-ui="copper"] .team-member-row + .team-member-row { border-top-color: var(--line); }

/* ─────────────── السوق ─────────────── */

html[data-ui="copper"] .market-shell-head { margin: 4px 0 14px; padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; }
html[data-ui="copper"] .market-shell-head .market-head-row { display: block; }
html[data-ui="copper"] .market-shell-head .market-head-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html[data-ui="copper"] .market-shell-head .market-brand {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html[data-ui="copper"] .market-shell-head .market-sell-action,
html[data-ui="copper"] .market-shell-head .market-requests-action {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px;
  min-height: 100px; padding: 14px; border-radius: 20px; font: inherit; font-weight: 800; font-size: .95rem; text-align: start;
}
html[data-ui="copper"] .market-shell-head .market-sell-action { order: 1; }
html[data-ui="copper"] .market-shell-head .market-requests-action { order: 2; }
html[data-ui="copper"] .market-shell-head .market-sell-action .ui-icon,
html[data-ui="copper"] .market-shell-head .market-requests-action .ui-icon { width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: color-mix(in srgb, currentColor 12%, transparent); }
html[data-ui="copper"] .market-shell-head .market-sell-action span:last-child { display: inline; }
html[data-ui="copper"] .market-shell-head [role="tablist"] { border-color: transparent; background: var(--surface-2); border-radius: 16px; }
html[data-ui="copper"] .market-shell-head [role="tab"] { color: var(--head); border-radius: 12px; font-weight: 800; }
html[data-ui="copper"] .market-shell-head [role="tab"][aria-selected="true"] { background: var(--teal-1); color: var(--on-phase); }
html[data-ui="copper"] .market-card {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--cu-line) 55%, transparent);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--c-lift);
}
html[data-ui="copper"] .market-cover,
html[data-ui="copper"] .market-cover-placeholder { background: var(--surface-2); }
html[data-ui="copper"] .market-search { border-radius: 16px; }
html[data-ui="copper"] .market-sub-head { display: flex; align-items: center; gap: 12px; margin: 14px 0 12px; }
html[data-ui="copper"] .market-sub-head h1 { margin: 0; font-size: 1.25rem; }
html[data-ui="copper"] :is(.market-sell-action, .market-requests-action):focus:not(:focus-visible) { outline: none; box-shadow: none; }   /* زر الرجوع الواحد: ui_kit.css (WAVE2) */
html[data-ui="copper"] .market-refresh { min-height: 44px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 800; }
html[data-ui="copper"] .market-price-pending { margin: 4px 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: .9rem; grid-column: 1 / -1; }
html[data-ui="copper"] .market-bubble-row .market-info-bubble { width: auto; }
html[data-ui="copper"] a.icon-text, html[data-ui="copper"] a.ghost.small { text-decoration: none; }

/* ─────────────── الأوراق والنوافذ ─────────────── */

/* الجوال (<768) أوراق سفلية بهذا الطابع؛ من 768 النوافذ مركزية بطابع DP-27 (القاعدة الموحَّدة في آخر هذه الكتلة) */
@media (max-width: 767.98px) {
  html[data-ui="copper"] .modal-backdrop,
  html[data-ui="copper"] .sheet-backdrop { background: rgba(7, 43, 39, .58); }
  html[data-ui="copper"] .record-sheet,
  html[data-ui="copper"] .modal-box,
  html[data-ui="copper"] .sheet { border: 0; background: var(--bg); box-shadow: 0 -12px 40px -16px rgba(7, 43, 39, .6); }
  html[data-ui="copper"] .record-sheet { border-radius: 28px 28px 0 0; }
}
html[data-ui="copper"] .modal-box { border-radius: 24px; }
html[data-ui="copper"] .sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--cu-2); opacity: .6; }
@media (max-width: 767.98px) {
  html[data-ui="copper"] .record-sheet-close { border: 0; border-radius: 14px; background: linear-gradient(180deg, var(--teal-1), var(--teal-2)); color: var(--on-phase); }
}
html[data-ui="copper"] .popup-title,
html[data-ui="copper"] #quick-sheet h2 { font-weight: 800; }
html[data-ui="copper"] #quick-sheet .sheet-search { border-radius: 14px; }

/* ───── النوافذ المنبثقة F3 (DP-27…DP-32، T-61/G-A) ─────
 * من 768 (آيباد وحاسوب) كل نافذة في وسط الشاشة بمكان ثابت: S 420 / M 560 / L 802، سطح واحد وظل واحد وستار واحد (--scrim) بلا تمويه.
 * الاستثناء: قائمة الاختيار .select-sheet المنسدلة تحت حقلها، ونوافذ المجتمع داخل إطار الفيديو. الجوال (<768) أوراق سفلية كما هي.
 * القواعد المنافسة (copper أعلاه، styles.css، money_modern.css، vaccinations.css) حُصرت في مصدرها تحت 768 حيث لزم؛ الباقي بخصوصية أعلى هنا.
 * 768 لا 861: عند 834 كانت mm-sheet ومعالج التحصين في الوسط والأوراق الأخرى في الأسفل — نمطان في الجهاز نفسه. */
/* DP-27 (رفض المالك 2026-10-30: «النافذة المنبثقة يفترض يكون مكانها ثابت»): من 768 (الآيباد والحاسوب) كل نافذة في وسط الشاشة بمكان واحد ثابت،
 * وفق متطلبات Frontend Design (LIVE-REVIEW.md FD-1…FD-12). الاستثناء: قائمة الاختيار .select-sheet المنسدلة تحت حقلها (Popover). الجوال (<768) ورقة سفلية كما هي.
 * 768 لا 861: عند 834 كانت mm-sheet (من 700) ومعالج التحصين في الوسط والأوراق الأخرى في الأسفل — نمطان في الجهاز نفسه. */
@keyframes dp-dialog-in { from { opacity: 0; translate: 0 8px; scale: .98; }}
@keyframes dp-fade { from { opacity: 0; }}
@media (min-width: 768px) {
  /* FD-4 ستار واحد */
  html[data-ui] body .sheet-backdrop, html[data-ui] body .modal-backdrop { backdrop-filter: none; -webkit-backdrop-filter: none;}  /* اللون: var(--scrim) (AUD-30، أدناه في DP-31) (copper.css:487-488) للنوعين */
  html[data-ui] body .modal-backdrop:has(.record-sheet) { align-items: center; padding: 24px;}  /* كان من 861 (styles.css:3807-3811) */
  /* FD-1 الموضع: وسط الشاشة (الأوراق اليدوية position: fixed؛ الصناديق داخل .modal-backdrop متوسطة بـflex أصلاً) */
  html[data-ui] body .sheet, html[data-ui] body #alerts-sheet, html[data-ui] body #quick-sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); margin: 0;}
  html[data-ui] body .mm-sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); translate: none; margin: 0;}
  /* FD-2 ثلاث درجات عرض: S 420 تأكيد/إجراء سريع، M 560 نماذج وتفاصيل، L 802 معالج متعدد الخطوات */
  html[data-ui] body .modal-box:not(.record-sheet):not(.vx-drawer):not(.vx-wizard):not(.vx-sheet), html[data-ui] body .sheet.is-confirm { width: min(420px, calc(100% - 48px)); max-width: none;}
  html[data-ui] body .sheet, html[data-ui] body #alerts-sheet, html[data-ui] body #quick-sheet, html[data-ui] body .record-sheet, html[data-ui] body .modal-box.vx-drawer, html[data-ui] body .modal-box.vx-sheet, html[data-ui] body .mm-sheet { width: min(560px, calc(100% - 48px)); max-width: none;}
  html[data-ui] body .modal-box.vx-wizard { width: min(802px, calc(100% - 48px)); max-width: none; height: min(720px, calc(100dvh - 64px)); inset: auto; transform: none; position: static;}
  /* FD-3 الارتفاع بحسب المحتوى حتى min(92dvh, 100dvh - 48px) ثم تمرير داخلي */
  html[data-ui] body .sheet, html[data-ui] body #alerts-sheet, html[data-ui] body #quick-sheet, html[data-ui] body .record-sheet, html[data-ui] body .modal-box, html[data-ui] body .mm-sheet { max-height: min(92dvh, calc(100dvh - 48px)); overflow-y: auto; overscroll-behavior: contain;}
  html[data-ui] body .modal-box.vx-wizard { max-height: none;}
  /* FD-5 سطح واحد */
  html[data-ui] body .sheet, html[data-ui] body #alerts-sheet, html[data-ui] body #quick-sheet, html[data-ui] body .record-sheet, html[data-ui] body .modal-box, html[data-ui] body .mm-sheet {
    background: var(--surface); border: 1px solid var(--c-sand-a45); border-radius: 24px;
    box-shadow: var(--dialog-shadow); backdrop-filter: none; -webkit-backdrop-filter: none;}
  html[data-ui] body :is(.sheet, #alerts-sheet, #quick-sheet, .record-sheet, .mm-sheet) .sheet-handle, html[data-ui] body .mm-sheet .mm-grab { display: none;}
  /* FD-7 الحشوات: 24px أفقياً (S/M) و32px (L) */
  html[data-ui] body .sheet, html[data-ui] body #alerts-sheet, html[data-ui] body #quick-sheet, html[data-ui] body .modal-box:not(.record-sheet), html[data-ui] body .mm-sheet { padding: 24px;}
  /* (كان هنا padding: 24px 32px للمعالج — حُذف: AUD-26/ر-1، فالنافذة مبنية بحشوة 0 ورأس وتذييل بحشوتهما) */
  /* FD-6 الإغلاق في نهاية الرأس (يسار في RTL) 44×44 حيث يوجد زر إغلاق */
  html[data-ui] body .record-sheet-top { min-height: 56px; align-items: center;}  /* FD-6 صف رأس 56px */
  html[data-ui] body .record-sheet-close { inset-inline-start: auto; inset-inline-end: 20px; top: 14px; width: 44px; height: 44px;}
  /* رأس نوافذ التسجيل وجسمها على حشوة 24 كبقية النوافذ: العنوان عند حافة المحتوى لا في الوسط بحشوة 56 (styles.css:3795، :3799، :3825) */
  html[data-ui] body .record-sheet .record-sheet-top { padding: 14px 24px 0;}
  html[data-ui] body .record-sheet .record-sheet-top .popup-title { min-height: 44px; display: flex; align-items: center; padding-block: 0 2px; padding-inline: 0 56px;}  /* T-61/I: حشوة سفلية 2px: مستطيل نص عنوان طويل الملتفّ يتجاوز صندوقه ~1.4px (visual_acceptance longtitle) */
  html[data-ui] body .record-sheet .record-sheet-body { padding-inline: 24px; padding-top: 12px;}
  html[data-ui] body .modal-box.vx-drawer .vx-details-body { padding-inline: 0;}
  /* زر إغلاق واحد الشكل في كل النوافذ (كان أخضر مصمتاً هنا ورمادياً شفافاً في الأوراق) */
  html[data-ui] body .record-sheet .record-sheet-close { background: var(--c-white-a06); color: var(--c-paper); border: 0; border-radius: 50%;}
  /* لا بطاقة داخل نافذة: إطار البطاقة الداخلي بلا حشوة يُلصق النص بحده (popupbox الحالي وF3) */
  html[data-ui] body .record-sheet .record-sheet-body > .card, html[data-ui] body .record-sheet .record-sheet-body > * > .card:only-child { border: 0; background: none; box-shadow: none; padding: 0;}
}
/* FD-8 حركة واحدة لكل الأنواع: تلاشٍ + ارتفاع 8px + scale(.98→1) في 200ms؛ مع تقليل الحركة تلاشٍ فقط */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  html[data-ui] body :is(.sheet-backdrop, .modal-backdrop) { animation: dp-fade var(--modal-ms) ease-out backwards;}
  html[data-ui] body :is(.sheet, #alerts-sheet, #quick-sheet, .record-sheet, .modal-box, .mm-sheet) { animation: dp-dialog-in var(--modal-ms) cubic-bezier(.2, .8, .2, 1) backwards;}
}
/* مع reduce: القاعدة العامة styles.css `* { animation: none !important }` تعطي ظهوراً فورياً (قرار المدير: يطابق U-8)، فلا كتلة تلاشٍ هنا */
/* ui-ux U-9: حدّ ظاهر ≥3:1 فوق الستار المعتم؛ U-5: حقول 16px (لا تكبير iOS)؛ U-10: لا تمرير للصفحة خلف النافذة؛ U-7: لوحة المفاتيح */
@media (min-width: 768px) {
  html[data-ui] body :is(.sheet, .record-sheet, .modal-box, .mm-sheet) :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { font-size: max(16px, 1em);}
  html:has(body :is(.sheet-backdrop, .modal-backdrop, .mm-scrim)) { overflow: hidden;}
  /* بقاء عرض المحتوى خلف الستار ثابتاً: core.js يضع data-dp-gutter حين يوجد شريط تمرير حقيقي وقت فتح النافذة (بلا ذلك قفز 7px عند 1024، قيس cw 1009→1024)؛ صفحة بلا شريط لا تُحجَز لها حارة */
  html[data-dp-gutter] { scrollbar-gutter: stable;}
  html.kb-open :is(.sheet, #alerts-sheet, #quick-sheet) { bottom: auto; top: calc(var(--vv-top, 0px) + var(--vvh, 100dvh) / 2); max-height: calc(var(--vvh, 100dvh) - 32px);}
  /* السقف يتبع المرئي فوق لوحة المفاتيح لكل أنواع النوافذ (قياس 834: نافذة تسجيل بارتفاع 828 تجاوزت vvh=564)؛ بخصوصية أعلى من سقف FD-3 أعلاه */
  html.kb-open[data-ui] body :is(.sheet, #alerts-sheet, #quick-sheet, .record-sheet, .modal-box, .mm-sheet):not(.vx-wizard) { max-height: calc(var(--vvh, 100dvh) - 32px);}
}
html[data-ui] body :is(.alert-open) { min-height: 44px;}  /* يغلب styles.css:1377 */
/* AUD-21: نصيحة السحب لا تعمل بالفأرة ← تُخفى من 768 (يبقى «×» 44×44، styles.css:1381) */
@media (min-width: 768px) {
  #alerts-sheet .sheet-hint { display: none;}
}
/* AUD-1/21 + FD-6: زر إغلاق في نهاية صف العنوان (يسار في RTL) 44×44 لكل ورقة (يُضاف بـJS؛ محاكاة: shots.spec.js DP_SIMJS) */
@media (min-width: 768px) {
  html[data-ui] body :is(.sheet, #alerts-sheet) .dp-close { position: absolute; top: 24px; inset-inline-end: 20px; width: 44px; height: 44px; border-radius: 50%; border: 0;
    background: var(--c-white-a06); color: var(--c-paper); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center;}
  html[data-ui] body :is(.sheet, #alerts-sheet) > h2 { min-height: 44px; display: flex; align-items: center; margin-top: 0; padding-inline-end: 56px;}
}
/* FX2-17 (قرار المالك 2026-11-15): على الجوال (<768) كل نافذة ورقة سفلية قابلة للسحب (web/js/modules/sheet_drag.js): مقبض في الأعلى، عنوان في الوسط،
 * و«×» مرئي 48×48 في طرف النهاية (كان مخفياً بصرياً 1×1 تحت 768 بقرار T-61). نقطتا توقف: الوسط (الارتفاع الطبيعي) وكامل (حتى أعلى الشاشة).
 * الستار وEscape يغلقان كما كانا. من 768 لا شيء من هذا: النوافذ مركزية ثابتة بهندستها السابقة. */
html[data-ui] body .modal-box > .sheet-handle { display: block; margin: 0 auto 8px; flex: none;}   /* FX2-17-F1: span مضمّن كان 0×0 */
@media (min-width: 768px) {
  html[data-ui] body .modal-box > .sheet-handle { display: none;}
}
@media (max-width: 767.98px) {
  html[data-ui] body .modal-backdrop:not(:has(> .vx-wizard-box)):not(:has(> .vx-drawer)) { align-items: flex-end; padding: 0;}
  html[data-ui] body .modal-box:not(.record-sheet):not(.vx-wizard-box):not(.vx-drawer) { width: 100%; max-width: none; border-radius: 24px 24px 0 0; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); position: relative;}
  html[data-ui] body :is(.sheet-handle, .mm-grab, .record-sheet-top) { touch-action: none;}
  /* مقبض واحد (F2/F3): 40×5 محايد بلا شريط نحاسي، وكتلة علوية واحدة: مقبض (8 فوقه و4 تحته) ثم صف عنوان 48 و«×» بمركز الصف نفسه (top 17) */
  html[data-ui] body :is(.sheet, #alerts-sheet, .mm-sheet) { padding-top: 0;}
  html[data-ui] body :is(.sheet-handle, .mm-grab):not(.select-sheet *) { display: block; flex: 0 0 auto; width: 40px; height: 5px; border-radius: 3px; background: var(--c-paper-a60); opacity: 1; margin: 8px auto 4px;}
  html[data-ui] body .record-sheet-top { padding-top: 0;}
  html[data-ui] body .record-sheet-top .sheet-handle { flex: 0 0 40px;}
  html[data-ui] body .record-sheet-top .popup-title { min-height: 48px; display: flex; align-items: center; justify-content: center; padding-block: 0;}
  html[data-ui] body .ux .rec-head { justify-content: center; text-align: center; padding: 0 64px var(--sp-2); align-items: center;}   /* F5 */
  html[data-ui] body .ux .rec-head .back-btn { position: absolute; inset-inline-start: 12px; top: 17px; margin: 0;}   /* R3: الرجوع عند حافة البداية */
  html[data-ui] body .ux .rec-head > div { display: flex; flex-direction: column-reverse; align-items: center;}   /* العنوان في صف الـ✕ والتاريخ تحته */
  html[data-ui] body .ux .rec-head h2 { min-height: 48px; display: flex; align-items: center; justify-content: center; margin: 0;}
  html[data-ui] body :is(.sheet, #alerts-sheet, .mm-sheet) > .dp-close, html[data-ui] body .modal-box > .dp-close { position: absolute; top: 17px; inset-inline-end: 12px; z-index: 4; width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 0; border-radius: 50%; border: 0;
    background: var(--c-white-a06); color: var(--c-paper); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center;}
  html[data-ui] body :is(.sheet, #alerts-sheet) > h2,
  html[data-ui] body .modal-box:has(> .dp-close) > :is(h2, h3):first-of-type,
  html[data-ui] body .mm-sheet > h3 { min-height: 48px; display: flex; align-items: center; justify-content: center; margin-top: 0; text-align: center; padding-inline: 64px;}
  html[data-ui] body .record-sheet-top .popup-title { text-align: center; padding-inline: 64px;}
  html[data-ui] body .record-sheet-close { inset-inline-start: auto; inset-inline-end: 12px; top: 17px; width: 48px; height: 48px; min-width: 48px; min-height: 48px; border-radius: 50%;
    background: var(--c-white-a06); color: var(--c-paper); background-image: none;}
  html[data-ui] body :is(.sheet, #alerts-sheet, .modal-box, .mm-sheet)[data-sheet-state="full"] { border-radius: 24px 24px 0 0;}
}
/* FX2 R1–R5 (مراجعة Fable الجولة 2): عنوان واحد لكل الأوراق على الجوال (حجم/وزن مشتركان)، ونماذج التسجيل بلا بطاقة داخلية وعنوانها في صف الـ✕، وعنوان المساعد/النوافذ الموحَّدة نفسه */
html[data-ui] body .finance-workspace > button.primary + * { margin-top: 8px;}   /* R5 */
@media (max-width: 767.98px) {
  html[data-ui] body :is(.sheet, #alerts-sheet) > h2, html[data-ui] body .mm-sheet > h3, html[data-ui] body .record-sheet-top .popup-title,
  html[data-ui] body .ux .rec-head h2, html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-head strong,
  html[data-ui] body .modal-box:not(.vx-drawer):not(.vx-wizard-box) .modal-head h3 { font-size: 1.08rem; font-weight: 800;}
  /* R1: نموذج تسجيل بلا عنوان في رأس الورقة */
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-top { min-height: 0; padding: 0;}
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-body { padding-top: 0;}
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-close { top: 17px;}
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-body > .card, html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-body > * > .card:only-child { border: 0; background: none; box-shadow: none; padding: 0;}
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-body .record-head { justify-content: center; text-align: center; padding: 0 64px 8px;}
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-body .record-head > div { display: flex; flex-direction: column; align-items: center;}
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-body .record-head strong { min-height: 48px; display: flex; align-items: center; justify-content: center;}
  /* R2: kit modal (المساعد وغيره): صف عنوان 48 في الوسط و«×» الرأس على خطه */
  html[data-ui] body .modal-box:not(.vx-drawer):not(.vx-wizard-box) .ux-modal-host .modal-head { position: relative; min-height: 48px; padding: 0 64px; justify-content: center; text-align: center;}
  html[data-ui] body .modal-box:not(.vx-drawer):not(.vx-wizard-box) .ux-modal-host .modal-head .icon-btn { position: absolute; inset-inline-end: 12px; top: 0; width: 48px; height: 48px; min-width: 48px; min-height: 48px;}
}
/* openModal (core.js:866-867) لا يضع زر إغلاق: نوافذ .modal-box (تفاصيل التحصين، البوابة، إخفاء تعليق) تأخذ الزر نفسه في الموضع نفسه على كل الشاشات (U-1…U-3، FD-6) */
html body .modal-box:has(> .dp-close):not(.vx-wizard):not(.vx-drawer) { position: relative;}
/* درج التفاصيل: صفحة كاملة fixed تحت 768 (يحتوي زر الإغلاق المطلق أصلاً)، ومن 768 static فيُموضَع ليحمل الزر */
@media (min-width: 768px) { html body .modal-box.vx-drawer:has(> .dp-close) { position: relative;} }
html body :is(.modal-box, .mm-sheet) > .dp-close { position: absolute; top: 24px; inset-inline-end: 20px; z-index: 4; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--c-white-a06); color: var(--c-paper); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center;}
html body .modal-box:has(> .dp-close) > :is(h2, h3):first-of-type, html body .modal-box:has(> .dp-close) > :is(div, form):first-of-type > :is(h2, h3):first-child { min-height: 44px; display: flex; align-items: center; margin-top: 0; padding-inline-end: 56px;}   /* العنوان قد يكون داخل غلاف (chat-menu، auth-2fa): لا يتراكب مع الزر */
@media (min-width: 768px) {
  /* رأس تفاصيل التحصين: صف عنوان على سطح النافذة نفسه بلا شريط داكن (vaccinations.css:188) */
  html[data-ui] body .modal-box.vx-drawer .vx-sheet-head { background: var(--surface); border-bottom: 0; padding: 0; padding-inline-end: 56px; min-height: 44px; margin-bottom: 8px; font-size: 18px;}
  /* مفاوضة خاصة: الحقل بارتفاع زر «إرسال» */
  html[data-ui] body .sheet .row-actions { align-items: stretch;}
}
/* U-6/U-7: زر الإجراء ظاهر عند أي ارتفاع — صف الأزرار لاصق في أسفل النافذة حين يتجاوز محتواها الارتفاع (بلون السطح نفسه، فلا تغيّر عند الارتفاع العادي) */
@media (min-width: 768px) {
  html[data-ui] body :is(.sheet, #alerts-sheet, .record-sheet-body, .modal-box:not(.vx-wizard)) :is(.row, .row-actions):has(> button.primary) {
    position: sticky; bottom: 0; z-index: 2; background: var(--surface); padding-top: 12px; box-shadow: none;}  /* بلا ظل ولا امتداد حين لا تمرير (الجولة الرابعة) */
  html[data-ui] body :is(.sheet, #alerts-sheet, .record-sheet-body, .modal-box:not(.vx-wizard)).is-scrollable :is(.row, .row-actions):has(> button.primary) { box-shadow: 0 -1px 0 var(--line), 0 24px 0 0 var(--surface);}
  /* حلقة بلون السطح حول الزر اللاصق تخفي ما يمرّ تحته (غير مرئية على السطح عند الارتفاع العادي) */
  html[data-ui] body :is(.sheet, .record-sheet-body, .modal-box:not(.vx-wizard)) form > button.primary:last-of-type { position: sticky; bottom: 0; z-index: 2; box-shadow: none;}  /* bottom: 0 لا 12: قيد اللصق من حافة محتوى المُمرِّر، فـ12 كانت ترفع الزر 12px فوق آخر محتوى حتى بلا تمرير (قيس: gap = 0) */
  html[data-ui] body :is(.sheet, .record-sheet-body, .modal-box:not(.vx-wizard)).is-scrollable form > button.primary:last-of-type { box-shadow: 0 0 0 12px var(--surface), 0 12px 0 12px var(--surface), 0 -13px 0 0 var(--line);}
  /* ui-ux U-6 (Focus Not Obscured): حقل مركَّز لا يختفي تحت التذييل اللاصق */
  html[data-ui] body :is(.sheet, #alerts-sheet, .record-sheet-body, .modal-box, .mm-sheet) { scroll-padding-bottom: 88px;}
  /* نافذة تسجيل بلا عنوان في رأسها (العنوان داخل النموذج): لا صف رأس فارغ، والإغلاق بمستوى عنوان النموذج */
  html[data-ui] body .record-sheet .record-sheet-top:not(:has(.popup-title)) { min-height: 0; padding: 0;}
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-body { padding-top: 24px;}
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-body .record-head { padding-inline-end: 56px;}  /* record_forms.js:343، :707، :866 */
  html[data-ui] body .record-sheet:not(:has(.popup-title)) .record-sheet-close { top: 18px;}
}
/* DP-31 · الجولة الثانية لـFrontend Design (LIVE-REVIEW.md «الجولة الثانية: F3 بالصورة») — من 768 */
@media (min-width: 768px) {
  /* FD-4: ستار «تسجيل حركة مالية» هو ستار copper الموحّد بلا تمويه (money_modern.css:198) */
  /* AUD-30 (قرار FD والمدقق والمدير): ستار B موحّد بلا تمويه لكل النوافذ من 768. الرمز --scrim يُعرَّف في system.css وحده (حارس الألوان الحرفية)؛ تعريفه هنا محاكاة لذلك السطر */
  html[data-ui] body :is(.sheet-backdrop, .modal-backdrop, .mm-scrim) { background: var(--scrim); -webkit-backdrop-filter: none; backdrop-filter: none;}
  /* FD-6: صف عنوان mm-sheet 44 وزر الإغلاق بالموضع نفسه (يُضاف بـJS في money_page.js:292) */
  html[data-ui] body .mm-sheet:has(> .dp-close) > h3 { min-height: 44px; display: flex; align-items: center; margin-top: 0; padding-inline-end: 56px;}
  /* DP-17 على بلاطات الورقة: 6 مسارات، كل بلاطة مساران، والصف الناقص يتمدد (لا خلية فارغة) — money_modern.css:205 */
  html[data-ui] body .mm-sheet .mm-sg { grid-template-columns: repeat(6, minmax(0, 1fr));}
  html[data-ui] body .mm-sheet .mm-sg > button { grid-column: span 2;}
  html[data-ui] body .mm-sheet .mm-sg > button:nth-child(3n+1):nth-last-child(2), html[data-ui] body .mm-sheet .mm-sg > button:nth-child(3n+1):nth-last-child(2) + button { grid-column: span 3;}
  html[data-ui] body .mm-sheet .mm-sg > button:nth-child(3n+1):last-child { grid-column: span 6;}
  /* FD-5/6/7/10: معالج التحصين بالسطح والرأس والتذييل نفسها: لا حشوة على الصندوق، الرأس على السطح، الإغلاق دائرة 44 بموضع البقية، والتذييل ملاصق للقاع (vaccinations.css:188، :193-197، :39) */
  html[data-ui] body .modal-box.vx-wizard { padding: 0;}
  html[data-ui] body .modal-box.vx-wizard .vx-sheet-head { background: var(--surface); border-bottom: 0; padding-block: 24px 8px; padding-inline: 32px 20px; font-size: 18px;}
  html[data-ui] body .modal-box.vx-wizard .vx-sheet-head .vx-icon { width: 44px; height: 44px; min-height: 44px; border-radius: 50%; border: 0; background: var(--c-white-a06); color: var(--c-paper); display: grid; place-items: center;}
  html[data-ui] body .modal-box.vx-wizard .vx-stepper { padding: 4px 32px 8px;}
  html[data-ui] body .modal-box.vx-wizard .vx-wiz-body { padding: 8px 32px 16px;}
  html[data-ui] body .modal-box.vx-wizard .vx-wiz-error { margin: 0 32px;}
  html[data-ui] body .modal-box.vx-wizard .vx-wiz-foot { background: var(--surface); border-top: 1px solid var(--line); padding: 16px 32px 24px;}
  /* U-6: «التالي» ظاهر عند أي ارتفاع — vaccinations.css:242 يجعل التذييل ثابتاً تحت 520 فيختفي بالتمرير؛ يبقى لاصقاً (والرأس وحده يمرّ) */
  html[data-ui] body .modal-box.vx-wizard .vx-wiz-foot { position: sticky; bottom: 0;}
  /* مفاوضة خاصة: الحقل يأخذ المساحة والزر بعرض محتواه (styles.css:2456) */
  html[data-ui] body .sheet .row-actions:has(> input) { flex-wrap: nowrap; align-items: stretch;}
  html[data-ui] body .sheet .row-actions > input { flex: 1 1 auto; min-width: 0; height: auto; align-self: stretch;}
  html[data-ui] body .sheet .row-actions:has(> input) > button { flex: 0 0 auto; width: auto; min-width: 96px; padding-inline: 20px;}
  /* بلاغ تشغيلي: هامش 12 فوق التذييل اللاصق */
  html[data-ui] body :is(.sheet, .record-sheet-body, .modal-box:not(.vx-wizard)) form > button.primary:last-of-type { margin-top: 12px;}
}
@media (min-width: 768px) {
  /* AUD-28: «تجاهل» كلمةً بجانب «افتح» لا «×» يشبه زر الإغلاق (styles.css:1381) */
  html[data-ui] body .dp-alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;}
  html[data-ui] body .dp-alert-actions .alert-dismiss.dp-dismiss-text { position: static; width: auto; height: 44px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--c-paper-a60); background: transparent; color: var(--c-paper); font-size: 14px; font-weight: 700; line-height: 1;}
}
.tok { white-space: nowrap; unicode-bidi: isolate;}  /* الجولة الرابعة: رمز أو تاريخ لا ينكسر بين سطرين (dashboard_page.js:557-583) */
.alert-body > .muted.small { white-space: pre-line;}  /* فاصل الأقساط: alerts.py يفصلها بـ"\n" ودashboard_page.js:577 يعرضها بلا pre-line فتنهار في سطر (ui-ux) */

/* «تجاهل» نصاً من 768 بدل «×» (AUD-28)؛ تحت 768 «×» وحده كما كان */
.alert-dismiss .dp-dismiss-label { display: none;}
@media (min-width: 768px) {
  html[data-ui] body .alert-dismiss.dp-dismiss-text .dp-dismiss-x { display: none;}
  html[data-ui] body .alert-dismiss.dp-dismiss-text .dp-dismiss-label { display: inline;}
  /* AUD-16: حقل datetime-local الحقيقي مخفي بصرياً (يحمل القيمة والإرسال والمسودة) وحقل العرض النصي للقراءة فقط */
}
.dp-due-native { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0;}
.dp-due-native.is-revealed { position: static; width: 100%; height: auto; margin: 0; clip: auto; opacity: 1;}
.dp-due-display { cursor: pointer;}

html[data-ui="copper"] .toast { border: 1px solid var(--cu-2); border-radius: 16px; background: var(--teal-2); color: var(--on-phase); font-weight: 700; }
html[data-ui="copper"] .toast.bad { background: var(--danger); border-color: var(--danger); color: #fff; }

/* العنوان في الصفحة نفسها (لا في الرأس): لا يُخفى مهما تطابق مع اسم الباب */
html[data-ui="copper"] .page-intro.band-dup { position: static; width: auto; height: auto; margin: 4px 2px 16px; padding: 0; overflow: visible; clip: auto; white-space: normal; }

/* ─────────────── الحركة ───────────────
 * ظهور قصير متتابع للمحتوى، وانكماش خفيف عند الضغط. منحنى واحد، لا حركة فوق 460ms،
 * وتتوقف كلها مع «تقليل الحركة». */

@keyframes cu-rise { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes cu-sheet { from { translate: 0 100%; } to { translate: 0 0; } }
@keyframes cu-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  /* الرئيسية (وغلافها .dashboard-workspace) سطح كامل بخلفيتها وصورتها: لا تدخل بحركة opacity من 0 (كانت تكشف خلفية الصدفة فتومض الصفحة كلها عند كل دخول) */
  html[data-ui="copper"] #view > *:not(.home2):not(:has(> .home2)),
  html[data-ui="copper"] #view > * > section,
  html[data-ui="copper"] #view .herd-section-content > *,
  html[data-ui="copper"] #view .settings-section-content > * { animation: cu-rise .44s var(--c-ease) backwards; }
  html[data-ui="copper"] #view > *:nth-child(2),
  html[data-ui="copper"] #view > * > section:nth-child(2) { animation-delay: .05s; }
  html[data-ui="copper"] #view > *:nth-child(3),
  html[data-ui="copper"] #view > * > section:nth-child(3) { animation-delay: .1s; }
  html[data-ui="copper"] #view > *:nth-child(n+4),
  html[data-ui="copper"] #view > * > section:nth-child(n+4) { animation-delay: .14s; }
  html[data-ui="copper"] .operation-shortcuts .daily-action { animation: cu-rise .36s var(--c-ease) backwards; }
  html[data-ui="copper"] .operation-shortcuts .daily-action:nth-child(2) { animation-delay: .04s; }
  html[data-ui="copper"] .operation-shortcuts .daily-action:nth-child(3) { animation-delay: .08s; }
  html[data-ui="copper"] .operation-shortcuts .daily-action:nth-child(4) { animation-delay: .12s; }
  html[data-ui="copper"] .operation-shortcuts .daily-action:nth-child(n+5) { animation-delay: .16s; }

  html[data-ui="copper"] .modal-backdrop,
  html[data-ui="copper"] .sheet-backdrop { animation: cu-fade .22s ease-out backwards; }
  @media (max-width: 767.98px) {
    html[data-ui="copper"] .record-sheet,
    html[data-ui="copper"] #quick-sheet,
    html[data-ui="copper"] #alerts-sheet { animation: cu-sheet .42s var(--c-drawer) backwards; }
  }
  html[data-ui="copper"] .modal-box:not(.record-sheet) { animation: cu-rise .3s var(--c-ease) backwards; }
  html[data-ui="copper"] .toast:not(.bad) { animation: cu-rise .3s var(--c-ease) backwards; }

  html[data-ui="copper"] .primary:active,
  html[data-ui="copper"] .fab:active,
  html[data-ui="copper"] .daily-action:active,
  html[data-ui="copper"] .ghost:active,
  html[data-ui="copper"] .disclose-row:active,
  html[data-ui="copper"] .vacc-chip:active { scale: .97; }

  @media (hover: hover) and (pointer: fine) {
    html[data-ui="copper"] .daily-action:hover,
    html[data-ui="copper"] .disclose-row:hover,
    html[data-ui="copper"] .herd-lot-card:hover,
    html[data-ui="copper"] .market-card:hover { border-color: var(--cu-3); }
  }
}

/* ─────────────── ضبط مسافات بسيط (2026-10-09): بلا مساس بالألوان أو الأشكال ─────────────── */
/* الأيقونات أقرب بعضها لبعض فيتّسع الصف للسلة في السوق ويبقى على سطر الشعار */
html[data-ui="copper"] .topbar-actions { gap: 0; }
html[data-ui="copper"] .topbar .bell,
html[data-ui="copper"] .topbar .icon-btn { width: 48px; height: 48px; } /* مساحة لمس 48 كحدّ أدنى */
/* الشارة عند زاوية الأيقونة لا زاوية الزر */
html[data-ui="copper"] .topbar .bell .badge,
html[data-ui="copper"] .topbar .chat-badge,
html[data-ui="copper"] .topbar .cart-badge { top: 6px; inset-inline-end: 6px; }
@media (min-width: 768px) { html[data-ui="copper"] body .topbar :is(.bell .badge, .chat-badge, .cart-badge) { top: 0; inset-inline-end: 0; } }   /* DP-29 (T-61): الشارة على زاوية الجرس لا داخله */
@media (max-width: 860px) {
  html[data-ui="copper"] main { padding-top: 4px; }
  html[data-ui="copper"] .page-intro { margin: 0 2px 12px; }}
/* DP-14 (تحت 900): 16px بين القشرة والمحتوى بدل 4–12px غير الموحّدة بعد DP-13. يُستثنى: الرئيسية والقطيع (ترويستهما مخفية تحت 900، herd_v2.css)،
 * والتحصين (لوحه يملأ الصفحة ملتصقاً بالقشرة، DP-21)، والمحادثات والمجتمع (ملء الشاشة تحت 861). من 900: css/frame.css */
@media (max-width: 899.98px) {
  :is(html, html[data-ui]) body:not(:has(.home2)):not(:has(.hv2-on)):not(:has(.vx-on)):not(:has(.chat-shell)):not(:has(.community-feed)) main { padding-top: 16px; }
}
/* DP-14 (تكملة): هامش 8px فوق اختصارات التسجيل (styles.css) كان يفصلها عن عنوان مخفي للقارئات فقط (أدناه)، فيُضاف إلى المسافة تحت القشرة (24 بدل 16) */
html[data-ui="copper"] .card.dashboard-daily-actions .operation-shortcuts { margin-top: 0; }
/* أيقونة (i) قريبة من العنوان */
html[data-ui="copper"] .page-intro h1 { gap: 0; }
html[data-ui="copper"] .page-intro h1 .info-help { flex-basis: 44px; width: 44px; min-height: 44px; }
/* السوق: بلاطتان أقصر بلا فراغ بين الأيقونة والنص */
html[data-ui="copper"] .market-shell-head { margin: 0 0 10px; }
/* «تسجيل التعليف اليومي»: الأيقونة بجوار النص */
html[data-ui="copper"] .daily-action-feed,
html[data-ui="copper"] .dashboard-daily-actions .operation-shortcuts .daily-action-feed { justify-content: flex-start; gap: 10px; }
/* الرئيسية: مسافة واحدة متقاربة بين البطاقات (كانت تجتمع هامش البطاقة مع فجوة الشبكة) */html[data-ui="copper"] .dashboard-workspace { gap: 12px; }
html[data-ui="copper"] .dashboard-workspace > .card { margin-bottom: 0; }

/* ─────────────── إزالة نصوص زائدة بطلب المالك (2026-10-09) ─────────────── */
/* التشغيل: العنوان والوصف و«سجّل عمل اليوم» (تبقى للقارئات فقط) */
html[data-ui="copper"] .page-intro.feed-page-intro,
html[data-ui="copper"] .page-intro.feed-page-intro.band-dup,
html[data-ui="copper"] .card.dashboard-daily-actions > .dashboard-section-heading {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* التحصين: سطر الشرح تحت العنوان */
html[data-ui="copper"] .vaccination-view > h2 + p.muted { display: none; }
/* السوق: النص مباشرة بجانب الأيقونة في صف واحد */
html[data-ui="copper"] .market-shell-head .market-sell-action,
html[data-ui="copper"] .market-shell-head .market-requests-action {
  flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 64px; padding: 12px 14px;
}
html[data-ui="copper"] .market-shell-head .market-sell-action,
html[data-ui="copper"] .market-shell-head .market-requests-action { gap: 8px; padding: 10px; font-size: .92rem; white-space: nowrap; }
html[data-ui="copper"] .market-shell-head .market-sell-action .ui-icon,
html[data-ui="copper"] .market-shell-head .market-requests-action .ui-icon { flex: 0 0 auto; width: 32px; height: 32px; padding: 7px; }
html[data-ui="copper"] .market-shell-head .market-sell-action,
html[data-ui="copper"] .market-shell-head .market-requests-action { justify-content: center; }

/* مساحات لمس أوسع للتبويبات الفرعية والشرائح (بلا تغيير في الشكل المرئي سوى ارتفاع بسيط) */
html[data-ui="copper"] .chip,
html[data-ui="copper"] .herd-category-strip button { min-height: 46px; }
