/* ═══════════════════════════════════════════════════════════
   بطاقة الفرز — Triage Tag Theme (موقع كيان FiveM)
   ورق مقوّى، حبر، ألوان الفرز الطبي الأربعة، حواف مقصوصة وثقوب تعليق
   ═══════════════════════════════════════════════════════════ */

/* ── 1. الرموز (Tokens) ── */
:root {
  --f-display: 'Reem Kufi', 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;
  --f-body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --w: 100%;
  --hh: 64px;

  /* وضع الفاتح (Light) */
  --paper: #EEE3CB;
  --card: #FBF5E6;
  --card-2: #F4EAD2;
  --ink: #1C1A16;
  --ink-2: #4C463A;
  --ink-3: #62594A;
  --line: #1C1A16;
  --hair: rgba(28, 26, 22, 0.28);

  --red: #CC2A21;    --on-red: #FFF6E8;
  --amber: #F3B808;  --on-amber: #1C1A16;
  --green: #217F57;  --on-green: #F3FFF8;

  --shadow-c: #1C1A16;
  --tagfx: drop-shadow(2px 0 0 var(--line)) drop-shadow(-2px 0 0 var(--line)) drop-shadow(0 2px 0 var(--line)) drop-shadow(0 -2px 0 var(--line)) drop-shadow(-6px 6px 0 var(--shadow-c));
  color-scheme: light;
}

:root[data-theme="dark"] {
  /* الوضع الداكن (Dark - الافتراضي) */
  --paper: #0F0E0B;
  --card: #1A1812;
  --card-2: #232016;
  --ink: #F1E8D2;
  --ink-2: #C6BDA6;
  --ink-3: #9A937D;
  --line: #D8CFB7;
  --hair: rgba(241, 232, 210, 0.24);

  --red: #F2483E;    --on-red: #1A0705;
  --amber: #FFC824;  --on-amber: #171309;
  --green: #3FC088;  --on-green: #06170F;

  --shadow-c: rgba(241, 232, 210, 0.17);
  color-scheme: dark;
}

/* ── 2. الأساس ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color .25s, color .25s;
}
h1, h2, h3, h4, h5, h6, p, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
::selection { background: var(--amber); color: #1C1A16; }

.ic {
  width: 1.2em;
  height: 1.2em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vertical-align: -0.2em;
}
.ic.spin { animation: spin .8s linear infinite; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--w); padding-inline: clamp(16px, 2.5vw, 36px); margin-inline: auto; }
.tear.wrap { padding-inline: 0; }
kbd { font: 600 .7rem/1.5 var(--f-mono); border: 1.5px solid currentColor; padding: 1px 6px; }

.sq { display: inline-block; width: 10px; height: 10px; flex: none; }
.sq.r { background: var(--red); }
.sq.a { background: var(--amber); }
.sq.g { background: var(--green); }
.sq.k { background: var(--ink); }
.dispatch .sq.k { background: var(--paper); }

/* ── 3. الترويسة الثابتة ── */
.deck {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  transition: background-color .25s;
}
.deck-in {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--hh);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-inline-end: auto;
  min-width: 0;
}
.brand-mark {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: -3px 3px 0 var(--shadow-c);
}
.brand-mark img { width: 30px; height: 30px; object-fit: contain; }
.brand-txt { display: grid; line-height: 1.3; min-width: 0; }
.brand-txt b { font: 700 1.08rem var(--f-display); white-space: nowrap; }
.brand-txt small { font-size: .74rem; font-weight: 500; color: var(--ink-3); }

.deck-tools { display: flex; align-items: center; gap: 10px; }
.clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 42px;
  font: 600 .92rem var(--f-mono);
  border: 2px dashed var(--hair);
  direction: ltr;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 13px;
  background: var(--card);
  border: 2px solid var(--line);
  font: 600 .9rem var(--f-body);
  transition: background-color .15s, color .15s;
}
.tool:hover { background: var(--ink); color: var(--paper); }
.tool-icon { width: 42px; padding: 0; justify-content: center; }
:root[data-theme="dark"] .ic-moon,
:root[data-theme="light"] .ic-sun { display: none; }

/* قائمة اختيار الأنظمة داخل الترويسة */
.system-select-tag {
  height: 42px;
  padding: 0 12px;
  background: var(--card);
  border: 2px solid var(--line);
  font: 700 .86rem var(--f-display);
  color: var(--ink);
  outline: none;
  cursor: pointer;
  box-shadow: -2px 2px 0 var(--shadow-c);
}
.system-select-tag:focus {
  border-color: var(--red);
}

