/* ==========================================================================
   مكتب الجنايات — الإصدار ٢.١
   أنيميشن لعبة تفاعلي • شريط رسم مدمج ذكي • طاولة أدلة واقعية • واجهة صافية
   ========================================================================== */

@font-face {
  font-family: 'Cairo';
  src: url('fonts/Cairo-Variable.ttf') format('truetype');
  font-weight: 300 900;
  font-display: swap;
}

@font-face {
  font-family: 'IBMPlexArabic';
  src: url('fonts/IBMPlexSansArabic-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'IBMPlexArabic';
  src: url('fonts/IBMPlexSansArabic-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'AmiriGov';
  src: url('fonts/Amiri-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'AmiriGov';
  src: url('fonts/Amiri-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg-deep: #05070B;
  --bg-surface: #0B1018;
  --bg-card: #111826;
  --bg-elevated: #182235;

  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(217, 164, 65, 0.38);

  --crimson: #DC2626;
  --crimson-dark: #991B1B;
  --gold: #F59E0B;
  --gold-light: #FDE68A;
  --gold-soft: rgba(245, 158, 11, 0.14);
  --emerald: #10B981;

  --txt-main: #F8FAFC;
  --txt-sec: #CBD5E1;
  --txt-muted: #94A3B8;

  --font-head: 'Cairo', system-ui, sans-serif;
  --font-ui: 'IBMPlexArabic', 'Cairo', system-ui, sans-serif;
  --font-gov: 'AmiriGov', Georgia, serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-deep);
  color: var(--txt-main);
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-select: none;
}

input, textarea, select, button {
  font-family: inherit;
}

input, textarea {
  user-select: text;
  -webkit-user-select: text;
}

@supports (-webkit-touch-callout: none) {
  input, textarea, select {
    font-size: max(16px, 1rem);
  }
}

.hidden { display: none !important; }

.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.view {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.view.active { display: flex; }

/* ==================== الشاشة ٠: أنيميشن اللعبة السينمائي متعدد المراحل ==================== */
.intro-backdrop {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, #151F35 0%, #060910 68%, #030508 100%);
  position: relative;
  overflow: hidden;
  padding: 20px;
  gap: 14px;
}

/* كشاف البحث الذي يمسح مسرح الجريمة */
.intro-searchlight {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, rgba(220, 38, 38, 0.08) 42%, transparent 70%);
  pointer-events: none;
  animation: searchSweep 4.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes searchSweep {
  0%   { transform: translate(-130px, -90px) scale(0.75); opacity: 0.4; }
  32%  { transform: translate(115px, -45px) scale(0.95); opacity: 0.9; }
  62%  { transform: translate(-70px, 65px) scale(1.05); opacity: 0.95; }
  100% { transform: translate(0, -18px) scale(1.18); opacity: 1; }
}

.intro-scene-box {
  position: relative;
  width: 320px;
  height: 248px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-board-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro-radar-c1 {
  transform-origin: 180px 140px;
  animation: spinSlow 9s linear infinite;
}
.intro-radar-c2 {
  transform-origin: 180px 140px;
  animation: spinRev 6s linear infinite;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes spinRev  { to { transform: rotate(-360deg); } }

/* رسم خيوط الأدلة الحمراء تلقائياً */
.clue-thread {
  stroke: #EF4444;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.7));
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
}
.clue-thread.t1 { animation: drawThread 0.55s ease-out 0.18s forwards; }
.clue-thread.t2 { animation: drawThread 0.55s ease-out 0.36s forwards; }
.clue-thread.t3 { animation: drawThread 0.55s ease-out 0.54s forwards; }
.clue-thread.t4 { animation: drawThread 0.55s ease-out 0.72s forwards; }
.clue-thread.t5 {
  stroke: rgba(245, 158, 11, 0.45);
  stroke-width: 1.5;
  animation: drawThread 1.1s ease-out 0.85s forwards;
}
@keyframes drawThread {
  to { stroke-dashoffset: 0; }
}

/* ظهور دبابيس الأدلة تباعاً */
.clue-pin {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.clue-pin.p1 { animation: pinSlam 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) 0.10s forwards; }
.clue-pin.p2 { animation: pinSlam 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) 0.28s forwards; }
.clue-pin.p3 { animation: pinSlam 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) 0.46s forwards; }
.clue-pin.p4 { animation: pinSlam 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) 0.64s forwards; }

@keyframes pinSlam {
  0%   { opacity: 0; transform: scale(2.4); }
  100% { opacity: 1; transform: scale(1); }
}

/* العدسة المكبرة التي تتجول فوق الخيوط ثم تستقر لكشف الأيقونة */
.intro-magnifier {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.85));
  animation: magnifierHunt 3.1s cubic-bezier(0.35, 0, 0.2, 1) forwards;
}

@keyframes magnifierHunt {
  0%   { opacity: 0; transform: translate(-115px, -75px) scale(0.7) rotate(-25deg); }
  20%  { opacity: 1; transform: translate(-82px, -48px) scale(0.95) rotate(-12deg); }
  45%  { opacity: 1; transform: translate(84px, -36px) scale(1) rotate(14deg); }
  68%  { opacity: 1; transform: translate(-58px, 52px) scale(0.96) rotate(-8deg); }
  88%  { opacity: 1; transform: translate(6px, 6px) scale(1.12) rotate(0deg); }
  100% { opacity: 0; transform: translate(26px, 26px) scale(1.32) rotate(8deg); }
}

/* كشف شعار اللعبة ولمعة الضوء والختم الجنائي */
.intro-emblem-reveal {
  position: relative;
  z-index: 4;
  width: 132px;
  height: 132px;
  opacity: 0;
  animation: emblemPop 0.65s cubic-bezier(0.22, 1, 0.36, 1) 1.55s forwards;
}

@keyframes emblemPop {
  0%   { opacity: 0; transform: scale(0.45) rotate(-8deg); }
  70%  { opacity: 1; transform: scale(1.06) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.intro-emblem-sheen {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  padding: 3px;
  background: linear-gradient(145deg, #FDE68A, #B45309 60%, #DC2626);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.88), 0 0 34px rgba(245, 158, 11, 0.32);
  position: relative;
  overflow: hidden;
}
.intro-emblem-sheen::after {
  content: '';
  position: absolute;
  top: -40%;
  left: -120%;
  width: 75%;
  height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: rotate(24deg);
  animation: sheenSweep 0.9s ease-in-out 2.15s forwards;
}
@keyframes sheenSweep {
  to { left: 165%; }
}

.intro-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 27px;
  display: block;
}

.intro-secret-stamp {
  position: absolute;
  bottom: -10px;
  left: -16px;
  padding: 2px 10px;
  background: rgba(185, 28, 28, 0.95);
  border: 2px solid #FCA5A5;
  border-radius: 6px;
  color: #FFF;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
  opacity: 0;
  animation: stampHit 0.38s cubic-bezier(0.22, 1, 0.36, 1) 2.35s forwards;
}
@keyframes stampHit {
  0%   { opacity: 0; transform: scale(2.6) rotate(-26deg); }
  75%  { opacity: 1; transform: scale(0.94) rotate(-11deg); }
  100% { opacity: 1; transform: scale(1) rotate(-13deg); }
}

.intro-text-block {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  animation: textSlideUp 0.6s ease-out 1.75s forwards;
}
@keyframes textSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.intro-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 2.1rem;
  font-weight: 900;
  background: linear-gradient(180deg, #FFFFFF 15%, #FDE68A 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-sub {
  margin: 4px 0 14px;
  font-size: 0.84rem;
  color: var(--gold-light);
  opacity: 0.9;
}

.intro-prog-track {
  width: 190px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 12px;
}
.intro-prog-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #DC2626, #F59E0B, #FDE68A);
  animation: introLoadBar 3.9s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
@keyframes introLoadBar {
  0%   { width: 0%; }
  100% { width: 100%; }
}

.intro-skip-link {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(253, 230, 138, 0.3);
  color: var(--txt-sec);
  padding: 5px 16px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== الشاشة ١: القائمة الرئيسية بخلفية مصورة ==================== */
.menu-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  filter: brightness(0.68) contrast(1.08);
}

.menu-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 24%, rgba(12, 18, 30, 0.25) 0%, rgba(5, 7, 11, 0.88) 78%),
    linear-gradient(180deg, rgba(5, 7, 11, 0.55) 0%, rgba(5, 7, 11, 0.35) 38%, rgba(5, 7, 11, 0.95) 100%);
}

.menu-content-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  gap: 14px;
}

