:root {
--report-red-light: #c60300;
--report-red-dark: #ff0400;
--report-red: var(--report-red-light);
--report-hover: #d81b18; 
--report-hover-dark: #ff3b30;
 --report-selected: var(--report-red);
 --report-card-bg-light: #ffffff;
 --report-card-bg-dark: #0f172a;
 --report-card-border-light: rgba(198, 3, 0, .15);
 --report-card-border-dark: rgba(255, 4, 0, .28);
 --report-shadow-light: 0 14px 36px rgba(0, 0, 0, .14);
 --report-shadow-dark: 0 14px 36px rgba(0, 0, 0, .34);
 --report-radius: 16px;
 --report-pad: clamp(10px, 1.5vw, 16px);
 --report-z-btn: 1200;
 --report-z-modal: 1300;
}

.dark-mode {
 --report-red: var(--report-red-dark);
}

#schoolepReportIssueMount,
#schoolepReportIssueMount * {
 box-sizing: border-box;
}

/* --- 🔘 FLOATING BUTTON --- */
.report-issue-btn {
 position: fixed;
 inset-inline-start: max(8px, env(safe-area-inset-left));
 bottom: max(8px, env(safe-area-inset-bottom));
 z-index: var(--report-z-btn);
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 0;
 width: 30px;
 min-width: 30px;
 height: 30px;
 padding: 0;
 border: none;
 border-radius: 999px;
 cursor: pointer;
 overflow: hidden;
 white-space: nowrap;
 background: var(--report-red);
 color: #fff;
 font-size: 11px;
 font-weight: 700;
 box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
 transition:
  width .18s ease,
  padding .18s ease,
  gap .18s ease,
  border-radius .18s ease,
  background-color .18s ease,
  box-shadow .18s ease,
  transform .18s ease;
}

.report-issue-btn:hover,
.report-issue-btn:focus-visible {
 width: auto;
 min-width: 30px;
 padding-inline: 10px;
 gap: 6px;
 justify-content: flex-start;
 background: var(--report-hover);
 box-shadow: 0 10px 22px rgba(0, 0, 0, .20);
 transform: translateY(-1px);
}

.dark-mode .report-issue-btn:hover,
.dark-mode .report-issue-btn:focus-visible {
 background: var(--report-hover-dark);
}

.report-issue-btn.is-open {
 width: 30px;
 min-width: 30px;
 height: 30px;
 padding: 0;
 gap: 0;
 justify-content: center;
 border-radius: 999px;
 transform: none;
 background: var(--report-red);
}

.report-issue-btn-icon {
 width: 14px;
 height: 14px;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 flex: 0 0 auto;
 font-size: 15px;
 line-height: 1;
}

.report-issue-btn-label {
 opacity: 0;
 max-width: 0;
 overflow: hidden;
 transition: opacity .16s ease, max-width .16s ease;
}

.report-issue-btn:hover .report-issue-btn-label,
.report-issue-btn:focus-visible .report-issue-btn-label {
 opacity: 1;
 max-width: 160px;
}

.report-issue-btn.is-open .report-issue-btn-label {
 opacity: 0;
 max-width: 0;
}

/* --- 🖼️ MODAL & CARD --- */
.report-issue-modal {
 position: fixed;
 inset: 0;
 z-index: var(--report-z-modal);
 display: none;
 align-items: center;
 justify-content: center;
 padding: clamp(10px, 2vw, 20px);
 background: rgba(0, 0, 0, .45);
 backdrop-filter: blur(2px);
}

.report-issue-modal.open {
 display: flex;
}

.report-issue-card {
 width: min(560px, 100%);
 max-width: 560px;
 max-height: min(86vh, 760px);
 overflow-x: hidden;
 overflow-y: auto;
 border-radius: var(--report-radius);
 background: var(--report-card-bg-light);
 color: #111;
 padding: var(--report-pad);
 border: 1px solid var(--report-card-border-light);
 box-shadow: var(--report-shadow-light);
 scrollbar-gutter: stable;
 scrollbar-width: thin;
 scrollbar-color: rgba(59, 130, 246, .75) transparent;
}