/* ── 4. شريط النشرة ── */
.dispatch { background: var(--ink); color: var(--paper); }
.dispatch-in { display: flex; align-items: stretch; height: 38px; font-size: .86rem; }
.d-flag {
  display: grid;
  place-items: center;
  padding: 0 16px;
  background: var(--red);
  color: var(--on-red);
  font: 700 .82rem var(--f-display);
}
.d-feed { position: relative; flex: 1; min-width: 0; overflow: hidden; padding-inline: 14px; }
.d-msg {
  display: none;
  align-items: center;
  gap: 10px;
  height: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.d-msg.on { display: flex; animation: slot .45s cubic-bezier(.2, .9, .3, 1); }
.d-count {
  display: grid;
  place-items: center;
  padding: 0 14px;
  font: 500 .74rem var(--f-mono);
  border-inline-start: 1px dashed currentColor;
  direction: ltr;
}

/* ── 5. الأزرار والروابط ── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  font: 700 1rem/1.25 var(--f-display);
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: -4px 4px 0 var(--shadow-c);
  transition: transform .12s, box-shadow .12s, background-color .15s, color .15s;
  cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translate(-3px, 3px); box-shadow: -1px 1px 0 var(--shadow-c); }
.btn-primary { background: var(--red); color: var(--on-red); }
.btn-primary:hover {
  background-color: var(--red);
  color: var(--on-red);
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .24) 0 10px, transparent 10px 20px);
  background-size: 28.28px 28.28px;
  animation: barber .7s linear infinite;
}
.btn-amber { background: var(--amber); color: var(--on-amber); }
.btn-green { background: var(--green); color: var(--on-green); }
.btn-sm { padding: 8px 14px; font-size: .88rem; box-shadow: -3px 3px 0 var(--shadow-c); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }

.tlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  transition: color .15s;
}
.tlink:hover { color: var(--red); }

/* ── 6. الواجهة الافتتاحية والهيرو ── */
.hero { padding: clamp(34px, 6vw, 76px) 0 clamp(44px, 6vw, 70px); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: var(--card);
  border: 2px solid var(--line);
  font-weight: 600;
  font-size: .84rem;
}
.kicker .tri { display: flex; gap: 3px; }
.hero-h {
  margin: 24px 0 22px;
  font: 700 clamp(2.6rem, 8vw, 5.5rem)/1.12 var(--f-display);
}
.hero-h span {
  display: block;
  width: max-content;
  max-width: 100%;
  animation: stampIn .6s cubic-bezier(.2, 1.2, .4, 1) backwards;
}
.hero-h span:nth-child(2) { animation-delay: .14s; }
.hero-h span:nth-child(3) { animation-delay: .28s; }
.hero-h .hl { background: linear-gradient(transparent 66%, var(--hl) 66% 92%, transparent 92%); }
.w1 { --hl: var(--red); }
.w2 { --hl: var(--amber); }
.w3 { --hl: var(--green); }
.lede { max-width: 36em; margin-bottom: 30px; font-size: 1.12rem; color: var(--ink-2); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 16px; }

/* بطاقة الفرز المعلقة الكبيرة */
.tag-stage { position: relative; display: flex; justify-content: center; padding-top: 58px; }
.tag-stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  height: 80px;
  background: var(--line);
}
.tag-w {
  width: min(100%, 340px);
  filter: var(--tagfx);
  transform-origin: 50% 25px;
  animation: sway 7s ease-in-out infinite;
}
.tag {
  position: relative;
  padding: 62px 24px 0;
  background: var(--card);
  clip-path: polygon(0 38px, 38px 0, calc(100% - 38px) 0, 100% 38px, 100% 100%, 0 100%);
}
.eyelet {
  position: absolute;
  top: 17px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line);
}
.tag-head { display: flex; align-items: center; gap: 14px; }
.tag-logo {
  width: 54px;
  height: 54px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--paper);
}
.tag-logo img { width: 40px; height: 40px; object-fit: contain; }
.tag-head b { display: block; font: 700 1.25rem/1.25 var(--f-display); }
.tag-head small { font-size: .78rem; color: var(--ink-3); font-weight: 500; }
.tag-rows { margin-top: 18px; }
.tag-rows div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 2px dotted var(--hair);
}
.tag-rows dt { font-size: .9rem; color: var(--ink-2); }
.tag-rows dd { font: 700 1.75rem/1 var(--f-mono); }
.tag-state { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-weight: 700; font-size: .92rem; }
.tag-state .sq { background: var(--green); animation: blink 1.5s steps(2) infinite; }
.tag-bar {
  height: 32px;
  margin-top: 16px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 11px, var(--ink) 11px 14px, transparent 14px 17px);
}
.tag-serial {
  margin-top: 4px;
  text-align: center;
  direction: ltr;
  font: 500 .7rem var(--f-mono);
  letter-spacing: .22em;
  color: var(--ink-3);
}
.flaps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px -24px 0;
  border-top: 2px dashed var(--line);
}
.flaps span { padding: 11px 4px 12px; text-align: center; font: 700 .78rem var(--f-display); }
.flaps span + span { border-inline-start: 2px dashed var(--line); }
.flaps .f1 { background: var(--red); color: var(--on-red); }
.flaps .f2 { background: var(--amber); color: var(--on-amber); }
.flaps .f3 { background: var(--green); color: var(--on-green); }