.menu-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.menu-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(11, 16, 24, 0.72);
  border: 1px solid rgba(253, 230, 138, 0.26);
  backdrop-filter: blur(10px);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-light);
}

.gold-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.apk-pill {
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #D97706, #B45309);
  color: #FFF;
  font-family: var(--font-head);
  font-size: 0.74rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35);
}

.menu-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.menu-hero-logo {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  border: 1.5px solid rgba(253, 230, 138, 0.55);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.82);
  margin-bottom: 8px;
}

.menu-hero-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 900;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
  color: #FFF;
}

/* بطاقة تعريف المحقق: خانتان يدويتان للرتبة والاسم */
.identity-glass-card {
  background: rgba(13, 19, 31, 0.8);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(253, 230, 138, 0.28);
  border-radius: 15px;
  padding: 11px 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.id-card-hdr {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 7px;
}

.id-inputs-row {
  display: flex;
  gap: 8px;
}

.dark-input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(5, 7, 11, 0.9);
  color: var(--txt-main);
  font-size: 0.87rem;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.dark-input:focus { border-color: var(--gold); }
.dark-input.compact { padding: 7px 10px; font-size: 0.82rem; }

.rank-manual-input {
  width: 39%;
  flex-shrink: 0;
  border-color: var(--border-strong);
  color: var(--gold-light);
  font-family: var(--font-head);
  font-weight: 700;
}
.name-manual-input { flex: 1; }

/* أزرار القائمة الرئيسية بأحجام متناسقة وأنيقة */
.main-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(15, 22, 35, 0.85);
  backdrop-filter: blur(14px);
  color: var(--txt-main);
  text-align: right;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.52);
  transition: transform 0.14s, border-color 0.16s;
}
.menu-action-btn:active { transform: scale(0.98); }