.dark-mode .report-issue-card {
 background: var(--report-card-bg-dark);
 color: #e5e7eb;
 border-color: var(--report-card-border-dark);
 box-shadow: var(--report-shadow-dark);
 scrollbar-color: rgba(96, 165, 250, .95) transparent;
}

/* Scrollbar styling */
.report-issue-card::-webkit-scrollbar { width: 7px; }
.report-issue-card::-webkit-scrollbar-track { background: transparent; border-radius: 999px; }
.report-issue-card::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(59, 130, 246, .95), rgba(37, 99, 235, .92)); border-radius: 999px; }
.report-issue-card::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(96, 165, 250, .98), rgba(59, 130, 246, .98)); }

/* 🟢 THE FIX: Tighter Header & Corner X */
.report-issue-head {
 position: relative;
 /* Removed min-height completely to kill dead space */
 margin-bottom: 2px; /* Tighter gap */
}

.report-issue-head > div:first-child {
 width: 100%;
 text-align: center;
 padding: 0 42px;
}

.report-issue-title {
 margin: 0;
 font-size: clamp(16px, 2vw, 18px);
 line-height: 1.3;
 font-weight: 800;
 text-align: center;
}

.report-issue-close {
 position: absolute;
 top: -10px; /* Pushed deep into the top corner */
 inset-inline-end: -10px; /* Pushed deep into the side corner */
 border: none;
 background: transparent;
 color: inherit;
 width: 34px;
 height: 34px;
 border-radius: 10px;
 cursor: pointer;
 font-size: 24px;
 line-height: 1;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 transition: background-color .16s ease, color .16s ease;
}

.report-issue-close:hover {
 background: rgba(216, 27, 24, .10);
 color: var(--report-hover);
}

.dark-mode .report-issue-close:hover {
 background: rgba(255, 59, 48, .16);
 color: var(--report-hover-dark);
}

.report-issue-desc {
 margin: 0 0 14px 0; /* 🟢 0px Top Margin pulls it straight up to the title */
 opacity: .92;
 line-height: 1.5;
 font-size: 13px;
 text-align: center;
}

.report-issue-type-grid {
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 gap: 7px;
 margin-bottom: 10px;
}

.report-issue-type {
 border: 1px solid rgba(0, 0, 0, .10);
 border-radius: 10px;
 background: rgba(0, 0, 0, .03);
 color: inherit;
 padding: 9px 10px;
 text-align: center;
 cursor: pointer;
 font: inherit;
 font-size: 12px;
 font-weight: 700;
 min-height: 38px;
 transition:
  background-color .16s ease,
  border-color .16s ease,
  transform .16s ease,
  box-shadow .16s ease,
  color .16s ease;
}

.report-issue-type:hover,
.report-issue-type:focus-visible {
 transform: translateY(-1px);
 background: rgba(216, 27, 24, .10);
 border-color: rgba(216, 27, 24, .35);
 color: var(--report-hover);
 box-shadow: 0 6px 14px rgba(216, 27, 24, .12);
}

.report-issue-type.is-selected {
 background: var(--report-selected);
 border-color: var(--report-selected);
 color: #fff;
 box-shadow: 0 8px 18px rgba(198, 3, 0, .22);
}

.report-issue-type.is-selected:hover,
.report-issue-type.is-selected:focus-visible {
 background: var(--report-hover);
 border-color: var(--report-hover);
 color: #fff;
 box-shadow: 0 10px 22px rgba(216, 27, 24, .24);
 transform: translateY(-1px);
}

.dark-mode .report-issue-type {
 border-color: rgba(255, 255, 255, .14);
 background: rgba(255, 255, 255, .07);
 color: #f3f4f6;
}

.dark-mode .report-issue-type:hover,
.dark-mode .report-issue-type:focus-visible {
 transform: translateY(-1px);
 background: rgba(255, 59, 48, .14);
 border-color: rgba(255, 59, 48, .45);
 color: #ff3b30;
 box-shadow: 0 6px 14px rgba(255, 59, 48, .16);
}

.dark-mode .report-issue-type.is-selected {
 background: var(--report-red);
 border-color: var(--report-red);
 color: #fff;
 box-shadow: 0 8px 18px rgba(255, 4, 0, .22);
}