/* ── 7. شريط القصّ (التنقل بين الأقسام) ── */
.tear-wrap {
  position: relative;
  background: var(--card-2);
  border-top: 2px dashed var(--line);
  border-bottom: 2px solid var(--line);
}
.tear-cut {
  position: absolute;
  top: -14px;
  inset-inline-start: 26px;
  padding: 0 8px;
  background: var(--paper);
  line-height: 1;
  display: flex;
}
.tear { display: grid; grid-template-columns: repeat(4, 1fr); }
.seg {
  --tone: var(--red);
  --on: var(--on-red);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: start;
  padding: 18px 22px 16px;
  background: transparent;
  border: 0;
  border-top: 8px solid var(--tone);
  border-inline-start: 2px dashed var(--line);
  transition: background-color .15s, color .15s;
  cursor: pointer;
}
.seg:first-child { border-inline-start: 0; }
.seg.t-a { --tone: var(--amber); --on: var(--on-amber); }
.seg.t-g { --tone: var(--green); --on: var(--on-green); }
.seg.t-k { --tone: var(--ink); --on: var(--paper); }
.seg-top { display: flex; align-items: center; justify-content: space-between; }
.seg-top .ic { width: 1.6em; height: 1.6em; }
.seg-no { font: 600 .76rem var(--f-mono); color: var(--ink-3); }
.seg-t { margin-top: 8px; font: 700 1.22rem var(--f-display); }
.seg-s { font-size: .8rem; color: var(--ink-2); }
.seg:hover { background: var(--paper); }
.seg[aria-selected="true"] { background: var(--tone); color: var(--on); }
.seg[aria-selected="true"] .seg-no,
.seg[aria-selected="true"] .seg-s { color: inherit; opacity: .85; }
.seg[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  margin-left: -10px;
  border: 10px solid transparent;
  border-bottom: 0;
  border-top-color: var(--tone);
  z-index: 2;
}

/* ── 8. الأقسام والمحتوى ── */
.page { flex: 1; padding: 52px 0 76px; }
.tab-panel { display: none; scroll-margin-top: calc(var(--hh) + 20px); }
.tab-panel.active { display: block; animation: tearIn .5s cubic-bezier(.3, .7, .2, 1) backwards; }
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.sec-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 9px;
  background: var(--ink);
  color: var(--paper);
  font: 700 clamp(1.2rem, 2.6vw, 1.6rem)/1.2 var(--f-display);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}
.sec-fill { flex: 1; border-top: 2px dashed var(--hair); }
.sec-note { font: 600 .8rem var(--f-body); color: var(--ink-3); white-space: nowrap; }

/* بطاقات الدورات */
.tags {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 44px 28px;
}
.ctag-w {
  position: relative;
  filter: var(--tagfx);
  transform-origin: 50% 26px;
}
.ctag-w:nth-child(3n+1) { rotate: .7deg; }
.ctag-w:nth-child(3n+2) { rotate: -.5deg; }
.ctag-w:hover { animation: swing 1s ease-out; }
.ctag {
  --tone: var(--red);
  --on: var(--on-red);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  clip-path: polygon(0 30px, 30px 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
}
.c-a .ctag { --tone: var(--amber); --on: var(--on-amber); }
.c-g .ctag { --tone: var(--green); --on: var(--on-green); }
.c-k .ctag { --tone: var(--ink); --on: var(--paper); }
.ctag .eyelet { top: 12px; }
.ctag-band {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 64px;
  padding: 0 18px 9px;
  background: var(--tone);
  color: var(--on);
}
.ctag-band .no { font: 700 1.35rem/1 var(--f-mono); }
.ctag-band .ic { width: 1.7em; height: 1.7em; }
.ctag-body { flex: 1; padding: 18px 20px 4px; }
.ctag-cat { font-size: .78rem; font-weight: 600; color: var(--ink-3); }
.ctag-name { margin-top: 2px; font: 700 1.32rem/1.4 var(--f-display); }
.ctag-acts { margin-top: 14px; padding: 0 20px; }
.act {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 2px dotted var(--hair);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: padding .15s, color .15s;
}
.act span { flex: 1; }
.act:hover { padding-inline-start: 10px; color: var(--red); }
.act .ic:last-child { transition: transform .15s; }
.act:hover .ic:last-child { transform: translateX(-4px); }
.act-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 2px dotted var(--hair);
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink-3);
}
.act-note .ic { color: var(--green); }
.ctag-stub {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 10px 20px;
  border-top: 2px dashed var(--line);
  direction: ltr;
  font: 500 .7rem var(--f-mono);
  color: var(--ink-3);
}