.menu-action-btn.primary {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.88), rgba(127, 29, 29, 0.92));
  border-color: rgba(252, 165, 165, 0.38);
}

.menu-action-btn.accent {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.34), rgba(17, 24, 39, 0.9));
  border-color: rgba(245, 158, 11, 0.45);
}

.m-btn-ico {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.22rem;
  flex-shrink: 0;
}

.m-btn-txt {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.m-btn-txt strong {
  font-family: var(--font-head);
  font-size: 0.98rem;
  font-weight: 800;
}
.m-btn-txt span {
  font-size: 0.74rem;
  color: rgba(248, 250, 252, 0.76);
}

.m-btn-arr {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--gold-light);
}

.m-count-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--gold);
  color: #05070B;
  font-family: var(--font-head);
  font-size: 0.76rem;
  font-weight: 900;
}

/* ==================== الشاشات الفرعية (حجم زر الرجوع مدمج ومتناسق) ==================== */
.subview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-nav-back {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--gold-light);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.hdr-spacer { width: 64px; flex-shrink: 0; }

.subview-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--txt-main);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 13px 34px;
  -webkit-overflow-scrolling: touch;
}

.cases-catalog {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 15px;
}

.case-dossier-card {
  background: linear-gradient(165deg, #151E2E, #0D131F);
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.case-cover-wrap {
  position: relative;
  height: 172px;
  overflow: hidden;
}
.case-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.case-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.2) 0%, rgba(5, 7, 11, 0.92) 100%);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.case-top-tags {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.stamp-secret {
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(185, 28, 28, 0.88);
  color: #FFF;
  font-family: var(--font-head);
  font-size: 0.69rem;
  font-weight: 800;
}
.stamp-time {
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(11, 16, 24, 0.82);
  border: 1px solid rgba(253, 230, 138, 0.35);
  color: var(--gold-light);
  font-size: 0.7rem;
  font-weight: 700;
}
.case-num-lbl {
  font-size: 0.72rem;
  color: var(--gold-light);
  font-weight: 700;
}
.case-cover-bottom h3 {
  margin: 2px 0 0;
  font-family: var(--font-head);
  font-size: 1.06rem;
  font-weight: 900;
  color: #FFF;
}

.case-card-body {
  padding: 13px 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.case-Victim-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.76rem;
  color: #FCA5A5;
}
.case-synopsis {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.62;
  color: var(--txt-sec);
  flex: 1;
}
.case-start-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* أزرار عامة */
.btn-crimson, .btn-gold, .btn-sec {
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  font-family: var(--font-head);
  font-size: 0.81rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
}
.btn-crimson:active, .btn-gold:active, .btn-sec:active { transform: scale(0.97); }
.btn-crimson {
  background: linear-gradient(135deg, #DC2626, #991B1B);
  color: #FFF;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}
.btn-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(180, 83, 9, 0.34));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--gold-light);
}
.btn-sec {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--txt-sec);
}
.mini-btn { padding: 6px 11px; font-size: 0.75rem; }
.full-w { width: 100%; padding: 12px; font-size: 0.88rem; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--txt-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* الغرف السابقة */
.saved-rooms-list {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.empty-saved-box {
  text-align: center;
  padding: 48px 20px;
  color: var(--txt-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 16px;
}
.saved-room-card {
  background: linear-gradient(155deg, #141D2D, #0E1420);
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.saved-room-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.room-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--gold-light);
  font-size: 0.74rem;
  font-weight: 700;
}
.room-pill.solo {
  background: rgba(56, 189, 248, 0.13);
  border-color: rgba(56, 189, 248, 0.35);
  color: #BAE6FD;
}
.saved-room-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1rem;
  color: #FFF;
}
.saved-room-sub {
  font-size: 0.78rem;
  color: var(--txt-muted);
}
.saved-room-btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.btn-resume {
  flex: 1;
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #D97706, #B45309);
  color: #FFF;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
}
.btn-del-room {
  width: 38px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #FCA5A5;
  cursor: pointer;
}

/* ==================== طاولة التحقيق النظيفة (بدون شريط علوي) ==================== */
.desk-view-clean {
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg-deep);
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748B;
  display: inline-block;
}
.conn-dot.online {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

/* إشعار دعوة الزملاء الأنيق (Spotlight) */
.spotlight-banner {
  margin: 8px 12px 4px;
  padding: 9px 12px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.55);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.sp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sp-sender {
  font-family: var(--font-head);
  font-size: 0.75rem;
  color: var(--gold-light);
}
.sp-doc {
  font-size: 0.79rem;
  color: #FFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotlight-btns { display: flex; align-items: center; gap: 6px; }
.btn-spotlight-go {
  padding: 5px 11px;
  border-radius: 8px;
  border: none;
  background: var(--gold);
  color: #05070B;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 900;
  cursor: pointer;
}
.btn-spotlight-x {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt-muted);
  cursor: pointer;
}

.desk-pane {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.desk-pane.active { display: flex; }

/* ==================== طاولة الأدلة الجنائية + عنوان القضية فوق الوصف ==================== */
.dossier-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 13px 32px;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(circle at 50% 0%, rgba(180, 83, 9, 0.11), transparent 58%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 48px),
    linear-gradient(180deg, #0D1119 0%, #080B11 100%);
}

.case-brief-banner {
  max-width: 980px;
  margin: 0 auto 13px;
  background: linear-gradient(145deg, rgba(25, 34, 51, 0.94), rgba(14, 20, 31, 0.97));
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-right: 4px solid var(--crimson);
  border-radius: 14px;
  padding: 13px 15px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.brief-code-row {
  margin-bottom: 2px;
}
.brief-case-code {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--gold);
}
.brief-case-title {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 900;
  color: #FFF;
}
.brief-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--gold-light);
  margin-bottom: 5px;
}
.brief-victim { margin: 0 0 5px; font-size: 0.83rem; font-weight: 700; color: #FCA5A5; }
.brief-summary { margin: 0; font-size: 0.81rem; line-height: 1.65; color: var(--txt-sec); }

.doc-filter-strip {
  max-width: 980px;
  margin: 0 auto 14px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.doc-filter-strip::-webkit-scrollbar { display: none; }
.doc-cat-chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(17, 24, 38, 0.9);
  color: var(--txt-muted);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.doc-cat-chip.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(180, 83, 9, 0.28));
  border-color: var(--gold);
  color: var(--gold-light);
}

/* شبكة ملفات الطاولة الجنائية الواقعية */
.evidence-desk-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}