.dark-mode .report-issue-type.is-selected:hover,
.dark-mode .report-issue-type.is-selected:focus-visible {
 background: #ff3b30;
 border-color: #ff3b30;
 color: #fff;
 box-shadow: 0 10px 22px rgba(255, 59, 48, .28);
 transform: translateY(-1px);
}

.report-issue-text-wrap {
 display: none;
}

.report-issue-text-wrap.is-visible {
 display: block;
}

/* =======================================================
 🔴 TEXT AREA: ALWAYS GLOWING BLOOD RED WHEN VISIBLE
 ======================================================= */

/* 1. LIGHT MODE */
.report-issue-text {
 width: 100%;
 min-height: 100px;
 resize: vertical;
 border-radius: 10px;
 padding: 10px;
 font: inherit;
 font-size: 13px;
 line-height: 1.5;
 transition: all 0.2s ease;
 outline: none;

 border: 1px solid #dc2626 !important;
 box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2), 0 0 12px rgba(220, 38, 38, 0.15) !important;
 background-color: #ffffff;
 color: inherit;
}

/* 2. DARK MODE */
html.dark-mode .report-issue-text {
 border: 1px solid #ff3b30 !important;
 background-color: #0f172a !important;
 box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.25), 0 0 15px rgba(255, 4, 0, 0.4) !important;
 color: #f8fafc !important;
}


/* --- 🚀 SEND ACTIONS & STATUS --- */
.report-issue-actions {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 margin-top: 20px;
 gap: 12px;
}

.report-issue-hint {
 display: block;
 text-align: center;
 font-size: 14px;
 line-height: 1.4;
 white-space: pre-line;
 min-height: 20px;
}

.report-issue-hint:empty {
 display: none;
}

.report-issue-send {
 flex: 0 0 auto;
 min-width: 140px;
 height: 44px;
 border: none;
 border-radius: 12px;
 padding: 0 18px;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 font: inherit;
 font-size: 14px;
 font-weight: 800;
 cursor: pointer;
 background: var(--report-red);
 color: #fff;
 transition:
  background-color .16s ease,
  color .16s ease,
  transform .16s ease,
  box-shadow .16s ease,
  opacity .16s ease;
}

.report-issue-send:hover {
 background: var(--report-hover);
 transform: translateY(-1px);
 box-shadow: 0 8px 18px rgba(216, 27, 24, .18);
}

.report-issue-send:disabled {
 opacity: .7;
 cursor: not-allowed;
 transform: none;
 box-shadow: none;
}