/* بطاقات الملفات والمستندات */
.docs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 44px 28px;
  padding-top: 12px;
}
.doc {
  position: relative;
  isolation: isolate;
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  padding: 28px 22px 18px;
  background: none;
  border: 0;
  text-align: start;
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.doc:nth-child(-n+2) { grid-column: span 3; }
.doc::before, .doc::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--line); }
.doc::before {
  z-index: -2;
  background: var(--card);
  transform: translateY(-7px) rotate(-.8deg);
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.doc::after {
  z-index: -1;
  background: var(--card-2);
  box-shadow: -5px 5px 0 var(--shadow-c);
}
.doc:hover::before { transform: translateY(-20px) rotate(-2.2deg); }
.doc-no {
  position: absolute;
  top: -13px;
  inset-inline-start: 18px;
  padding: 2px 10px;
  background: var(--ink);
  color: var(--paper);
  font: 600 .72rem var(--f-mono);
  direction: ltr;
}
.doc-ic {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  background: var(--card);
  border: 2px solid var(--line);
}
.doc-ic .ic { width: 24px; height: 24px; }
.doc-t { display: block; font: 700 1.22rem/1.4 var(--f-display); }
.doc-d { display: block; flex: 1; margin-top: 4px; font-size: .92rem; color: var(--ink-2); }
.doc-foot {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 2px dotted var(--hair);
  font-weight: 600;
  font-size: .9rem;
}
.doc-foot span:first-child { display: inline-flex; align-items: center; gap: 8px; transition: gap .15s; }
.doc:hover .doc-foot span:first-child { gap: 14px; }
.doc.is-soon::after { border-style: dashed; box-shadow: none; }
.doc.is-soon .doc-t, .doc.is-soon .doc-ic { color: var(--ink-3); }

/* الشارات (Chips) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  background: var(--card);
  border: 2px solid var(--line);
  font: 700 .74rem var(--f-body);
}
.chip-green { background: var(--green); border-color: var(--green); color: var(--on-green); }
.chip-red { background: var(--red); border-color: var(--red); color: var(--on-red); }
.chip-amber { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.chip-gray { background: transparent; border-style: dashed; color: var(--ink-3); }

/* ختم الإحصاءات المطاطي */
.stamp {
  display: grid;
  place-content: center;
  width: 200px;
  aspect-ratio: 1;
  text-align: center;
  rotate: -8deg;
  color: var(--red);
  border: 4px double var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 7px var(--card), 0 0 0 9px var(--red);
}
.stamp b { font: 700 3rem/1 var(--f-mono); }
.stamp span { font: 700 .95rem/1.4 var(--f-display); padding: 0 14px; }

/* ── 9. الجداول بتنسيق بطاقة الفرز ── */
.table-card {
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: -6px 6px 0 var(--shadow-c);
  margin-top: 40px;
  overflow: hidden;
}
.table-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 22px;
  background: var(--ink);
  color: var(--paper);
}
.table-card-head h3 {
  font: 700 1.15rem var(--f-display);
  display: flex;
  align-items: center;
  gap: 10px;
}
.triage-table-wrap {
  overflow-x: auto;
}
.triage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  text-align: start;
}
.triage-table th {
  padding: 12px 18px;
  background: var(--card-2);
  border-bottom: 2px solid var(--line);
  font: 700 .9rem var(--f-display);
  color: var(--ink);
  text-align: start;
}
.triage-table td {
  padding: 13px 18px;
  border-bottom: 2px dotted var(--hair);
  color: var(--ink);
  vertical-align: middle;
}
.triage-table tr:last-child td {
  border-bottom: 0;
}
.triage-table tr:hover td {
  background: rgba(28, 26, 22, 0.04);
}
:root[data-theme="dark"] .triage-table tr:hover td {
  background: rgba(241, 232, 210, 0.04);
}
.triage-table .code-cell {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--red);
}

/* ── 10. الحاسبة والنماذج والاستعلام ── */
.calc {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px;
  align-items: center;
  padding: clamp(22px, 4vw, 42px);
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: -6px 6px 0 var(--shadow-c);
}
.form-no {
  font: 600 .76rem var(--f-mono);
  color: var(--ink-3);
  direction: ltr;
  text-align: end;
}
.calc h3 { margin: 4px 0 12px; font: 700 clamp(1.5rem, 3vw, 2.15rem)/1.3 var(--f-display); }
.calc p { max-width: 40em; color: var(--ink-2); }
.crit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 22px 0 26px;
}
.crit li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px dashed var(--hair);
  font-weight: 600;
  font-size: .92rem;
}
.crit .bx {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 2px solid var(--line);
  background: var(--amber);
  color: var(--on-amber);
}
.crit .bx .ic { width: 14px; height: 14px; stroke-width: 3; }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px 14px; }