.ev-card-folder {
  position: relative;
  background: linear-gradient(170deg, #E8D9B8 0%, #D9C49B 100%);
  color: #1C1610;
  border-radius: 4px 12px 10px 10px;
  padding: 16px 14px 14px;
  margin-top: 8px;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  border: 1px solid #A79067;
  transition: transform 0.16s;
}
.ev-card-folder::before {
  content: '';
  position: absolute;
  top: -9px;
  right: 0;
  width: 96px;
  height: 10px;
  background: #DFC9A0;
  border: 1px solid #A79067;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.ev-card-folder:active { transform: scale(0.98); }

.folder-clip {
  position: absolute;
  top: -5px;
  left: 16px;
  width: 14px;
  height: 26px;
  border: 2.5px solid #64748B;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
}
.folder-stamp {
  display: inline-block;
  padding: 2px 8px;
  border: 1.5px solid #991B1B;
  color: #991B1B;
  font-family: var(--font-head);
  font-size: 0.67rem;
  font-weight: 800;
  border-radius: 3px;
  transform: rotate(-2deg);
}
.ev-card-folder .ev-title {
  margin: 9px 0 5px;
  font-family: var(--font-gov);
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.4;
  color: #14100C;
}
.ev-card-folder .ev-sub {
  margin: 0;
  font-size: 0.74rem;
  color: #4A3E2D;
  line-height: 1.45;
}

.ev-card-polaroid {
  position: relative;
  background: #F4F1EA;
  color: #18181B;
  padding: 10px 10px 13px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.72);
  transition: transform 0.16s;
}
.ev-card-polaroid:active { transform: scale(0.98); }
.polaroid-pin {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FCA5A5, #DC2626 65%, #7F1D1D);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}
.polaroid-img {
  width: 100%;
  height: 138px;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  background: #090D14;
}
.polaroid-title {
  margin: 9px 0 2px;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.35;
}
.polaroid-code {
  font-size: 0.7rem;
  color: #52525B;
  font-weight: 700;
}

.ev-card-video {
  background: linear-gradient(160deg, #0F172A, #070B13);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 13px;
  padding: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
}
.vid-screen-preview {
  height: 118px;
  border-radius: 8px;
  background: radial-gradient(circle, #112622 0%, #05090C 85%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
}
.vid-rec-pill {
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: 0.66rem;
  font-weight: 800;
  color: #FCA5A5;
  background: rgba(220, 38, 38, 0.24);
  padding: 2px 7px;
  border-radius: 999px;
}
.vid-play-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.2);
  border: 1.5px solid #34D399;
  color: #A7F3D0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.ev-card-locked {
  background: linear-gradient(155deg, #1E1318, #0E121B);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
}
.ev-locked-top { display: flex; justify-content: space-between; align-items: center; }
.doc-locked-tag {
  font-size: 0.69rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.22);
  color: #FCA5A5;
}
.doc-secret-tag {
  font-size: 0.67rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: #065F46;
  color: #A7F3D0;
}
.doc-annot-tag {
  font-size: 0.67rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: #92400E;
  color: #FEF3C7;
}

/* ==================== عارض الوثائق والصور والفيديو النقي ==================== */
.doc-reader-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #05070B;
}

.doc-reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-back-dossier {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--gold-light);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.76rem;
  cursor: pointer;
}