.report-status.ok { color: #15803d; }
.report-status.error { color: #dc2626; }
.dark-mode .report-status.ok { color: #4ade80; }
.dark-mode .report-status.error { color: #f87171; }

/* --- 📱 MOBILE SIZES --- */
@media (max-width: 900px) {
 .report-issue-btn { width: 28px; min-width: 28px; height: 28px; bottom: 8px; inset-inline-start: 8px; }
 .report-issue-btn.is-open { width: 28px; min-width: 28px; height: 28px; }
 .report-issue-card { width: min(480px, calc(100vw - 24px)); }
}

@media (max-width: 420px) {
 .report-issue-btn { width: 26px; min-width: 26px; height: 26px; }
 .report-issue-btn.is-open { width: 26px; min-width: 26px; height: 26px; }
 .report-issue-card { padding: 9px; border-radius: 12px; }
} :root {
  --report-red-light: #c60300;
  --report-red-dark: #ff0400;
  --report-red: var(--report-red-light);
  --report-hover: #d81b18;
  --report-hover-dark: #ff3b30;
  --report-selected: var(--report-red);
  --report-card-bg-light: #ffffff;
  --report-card-bg-dark: #0f172a;
  --report-card-border-light: rgba(198, 3, 0, .15);
  --report-card-border-dark: rgba(255, 4, 0, .28);
  --report-shadow-light: 0 14px 36px rgba(0, 0, 0, .14);
  --report-shadow-dark: 0 14px 36px rgba(0, 0, 0, .34);
  --report-radius: 16px;
  --report-pad: clamp(10px, 1.5vw, 16px);
  --report-z-btn: 1200;
  --report-z-modal: 1300;
}

.dark-mode {
  --report-red: var(--report-red-dark);
}

#schoolepReportIssueMount,
#schoolepReportIssueMount * {
  box-sizing: border-box;
}

/* --- 🔘 FLOATING BUTTON --- */
.report-issue-btn {
  position: fixed;
  inset-inline-start: max(8px, env(safe-area-inset-left));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: var(--report-z-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  background: var(--report-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
  transition:
    width .18s ease,
    padding .18s ease,
    gap .18s ease,
    border-radius .18s ease,
    background-color .18s ease,
    box-shadow .18s ease,
    transform .18s ease;
}

.report-issue-btn:hover,
.report-issue-btn:focus-visible {
  width: auto;
  min-width: 30px;
  padding-inline: 10px;
  gap: 6px;
  justify-content: flex-start;
  background: var(--report-hover);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .20);
  transform: translateY(-1px);
}

.dark-mode .report-issue-btn:hover,
.dark-mode .report-issue-btn:focus-visible {
  background: var(--report-hover-dark);
}

.report-issue-btn.is-open {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  gap: 0;
  justify-content: center;
  border-radius: 999px;
  transform: none;
  background: var(--report-red);
}

.report-issue-btn-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1;
}

.report-issue-btn-label {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity .16s ease, max-width .16s ease;
}

.report-issue-btn:hover .report-issue-btn-label,
.report-issue-btn:focus-visible .report-issue-btn-label {
  opacity: 1;
  max-width: 160px;
}

.report-issue-btn.is-open .report-issue-btn-label {
  opacity: 0;
  max-width: 0;
}

/* --- 🖼️ MODAL & CARD --- */
.report-issue-modal {
  position: fixed;
  inset: 0;
  z-index: var(--report-z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vw, 20px);
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(2px);
}

.report-issue-modal.open {
  display: flex;
}

.report-issue-card {
  width: min(560px, 100%);
  max-width: 560px;
  max-height: min(86vh, 760px);
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: var(--report-radius);
  background: var(--report-card-bg-light);
  color: #111;
  padding: var(--report-pad);
  border: 1px solid var(--report-card-border-light);
  box-shadow: var(--report-shadow-light);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, .75) transparent;
}

.dark-mode .report-issue-card {
  background: var(--report-card-bg-dark);
  color: #e5e7eb;
  border-color: var(--report-card-border-dark);
  box-shadow: var(--report-shadow-dark);
  scrollbar-color: rgba(96, 165, 250, .95) transparent;
}

/* Scrollbar styling */
.report-issue-card::-webkit-scrollbar { width: 7px; }
.report-issue-card::-webkit-scrollbar-track { background: transparent; border-radius: 999px; }
.report-issue-card::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(59, 130, 246, .95), rgba(37, 99, 235, .92)); border-radius: 999px; }
.report-issue-card::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(96, 165, 250, .98), rgba(59, 130, 246, .98)); }

/* --- Header --- */
.report-issue-head {
  position: relative;
  margin-bottom: 2px;
}

.report-issue-head > div:first-child {
  width: 100%;
  text-align: center;
  padding: 0 42px;
}

.report-issue-title {
  margin: 0;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.3;
  font-weight: 800;
  text-align: center;
}

.report-issue-close {
  position: absolute;
  top: -10px;
  inset-inline-end: -10px;
  border: none;
  background: transparent;
  color: inherit;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .16s ease, color .16s ease;
}

.report-issue-close:hover {
  background: rgba(216, 27, 24, .10);
  color: var(--report-hover);
}

.dark-mode .report-issue-close:hover {
  background: rgba(255, 59, 48, .16);
  color: var(--report-hover-dark);
}

.report-issue-desc {
  margin: 0 0 14px 0;
  opacity: .92;
  line-height: 1.5;
  font-size: 13px;
  text-align: center;
}

/* --- TYPE GRID --- */
.report-issue-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

/* ✅ only last card "مشكلة تقنية أخرى" centered */
.report-issue-type-grid .report-issue-type[data-issue-type="technical_other"] {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(240px, 100%);
}