/* حقول النماذج */
.lbl { display: block; margin-bottom: 7px; font-weight: 600; font-size: .88rem; }
.field {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font: 500 1rem var(--f-body);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: 0;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field::placeholder { color: var(--ink-3); }
.field:focus { border-color: var(--red); box-shadow: -4px 4px 0 var(--red); }
.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-weight: 600;
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .bx {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  background: var(--paper);
  border: 2px solid var(--line);
}
.check .bx .ic { opacity: 0; transform: scale(.4); transition: .15s; color: var(--on-amber); stroke-width: 3; }
.check input:checked + .bx { background: var(--amber); }
.check input:checked + .bx .ic { opacity: 1; transform: none; }
.check input:focus-visible + .bx { outline: 3px solid var(--red); outline-offset: 3px; }
.hint { margin-top: 14px; font-size: .8rem; color: var(--ink-3); }

/* ── 11. النوافذ المنبثقة والبحث السريع ── */
.modal-overlay, .pal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 16px;
  background: rgba(16, 14, 10, .72);
}
.modal-overlay.active { display: grid; place-items: center; }
.modal-box {
  width: min(460px, 100%);
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: -8px 8px 0 var(--shadow-c);
  animation: drop .32s cubic-bezier(.3, 1.4, .5, 1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 10px 12px;
  background: var(--ink);
  color: var(--paper);
}
.modal-header h3 { display: flex; align-items: center; gap: 10px; font: 700 1.1rem var(--f-display); }
.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 2px solid currentColor;
  color: inherit;
}
.modal-close:hover { background: var(--red); border-color: var(--red); color: var(--on-red); }
.modal-body { padding: 22px; }
.modal-body p { margin-bottom: 20px; color: var(--ink-2); font-size: .95rem; }
.choice-row { display: grid; gap: 10px; margin-bottom: 18px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: var(--card-2);
  border: 2px solid var(--line);
  font-weight: 700;
  text-align: start;
  transition: background-color .15s, color .15s;
}
.choice:hover { background: var(--ink); color: var(--paper); }

/* لوحة البحث (Ctrl+K) */
.pal.active { display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.pal-box {
  width: min(620px, 100%);
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: -8px 8px 0 var(--shadow-c);
  animation: drop .3s cubic-bezier(.3, 1.4, .5, 1);
}
.pal-top { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 2px solid var(--line); }
.pal-top .ic { width: 1.4em; height: 1.4em; }
.pal-in {
  flex: 1;
  min-width: 0;
  padding: 18px 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: 500 1.1rem var(--f-body);
}
.pal-in::placeholder { color: var(--ink-3); }
.pal-list { max-height: min(54vh, 420px); overflow: auto; }
.pal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: 0;
  border-bottom: 2px dotted var(--hair);
  text-align: start;
  font-weight: 600;
  cursor: pointer;
}
.pal-item[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.pal-kind { margin-inline-start: auto; font: 600 .72rem var(--f-body); opacity: .75; }
.pal-empty { padding: 28px; text-align: center; color: var(--ink-3); }
.pal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 10px 16px;
  border-top: 2px dashed var(--hair);
  font-size: .76rem;
  color: var(--ink-3);
}

/* توست الإشعارات */
.kayan-tag-toast {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 24px;
  z-index: 120;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--line);
  box-shadow: -4px 4px 0 var(--shadow-c);
  font: 700 .9rem var(--f-display);
}
.kayan-tag-toast.active { display: flex; animation: drop .25s ease-out; }

/* ── 12. التذييل ── */
.foot {
  position: relative;
  padding: 50px 0 34px;
  background: var(--ink);
  color: var(--paper);
  clip-path: polygon(0% 12px, 2% 0, 4% 12px, 6% 0, 8% 12px, 10% 0, 12% 12px, 14% 0, 16% 12px, 18% 0, 20% 12px, 22% 0, 24% 12px, 26% 0, 28% 12px, 30% 0, 32% 12px, 34% 0, 36% 12px, 38% 0, 40% 12px, 42% 0, 44% 12px, 46% 0, 48% 12px, 50% 0, 52% 12px, 54% 0, 56% 12px, 58% 0, 60% 12px, 62% 0, 64% 12px, 66% 0, 68% 12px, 70% 0, 72% 12px, 74% 0, 76% 12px, 78% 0, 80% 12px, 82% 0, 84% 12px, 86% 0, 88% 12px, 90% 0, 92% 12px, 94% 0, 96% 12px, 98% 0, 100% 12px, 100% 100%, 0 100%);
  margin-top: auto;
}
.foot-lead { max-width: 34em; font-size: 1rem; opacity: .9; }
.sigs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 34px 32px;
  margin: 34px 0 30px;
}
.sigs li {
  padding-top: 34px;
  border-bottom: 2px solid var(--paper);
  font: 700 1.1rem/1.5 var(--f-display);
  padding-bottom: 6px;
}
.foot-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 18px;
  border-top: 2px dashed currentColor;
  font-size: .8rem;
  opacity: .75;
}
.foot-meta span:last-child { font-family: var(--f-mono); direction: ltr; }