.doc-reader-actions { display: flex; align-items: center; gap: 6px; }
.btn-ping-partner {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.16);
  color: var(--gold-light);
  font-family: var(--font-head);
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.mini-sq-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--txt-sec);
  font-weight: 700;
  cursor: pointer;
}
.gold-sq { border-color: rgba(245, 158, 11, 0.45); color: var(--gold-light); }

/* ==================== شريط الرسم المدمج جنباً إلى جنب (الأدوات يميناً + الألوان والسمك يساراً) ==================== */
.compact-draw-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
  background: #0B1019;
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
  flex-shrink: 0;
}

.cdb-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.mode-switch, .b-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.b-mode {
  padding: 4px 7px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--txt-sec);
  font-family: var(--font-head);
  font-size: 0.71rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.b-mode.active {
  background: rgba(239, 68, 68, 0.22);
  border-color: #EF4444;
  color: #FFF;
}
.b-mode.eraser.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38BDF8;
}
.b-mode.hand.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--gold);
  color: var(--gold-light);
}

.b-icon {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--txt-main);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.b-icon:disabled { opacity: 0.35; cursor: default; }
.b-icon.danger { color: #FCA5A5; border-color: rgba(239, 68, 68, 0.3); }
.b-icon.gold { color: var(--gold-light); border-color: rgba(245, 158, 11, 0.35); }
.b-icon.eye-off { background: rgba(239, 68, 68, 0.2); border-color: #EF4444; color: #FCA5A5; }

/* الصندوق الأيسر المدمج للألوان وحجم الخط والأستيكة */
.cdb-left {
  min-width: 0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cdb-slot-hint {
  font-size: 0.7rem;
  color: var(--txt-muted);
  text-align: center;
}

.cdb-slot-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.cdb-er-title {
  font-size: 0.71rem;
  color: var(--txt-sec);
  text-align: center;
}

.swatches-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  flex-wrap: nowrap;
}

.b-swatch, .d-swatch {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--c);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.b-swatch.active, .d-swatch.active {
  transform: scale(1.16);
  border-color: #FFF;
  box-shadow: 0 0 0 1.5px var(--gold);
}

.custom-col-btn {
  position: relative;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
  flex-shrink: 0;
}
.custom-col-btn input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.slider-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.sl-lbl {
  font-size: 0.72rem;
  color: var(--gold-light);
  min-width: 15px;
  text-align: center;
}
.slider-strip input[type="range"] {
  flex: 1;
  min-width: 50px;
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: var(--gold);
}
.preview-cell {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.p-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #EF4444;
}
.e-ring {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px dashed #38BDF8;
}

/* مسرح العرض النقي بدون أي خلفية منقطة أو برواز حول الصورة */
.doc-interactive-vp {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  touch-action: none;
  user-select: none;
  background: #05070B;
}
.doc-interactive-vp[data-tool="hand"] { cursor: grab; }
.doc-interactive-vp[data-tool="hand"].panning { cursor: grabbing; }
.doc-interactive-vp[data-tool="pen"] { cursor: crosshair; }
.doc-interactive-vp[data-tool="eraser"] { cursor: none; }

.doc-annot-world {
  position: absolute;
  top: 0;
  left: 0;
  direction: rtl;
  transform-origin: 0 0;
  will-change: transform;
  display: inline-block;
}

.pure-photo-el {
  display: block;
  width: 960px;
  height: auto;
  pointer-events: none;
}

.pure-video-wrap {
  width: 854px;
  background: #000;
  position: relative;
}
.pure-video-el {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.video-ctrl-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(9, 13, 21, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  direction: ltr;
}
.vid-ctrl-btn {
  padding: 5px 13px;
  border-radius: 7px;
  border: 1px solid var(--gold);
  background: rgba(245, 158, 11, 0.18);
  color: var(--gold-light);
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}
.vid-seek-slider { flex: 1; accent-color: var(--gold); }
.vid-time-lbl {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--txt-sec);
  min-width: 78px;
  text-align: right;
}

/* الأوراق الحكومية المصرية الأصيلة + الصور المدمجة داخل الورقة */
.doc-annot-content .gov-paper {
  width: 560px;
  max-width: none;
  margin: 0;
  color: #181512;
  font-family: var(--font-gov);
  font-size: 17.5px;
  line-height: 1.92;
  padding: 24px 22px 30px;
  position: relative;
  user-select: none;
}

.inline-paper-photo {
  margin: 14px 0;
  padding: 6px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.28);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.inline-paper-photo img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.paper-police {
  background: linear-gradient(180deg, #F6EFDF 0%, #EFE5CE 100%);
  border: 2px solid #3F3527;
  outline: 1px solid #8A795D;
  outline-offset: -6px;
}
.paper-autopsy {
  background: linear-gradient(180deg, #ECF3EE 0%, #E2ECE5 100%);
  border: 2px solid #1E463B;
  outline: 1px solid #6B9084;
  outline-offset: -6px;
  color: #10211C;
}
.paper-interrogation {
  background-color: #F8F2E4;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 33px,
    rgba(59, 130, 246, 0.14) 34px
  );
  border: 1px solid #C2B49A;
  border-right: 5px solid #991B1B;
}
.paper-newspaper {
  background: linear-gradient(180deg, #EAE0CA 0%, #DFD3B8 100%);
  border: 1px solid #7C705B;
  color: #1A1714;
}
.paper-telecom {
  background: #F4F6F9;
  border: 2px solid #334155;
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.82;
  color: #0F172A;
}

.gov-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 2px double #2C241B;
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.gov-ministry { font-weight: 700; font-size: 0.93em; line-height: 1.5; }
.gov-ref-box {
  text-align: left;
  font-size: 0.8em;
  line-height: 1.5;
  border: 1px solid rgba(0, 0, 0, 0.35);
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.42);
}
.gov-stamp-top {
  display: inline-block;
  padding: 1px 10px;
  border: 2px solid #B91C1C;
  color: #B91C1C;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.72rem;
  transform: rotate(-3deg);
}
.gov-doc-title {
  text-align: center;
  font-size: 1.18em;
  font-weight: 700;
  margin: 8px 0 14px;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.gov-sec-hdr { margin: 12px 0 4px; font-weight: 700; color: #7F1D1D; }
.gov-body-line { margin: 0 0 6px; text-align: justify; }
.gov-qa-q { margin: 8px 0 3px; font-weight: 700; color: #7F1D1D; }
.gov-qa-a { margin: 0 0 8px; padding-right: 8px; border-right: 2px solid rgba(0,0,0,0.2); }

.news-masthead {
  border-top: 3px solid #181512;
  border-bottom: 3px double #181512;
  padding: 6px 0;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 900;
}
.news-headline {
  font-family: var(--font-head);
  font-size: 1.28em;
  font-weight: 900;
  line-height: 1.42;
  margin: 0 0 14px;
  color: #111;
}
.doc-annot-content .news-columns {
  column-count: 2;
  column-gap: 20px;
  column-rule: 1px solid rgba(0, 0, 0, 0.25);
}
.news-col-block { break-inside: avoid; margin-bottom: 14px; }
.news-subhead {
  margin: 0 0 5px;
  font-family: var(--font-head);
  font-size: 1em;
  font-weight: 800;
  color: #7F1D1D;
}

.gov-footer {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.gov-signature {
  color: #1E3A8A;
  font-weight: 700;
  font-size: 0.94em;
  transform: rotate(-2deg);
}
.gov-ink-seal {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 2.5px double rgba(88, 28, 135, 0.72);
  color: rgba(88, 28, 135, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-head);
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1.25;
  padding: 6px;
  transform: rotate(-11deg);
  pointer-events: none;
}

.doc-annot-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* شاشة القفل التفاعلي */
.doc-paper-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 14px 36px;
}
.device-lock-box {
  max-width: 440px;
  margin: 18px auto;
  background: linear-gradient(160deg, #151D2C, #0D121C);
  border: 1.5px solid rgba(245, 158, 11, 0.42);
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.78);
}
.device-lock-ico { font-size: 2.8rem; margin-bottom: 8px; }
.device-lock-title {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold-light);
}
.device-lock-desc {
  margin: 0 0 16px;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--txt-sec);
}
.device-pin-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: #05070B;
  color: #FFF;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
  margin-bottom: 12px;
  user-select: text;
  -webkit-user-select: text;
}

/* ==================== السبورة اللانهائية ==================== */
.board-workspace { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.detective-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: none;
  background-color: #070A10;
}
.detective-stage[data-grid="dots"] {
  background-image: radial-gradient(rgba(148, 163, 184, 0.2) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}
.detective-stage[data-grid="squares"] {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 24px 24px;
}
.detective-stage[data-tool="hand"] { cursor: grab; }
.detective-stage[data-tool="hand"].panning { cursor: grabbing; }
.detective-stage canvas { width: 100%; height: 100%; display: block; }

.floating-sheets-pill {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 12;
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(11, 16, 24, 0.85);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.b-sheet {
  padding: 4px 9px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--txt-muted);
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.b-sheet.active {
  background: var(--gold-soft);
  color: var(--gold-light);
}

.e-cursor {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  border: 2px dashed #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  pointer-events: none;
  opacity: 0;
  z-index: 20;
}
.stage-watermark {
  position: absolute;
  bottom: 10px;
  left: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(11, 16, 24, 0.78);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--txt-muted);
  pointer-events: none;
}

/* ==================== التبويب ٢: الاتهام النهائي والتصويت والمقارنة ==================== */
.stages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 36px;
}

.verdict-card {
  max-width: 720px;
  margin: 0 auto 16px;
  background: linear-gradient(160deg, #141D2D, #0C121D);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 18px 16px;
}
.verdict-title {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 1.06rem;
  font-weight: 900;
  color: var(--gold-light);
}
.verdict-prompt {
  margin: 0 0 12px;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--txt-sec);
}
.verdict-textarea {
  width: 100%;
  min-height: 125px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #06090F;
  color: #FFF;
  font-size: 0.9rem;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  margin-bottom: 12px;
  user-select: text;
  -webkit-user-select: text;
}
.verdict-textarea:focus { border-color: var(--gold); }

.proposal-vote-box {
  max-width: 720px;
  margin: 0 auto 16px;
  background: linear-gradient(155deg, rgba(180, 83, 9, 0.2), rgba(15, 23, 42, 0.96));
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  padding: 16px;
}
.pv-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--gold-light);
}
.pv-text {
  background: rgba(5, 7, 11, 0.78);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.86rem;
  line-height: 1.65;
  color: #FFF;
  white-space: pre-wrap;
  margin-bottom: 12px;
}
.pv-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 8px;
}
.pv-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #10B981);
  transition: width 0.25s;
}
.pv-meta { font-size: 0.78rem; color: var(--txt-sec); margin-bottom: 12px; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.comparison-wrap {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.result-banner {
  padding: 18px;
  border-radius: 16px;
  text-align: center;
  font-family: var(--font-head);
}
.result-banner.correct {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.24), rgba(6, 78, 59, 0.45));
  border: 2px solid #10B981;
  color: #A7F3D0;
}
.result-banner.wrong {
  background: linear-gradient(145deg, rgba(220, 38, 38, 0.25), rgba(127, 29, 29, 0.45));
  border: 2px solid #EF4444;
  color: #FECACA;
}
.result-banner h2 { margin: 0; font-size: 1.5rem; font-weight: 900; }