.report-issue-type {
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 10px;
  background: rgba(0, 0, 0, .03);
  color: inherit;
  padding: 9px 10px;
  text-align: center;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  min-height: 38px;
  transition:
    background-color .16s ease,
    border-color .16s ease,
    transform .16s ease,
    box-shadow .16s ease,
    color .16s ease;
}

.report-issue-type:hover,
.report-issue-type:focus-visible {
  transform: translateY(-1px);
  background: rgba(216, 27, 24, .10);
  border-color: rgba(216, 27, 24, .35);
  color: var(--report-hover);
  box-shadow: 0 6px 14px rgba(216, 27, 24, .12);
}

.report-issue-type.is-selected {
  background: var(--report-selected);
  border-color: var(--report-selected);
  color: #fff;
  box-shadow: 0 8px 18px rgba(198, 3, 0, .22);
}

.report-issue-type.is-selected:hover,
.report-issue-type.is-selected:focus-visible {
  background: var(--report-hover);
  border-color: var(--report-hover);
  color: #fff;
  box-shadow: 0 10px 22px rgba(216, 27, 24, .24);
  transform: translateY(-1px);
}

.dark-mode .report-issue-type {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .07);
  color: #f3f4f6;
}

.dark-mode .report-issue-type:hover,
.dark-mode .report-issue-type:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 59, 48, .14);
  border-color: rgba(255, 59, 48, .45);
  color: #ff3b30;
  box-shadow: 0 6px 14px rgba(255, 59, 48, .16);
}

.dark-mode .report-issue-type.is-selected {
  background: var(--report-red);
  border-color: var(--report-red);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 4, 0, .22);
}

.dark-mode .report-issue-type.is-selected:hover,
.dark-mode .report-issue-type.is-selected:focus-visible {
  background: #ff3b30;
  border-color: #ff3b30;
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 59, 48, .28);
  transform: translateY(-1px);
}

.report-issue-text-wrap {
  display: none;
}

.report-issue-text-wrap.is-visible {
  display: block;
}

/* --- TEXT AREA --- */
.report-issue-text {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  transition: all 0.2s ease;
  outline: none;
  border: 1px solid #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2), 0 0 12px rgba(220, 38, 38, 0.15) !important;
  background-color: #ffffff;
  color: inherit;
}

html.dark-mode .report-issue-text {
  border: 1px solid #ff3b30 !important;
  background-color: #0f172a !important;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.25), 0 0 15px rgba(255, 4, 0, 0.4) !important;
  color: #f8fafc !important;
}

/* --- ACTIONS --- */
.report-issue-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  gap: 12px;
}

.report-issue-hint {
  display: block;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
  min-height: 20px;
}

.report-issue-hint:empty {
  display: none;
}

.report-issue-send {
  flex: 0 0 auto;
  min-width: 140px;
  height: 44px;
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  background: var(--report-red);
  color: #fff;
  transition:
    background-color .16s ease,
    color .16s ease,
    transform .16s ease,
    box-shadow .16s ease,
    opacity .16s ease;
}

.report-issue-send:hover {
  background: var(--report-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(216, 27, 24, .18);
}

.report-issue-send:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.report-status.ok { color: #15803d; }
.report-status.error { color: #dc2626; }
.dark-mode .report-status.ok { color: #4ade80; }
.dark-mode .report-status.error { color: #f87171; }

/* --- MOBILE --- */
@media (max-width: 900px) {
  .report-issue-btn {
    width: 28px;
    min-width: 28px;
    height: 28px;
    bottom: 8px;
    inset-inline-start: 8px;
  }

  .report-issue-btn.is-open {
    width: 28px;
    min-width: 28px;
    height: 28px;
  }

  .report-issue-card {
    width: min(480px, calc(100vw - 24px));
  }
}

@media (max-width: 420px) {
  .report-issue-btn {
    width: 26px;
    min-width: 26px;
    height: 26px;
  }

  .report-issue-btn.is-open {
    width: 26px;
    min-width: 26px;
    height: 26px;
  }

  .report-issue-card {
    padding: 9px;
    border-radius: 12px;
  }

  .report-issue-type-grid .report-issue-type[data-issue-type="technical_other"] {
    width: 100%;
  }
}