/* ── 13. الحركات ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .15; } }
@keyframes slot { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes barber { to { background-position: 28.28px 0; } }
@keyframes stampIn {
  0% { opacity: 0; transform: scale(1.7) rotate(-5deg); }
  60% { opacity: 1; transform: scale(.97); }
  100% { transform: none; }
}
@keyframes sway {
  0%, 100% { transform: rotate(-1.3deg); }
  50% { transform: rotate(1.3deg); }
}
@keyframes swing {
  0% { transform: rotate(0); }
  20% { transform: rotate(4.5deg); }
  45% { transform: rotate(-3deg); }
  70% { transform: rotate(1.4deg); }
  100% { transform: rotate(0); }
}
@keyframes tearIn {
  from { clip-path: inset(0 0 100% 0); opacity: .4; }
  to { clip-path: inset(-40px -40px -40px -40px); opacity: 1; }
}
@keyframes drop {
  from { transform: translateY(-22px) rotate(-1.6deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ── 14. التجاوب ── */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .calc { grid-template-columns: 1fr; }
  .stamp { justify-self: center; margin-top: 8px; }
  .docs { grid-template-columns: repeat(2, 1fr); }
  .doc, .doc:nth-child(-n+2) { grid-column: auto; }
}
@media (max-width: 760px) {
  .clock, .tool-lbl, .tool kbd { display: none; }
  .tool-search { width: 42px; padding: 0; justify-content: center; }
  .tear { grid-template-columns: repeat(2, 1fr); }
  .seg:nth-child(3) { border-inline-start: 0; }
  .seg { padding: 14px 16px 12px; }
  .sec-fill { display: none; }
  .sec-head { justify-content: space-between; }
}
@media (max-width: 520px) {
  .wrap { padding-inline: 16px; }
  .brand-txt small { display: none; }
  .docs { grid-template-columns: 1fr; }
  .btn-row .btn, .cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── 15. عروض الشرائح وغرفة التدريب بنمط بطاقة الفرز ── */
.slide-page {
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Lock Gate Overlay */
.triage-lock-overlay,
.airwing-lock-overlay,
.pharmacy-lock-overlay,
.adtdf-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(18, 16, 14, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.triage-lock-card,
.airwing-lock-card,
.pharmacy-lock-card,
.adtdf-lock-card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: -8px 8px 0 var(--shadow-c);
  padding: 40px 32px;
  text-align: center;
  position: relative;
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%, 0 18px);
}
.triage-lock-card::before,
.airwing-lock-card::before,
.pharmacy-lock-card::before,
.adtdf-lock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--red);
}
.triage-lock-icon,
.airwing-lock-icon,
.pharmacy-lock-icon,
.adtdf-lock-icon {
  width: 72px;
  height: 72px;
  border: 3px solid var(--line);
  background: var(--card-2);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  box-shadow: -4px 4px 0 var(--shadow-c);
}
.triage-lock-card h2,
.airwing-lock-card h2,
.pharmacy-lock-card h2,
.adtdf-lock-card h2 {
  font: 700 1.5rem/1.3 var(--f-display);
  color: var(--ink);
  margin-bottom: 8px;
}
.triage-lock-card p,
.airwing-lock-card p,
.pharmacy-lock-card p,
.adtdf-lock-card p {
  font-size: 0.95rem;
  color: var(--ink-2);
  margin-bottom: 22px;
  line-height: 1.6;
}
.lock-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 2px solid var(--line);
  padding: 6px 16px;
  margin-bottom: 16px;
}
.lock-input-group:focus-within {
  border-color: var(--red);
  outline: 2px solid var(--red);
}
.lock-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--f-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  letter-spacing: 8px;
  padding: 8px 0;
}
.lock-submit-btn {
  width: 100%;
  background: var(--red);
  border: 2px solid var(--line);
  color: var(--on-red);
  font: 700 1.05rem var(--f-display);
  padding: 14px;
  cursor: pointer;
  box-shadow: -4px 4px 0 var(--shadow-c);
  transition: transform .1s;
}
.lock-submit-btn:hover {
  transform: translate(2px, -2px);
  box-shadow: -6px 6px 0 var(--shadow-c);
}
.lock-submit-btn:active {
  transform: translate(-2px, 2px);
  box-shadow: -2px 2px 0 var(--shadow-c);
}
.lock-error-msg {
  color: var(--red);
  font: 700 .9rem var(--f-display);
  margin-top: 14px;
  min-height: 20px;
}
.shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* Slide Deck HUD & Shell */
.slide-deck-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
}
.slide-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--card);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--shadow-c);
  z-index: 10;
  flex-shrink: 0;
  gap: 16px;
}
.slide-brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}
.slide-brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 2px solid var(--line);
  background: #fff;
}
.slide-brand-text h2 {
  font: 700 1.1rem/1.2 var(--f-display);
  color: var(--ink);
  margin: 0;
}
.slide-brand-text span {
  font: 500 .8rem var(--f-body);
  color: var(--ink-2);
}
.slide-course-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--card-2);
  border: 2px solid var(--line);
  font: 700 .78rem var(--f-mono);
  color: var(--red);
}
.slide-progress-center {
  flex: 1;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.slide-counter-pill {
  font: 700 .85rem var(--f-mono);
  color: var(--ink);
  direction: ltr;
}
.slide-hud-track {
  width: 100%;
  height: 8px;
  background: var(--card-2);
  border: 2px solid var(--line);
  overflow: hidden;
}
.slide-hud-fill {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width .25s ease;
}
.slide-hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slide-hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--card);
  border: 2px solid var(--line);
  color: var(--ink);
  font: 700 .85rem var(--f-display);
  cursor: pointer;
  text-decoration: none;
  box-shadow: -2px 2px 0 var(--shadow-c);
  transition: transform .1s;
}
.slide-hud-btn:hover {
  transform: translate(1px, -1px);
  box-shadow: -3px 3px 0 var(--shadow-c);
}
.slide-hud-btn.icon-only {
  padding: 8px 10px;
}