.comp-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 16px;
}
.comp-box.gold-border { border-color: rgba(245, 158, 11, 0.5); }
.comp-box-hdr {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold-light);
}
.comp-body {
  font-size: 0.87rem;
  line-height: 1.8;
  color: var(--txt-main);
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
}

/* ==================== التبويب ٣: دفتر الملاحظات النظيف ==================== */
.notes-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 8px;
  min-height: 0;
}
.notes-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notes-hdr-lbl {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--gold-light);
}
.sync-ok-lbl { font-size: 0.74rem; color: #6EE7B7; }
.shared-notes-editor {
  flex: 1;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0A0F18;
  color: var(--txt-main);
  font-size: 0.93rem;
  line-height: 1.85;
  resize: none;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.shared-notes-editor:focus { border-color: var(--gold); }

/* ==================== التبويب ٥: الإجراءات + الخروج من القضية ==================== */
.inv-hub-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 13px 13px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inv-hub-card {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 14px;
}
.host-only-box {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.08), var(--bg-card));
}

.hub-sec-title {
  margin: 0 0 11px;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gold-light);
}

.inv-room-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.inv-room-status-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.inv-room-name {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFF;
}
.inv-code-line {
  font-size: 0.8rem;
  color: var(--txt-muted);
  margin-top: 2px;
}
.inv-digits {
  font-family: monospace;
  font-size: 1.12rem;
  letter-spacing: 3px;
  color: var(--gold-light);
  margin-right: 5px;
}

/* شريط المايك الصوتي */
.voice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0A0F18;
  border: 1px solid var(--border);
}
.voice-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}
.mic-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748B;
}
.mic-dot.live {
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
}
.btn-mic-toggle {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: #FFF;
  font-family: var(--font-head);
  font-size: 0.79rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-mic-toggle.active {
  background: linear-gradient(135deg, #DC2626, #991B1B);
  border-color: #FCA5A5;
}

.host-settings-grid { display: flex; flex-direction: column; gap: 9px; }
.hs-row { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.hs-row label { white-space: nowrap; color: var(--txt-sec); }
.hs-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(5, 7, 11, 0.55);
  font-size: 0.81rem;
  cursor: pointer;
}
.hs-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); }

.inv-list { display: flex; flex-direction: column; gap: 9px; }
.inv-member-card {
  padding: 11px 12px;
  border-radius: 12px;
  background: #0B101A;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.inv-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 800;
}
.inv-dot { width: 8px; height: 8px; border-radius: 50%; background: #475569; }
.inv-dot.online { background: #10B981; box-shadow: 0 0 7px #10B981; }
.inv-role-tag {
  font-size: 0.67rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: var(--gold-light);
}
.inv-role-tag.restricted {
  background: rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
}
.inv-activity { font-size: 0.77rem; color: var(--txt-muted); margin-top: 3px; }
.inv-member-btns { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.btn-jump-inv, .btn-mini-act {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--txt-sec);
  font-family: var(--font-head);
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-jump-inv { border-color: rgba(56, 189, 248, 0.45); color: #BAE6FD; }
.btn-mini-act.restrict-on { border-color: rgba(16, 185, 129, 0.45); color: #6EE7B7; }
.btn-mini-act.restrict-off { border-color: rgba(239, 68, 68, 0.42); color: #FCA5A5; }
.btn-mini-act.kick-btn {
  background: rgba(185, 28, 28, 0.25);
  border-color: rgba(248, 113, 113, 0.55);
  color: #FECACA;
}

.chat-messages {
  height: 220px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 11px;
  background: #070A11;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}
.chat-msg {
  max-width: 85%;
  align-self: flex-start;
  padding: 7px 11px;
  border-radius: 11px;
  background: #162032;
  font-size: 0.83rem;
  line-height: 1.5;
}
.chat-msg.mine {
  align-self: flex-end;
  background: rgba(185, 28, 28, 0.36);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.chat-msg.sys {
  align-self: center;
  max-width: 95%;
  background: rgba(16, 185, 129, 0.12);
  color: #A7F3D0;
  font-size: 0.75rem;
  text-align: center;
}
.chat-sender {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 2px;
}
.chat-input-bar { display: flex; gap: 8px; }
.send-btn { flex-shrink: 0; padding: 0 16px; }

/* زر الخروج من القضية داخل تبويب الإجراءات */
.exit-case-card {
  background: rgba(127, 29, 29, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
}
.btn-exit-case {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(252, 165, 165, 0.4);
  background: linear-gradient(135deg, #B91C1C, #7F1D1D);
  color: #FFF;
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-exit-case:active { transform: scale(0.98); }

/* ==================== شريط التبويبات السفلي (٥ أيقونات متساوية الحجم ٢٢×٢٢ بكسل) ==================== */
.desk-nav.five-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #090D15;
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}
.desk-tab {
  background: transparent;
  border: none;
  color: var(--txt-muted);
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.desk-tab.active { color: var(--gold-light); }

.tab-ico-wrap {
  position: relative;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-svg-ico {
  width: 22px;
  height: 22px;
  display: block;
}
.notif-dot {
  position: absolute;
  top: -1px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
}

/* ==================== النوافذ المنبثقة (Modals) ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 5, 9, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.glass-modal {
  width: 100%;
  max-width: 410px;
  background: linear-gradient(165deg, #151F30, #0C121D);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 20px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}
.modal-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.modal-hdr { margin: 0; font-family: var(--font-head); font-size: 1.05rem; color: var(--gold-light); }
.modal-body { margin: 0 0 14px; font-size: 0.85rem; line-height: 1.65; color: var(--txt-sec); }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; }

.pin-four-input {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid var(--gold);
  background: #05070B;
  color: #FFF;
  font-family: monospace;
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 12px;
  text-align: center;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.setup-form { display: flex; flex-direction: column; gap: 13px; }
.setup-field { display: flex; flex-direction: column; gap: 6px; }
.setup-field label, .setup-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--txt-sec);
}
.choice-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.choice-pills.vertical { grid-template-columns: 1fr; }
.choice-pill {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #080C14;
  color: var(--txt-muted);
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.choice-pill.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* أوضاع ملء الشاشة */
.app-shell.board-fs #desk-bottom-nav,
.app-shell.board-fs #spotlight-banner { display: none !important; }
.app-shell.board-fs #pane-board {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.doc-fullscreen #desk-bottom-nav,
body.doc-fullscreen #spotlight-banner { display: none !important; }
body.doc-fullscreen #document-reader-view {
  position: fixed;
  inset: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 95;
}

.toast {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(12, 18, 29, 0.96);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
  max-width: 92vw;
  text-align: center;
}