/* Viewport & Slides */
.slides-viewport {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.slide-item {
  display: none;
  width: 100%;
  max-width: 1240px;
  margin: auto;
}
.slide-item.active {
  display: block;
  animation: tearIn .2s ease-out;
}
.slide-card {
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: -8px 8px 0 var(--shadow-c);
  padding: 32px;
  position: relative;
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%, 0 18px);
}
.slide-card.title-card {
  text-align: center;
  padding: 48px 32px;
}
.title-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--card-2);
  border: 2px solid var(--line);
  font: 700 .85rem var(--f-mono);
  color: var(--red);
  margin-bottom: 20px;
}
.title-headline {
  font: 900 clamp(1.8rem, 4vw, 2.8rem)/1.3 var(--f-display);
  color: var(--ink);
  margin-bottom: 14px;
}
.title-subtitle {
  max-width: 800px;
  margin: 0 auto 28px;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink-2);
}
.slide-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px dashed var(--line);
}
.slide-title-wrap h3 {
  font: 700 1.5rem var(--f-display);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.slide-meta-tag {
  font: 700 .85rem var(--f-mono);
  background: var(--card-2);
  border: 2px solid var(--line);
  padding: 4px 12px;
  color: var(--ink);
}
.slide-telemetry-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.slide-telemetry-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card-2);
  border: 2px solid var(--line);
  font-size: .92rem;
  color: var(--ink);
}
.slide-telemetry-item strong {
  color: var(--red);
  font-weight: 700;
}
.def-master-card {
  background: var(--card-2);
  border: 2px solid var(--line);
  border-inline-start: 6px solid var(--amber);
  padding: 20px;
  margin-bottom: 24px;
}
.def-master-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 1.1rem var(--f-display);
  color: var(--ink);
  margin-bottom: 8px;
}
.def-master-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink);
  margin: 0;
}
.slide-body-fill {
  margin-bottom: 20px;
}
.slide-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.slide-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.slide-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.slide-col-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.slide-box {
  background: var(--card);
  border: 2px solid var(--line);
  padding: 22px;
  box-shadow: -4px 4px 0 var(--shadow-c);
}
.slide-box h4 {
  font: 700 1.25rem var(--f-display);
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.slide-box p {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 14px;
}
.box-footer-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--card-2);
  border: 2px solid var(--line);
  font: 600 .82rem var(--f-mono);
  color: var(--ink);
}
.box-footer-tag.gold { border-color: var(--amber); color: var(--ink); }
.box-footer-tag.danger { border-color: var(--red); color: var(--red); }
.box-footer-tag.success { border-color: var(--green); color: var(--green); }
.box-footer-tag.info { border-color: var(--line); color: var(--ink); }

.slide-alert-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid var(--line);
  background: var(--card-2);
  font-size: .95rem;
  color: var(--ink);
}
.slide-alert-strip.info { border-inline-start: 6px solid var(--ink); }
.slide-alert-strip.warning { border-inline-start: 6px solid var(--amber); }
.slide-alert-strip.danger { border-inline-start: 6px solid var(--red); }
.slide-alert-strip.success { border-inline-start: 6px solid var(--green); }

/* Bottom HUD */
.slide-hud-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--card);
  border-top: 2px solid var(--line);
  box-shadow: 0 -4px 0 var(--shadow-c);
  z-index: 10;
  flex-shrink: 0;
}
.slide-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: var(--card);
  border: 2px solid var(--line);
  color: var(--ink);
  font: 700 .95rem var(--f-display);
  cursor: pointer;
  box-shadow: -3px 3px 0 var(--shadow-c);
  transition: transform .1s;
}
.slide-nav-btn:hover:not(:disabled) {
  transform: translate(2px, -2px);
  box-shadow: -5px 5px 0 var(--shadow-c);
}
.slide-nav-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  box-shadow: none;
}
.slide-dots-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.slide-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  background: var(--card-2);
  cursor: pointer;
  transition: all .15s;
}
.slide-dot.active {
  background: var(--red);
  border-color: var(--red);
  transform: scale(1.25);
}

@media (max-width: 900px) {
  .slide-grid-2 { grid-template-columns: 1fr; }
  .slide-hud-top { flex-direction: column; align-items: stretch; gap: 10px; }
  .slide-hud-actions { justify-content: flex-end; }
}


/* ═══════════════════════════════════════════════════════════
   خريطة القطاعات والموجات التكتيكية — ثيم بطاقة الفرز
   ═══════════════════════════════════════════════════════════ */
.ops-map-wrapper {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 992px) {
  .ops-map-wrapper { grid-template-columns: 1fr; }
}

.ops-map-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--card-2);
  border: 3px solid var(--line);
  box-shadow: -6px 6px 0 var(--shadow-c);
  overflow: hidden;
}

.ops-map-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ops-map-hotspot-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ops-map-hotspot {
  fill: rgba(0, 0, 0, 0);
  stroke: rgba(0, 0, 0, 0);
  stroke-width: 2.5px;
  cursor: pointer;
  transition: fill .15s ease, stroke .15s ease;
}
.ops-map-hotspot:hover,
.ops-map-hotspot.active {
  fill: rgba(255, 200, 36, 0.35);
  stroke: var(--amber);
  stroke-width: 3px;
}

.ops-map-pin-label {
  position: absolute;
  transform: translate(-50%, -50%);
  background: var(--ink);
  color: var(--paper);
  font: 700 11px var(--f-mono);
  padding: 2px 8px;
  border: 1.5px solid var(--line);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: -2px 2px 0 var(--shadow-c);
  z-index: 10;
}

.ops-map-tooltip {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  padding: 6px 12px;
  font: 700 12px var(--f-mono);
  box-shadow: -4px 4px 0 var(--shadow-c);
  opacity: 0;
  transition: opacity .12s ease;
  white-space: nowrap;
}
.ops-map-tooltip.show { opacity: 1; }
.ops-map-tooltip .code { color: var(--red); font-weight: 800; margin-inline-end: 6px; }

.ops-map-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ops-zone-detail {
  background: var(--card-2);
  border: 2px solid var(--line);
  box-shadow: -4px 4px 0 var(--shadow-c);
  padding: 18px 22px;
  min-height: 90px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.ops-zone-detail .zd-swatch {
  width: 48px;
  height: 48px;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  flex: none;
  box-shadow: -2px 2px 0 var(--shadow-c);
}
.ops-zone-detail .zd-name {
  font: 700 1.25rem var(--f-display);
  color: var(--ink);
  margin-bottom: 4px;
}
.ops-zone-detail .zd-code {
  font: 700 .95rem var(--f-mono);
  color: var(--red);
}
.ops-zone-detail.placeholder {
  color: var(--ink-3);
  font: 600 .95rem var(--f-display);
  justify-content: center;
  text-align: center;
}

.ops-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 580px) {
  .ops-legend-grid { grid-template-columns: 1fr; }
}

.ops-legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: -3px 3px 0 var(--shadow-c);
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .1s, background .1s;
}
.ops-legend-item:hover,
.ops-legend-item.active {
  background: var(--card-2);
  border-color: var(--red);
  transform: translate(2px, -2px);
  box-shadow: -5px 5px 0 var(--shadow-c);
}
.ops-legend-item .sw {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line);
  flex: none;
}
.ops-legend-item .legend-info {
  display: flex;
  flex-direction: column;
}
.ops-legend-item .legend-name {
  font: 700 .95rem var(--f-display);
  color: var(--ink);
}
.ops-legend-item small {
  font: 600 .78rem var(--f-mono);
  color: var(--red);
}
