.lgh-emergency-widget {
  --lgh-ink: #383a48;
  --lgh-safe: #2faf5d;
  --lgh-safe-soft: #eaf7ef;
  --lgh-distress: #e55c5c;
  --lgh-distress-soft: #fceeee;
  --lgh-attention: #f6e049;
  --lgh-surface: #fff;
  --lgh-border: #d8dae1;
  --lgh-muted: #666976;
  direction: rtl;
  color: var(--lgh-ink);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.5;
}

.lgh-emergency-widget:not(.lgh-emergency-popup) {
  width: 100%;
}

.lgh-emergency-widget:not(.lgh-emergency-popup) .lgh-emergency-panel {
  margin-inline: auto;
}

.lgh-emergency-widget[hidden],
.lgh-emergency-widget [hidden] {
  display: none !important;
}

.lgh-emergency-widget *,
.lgh-emergency-widget *::before,
.lgh-emergency-widget *::after {
  box-sizing: border-box;
}

.lgh-emergency-widget button,
.lgh-emergency-widget input,
.lgh-emergency-widget textarea {
  font: inherit;
}

.lgh-emergency-popup {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lgh-emergency-overlay {
  position: absolute;
  inset: 0;
  background: rgba(25, 27, 34, 0.72);
}

.lgh-emergency-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  min-height: 360px;
  padding: 32px;
  overflow: auto;
  border: 1px solid var(--lgh-border);
  border-radius: 20px;
  background: var(--lgh-surface);
}

.lgh-emergency-popup .lgh-emergency-panel {
  width: min(100%, 560px);
  max-height: min(680px, calc(100dvh - 48px));
  box-shadow: 0 20px 60px rgba(20, 22, 30, 0.24);
}

.lgh-mode-compact .lgh-emergency-panel {
  width: min(100%, 480px);
  min-height: 280px;
  padding: 24px;
}

.lgh-close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: -12px -12px 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--lgh-ink);
  cursor: pointer;
  font-size: 33px;
  line-height: 1;
}

.lgh-emergency-widget h2 {
  margin: 4px 0 10px;
  color: var(--lgh-ink);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 37px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.lgh-lead {
  margin: 0 auto 26px;
  color: var(--lgh-ink);
  font-size: 23px;
  line-height: 1.5;
  text-align: center;
}

.lgh-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.lgh-choice {
  display: flex;
  min-width: 0;
  min-height: 190px;
  padding: 16px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  background: var(--lgh-surface);
  color: var(--lgh-ink);
  cursor: pointer;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.2;
  transition: background-color 160ms ease-out, transform 80ms ease-out;
}

.lgh-choice:active {
  transform: scale(0.98);
}

.lgh-choice-safe {
  border: 2px solid var(--lgh-safe);
}

.lgh-choice-safe:hover {
  background: var(--lgh-safe-soft);
}

.lgh-choice-distress {
  border: 2px solid var(--lgh-distress);
}

.lgh-choice-distress:hover {
  background: var(--lgh-distress-soft);
}

.lgh-choice img {
  display: block;
  width: 104px;
  height: 104px;
  object-fit: contain;
}

.lgh-note {
  margin: 22px 0 0;
  color: var(--lgh-muted);
  font-size: 18px;
  line-height: 1.45;
  text-align: center;
}

.lgh-screen-loading {
  display: grid;
  min-height: 230px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.lgh-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 3px solid var(--lgh-border);
  border-top-color: var(--lgh-ink);
  border-radius: 50%;
  animation: lgh-spin 800ms linear infinite;
}

.lgh-status-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 4px auto 16px;
  border-radius: 50%;
  font-size: 45px;
  font-weight: 700;
}

.lgh-status-safe {
  background: var(--lgh-safe-soft);
  color: #176b36;
}

.lgh-status-distress {
  background: var(--lgh-distress-soft);
  color: #a62525;
}

.lgh-location-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f5f6f8;
  color: var(--lgh-ink);
  font-size: 20px;
  line-height: 1.45;
}

.lgh-location-status[data-location-state="ready"] {
  background: var(--lgh-safe-soft);
  color: #176b36;
}

.lgh-location-status[data-location-state="warning"] {
  background: #fffbe1;
}

.lgh-location-status[data-location-state="error"] {
  background: var(--lgh-distress-soft);
  color: #7f1d1d;
}

.lgh-location-status[data-location-state="ready"] .lgh-spinner,
.lgh-location-status[data-location-state="warning"] .lgh-spinner,
.lgh-location-status[data-location-state="error"] .lgh-spinner {
  display: none;
}

.lgh-label {
  display: block;
  margin-top: 16px;
  color: var(--lgh-ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
}

.lgh-label input,
.lgh-label textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1.5px solid #bfc2cb;
  border-radius: 10px;
  background: var(--lgh-surface);
  color: var(--lgh-ink);
  font-size: 20px;
  font-weight: 400;
}

.lgh-label textarea {
  min-height: 96px;
  resize: vertical;
}

.lgh-primary,
.lgh-secondary {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  padding: 10px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
}

.lgh-primary {
  border: 1px solid var(--lgh-ink);
  background: var(--lgh-ink);
  color: #fff;
}

.lgh-secondary {
  border: 1.5px solid var(--lgh-ink);
  background: var(--lgh-surface);
  color: var(--lgh-ink);
}

.lgh-link-button {
  display: block;
  min-height: 48px;
  margin: 12px auto 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--lgh-ink);
  cursor: pointer;
  text-decoration: underline;
}

.lgh-message {
  min-height: 1.5em;
  margin-top: 12px;
  color: #176b36;
  font-size: 20px;
  text-align: center;
}

.lgh-message.is-error {
  color: #a62525;
}

.lgh-emergency-widget button:focus-visible,
.lgh-emergency-widget input:focus-visible,
.lgh-emergency-widget textarea:focus-visible {
  outline: 3px solid var(--lgh-attention);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--lgh-ink);
}

@keyframes lgh-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 540px) {
  .lgh-emergency-popup { padding: 12px; }
  .lgh-emergency-panel { padding: 20px; }
  .lgh-emergency-popup .lgh-emergency-panel {
    width: min(100%, 420px);
    max-height: calc(100dvh - 24px);
  }
  .lgh-emergency-widget h2 { font-size: 33px; }
  .lgh-lead { margin-bottom: 20px; font-size: 22px; }
  .lgh-actions { gap: 12px; }
  .lgh-choice { min-height: 160px; padding: 10px; font-size: 25px; }
  .lgh-choice img { width: 84px; height: 84px; }
}

@media (max-width: 340px) {
  .lgh-actions { grid-template-columns: 1fr; }
  .lgh-choice { min-height: 132px; flex-direction: row; }
  .lgh-choice img { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .lgh-choice { transition: none; }
  .lgh-spinner { animation: none; }
}

/* בידוד מתבניות ותוספים שמגדירים CSS גלובלי לכפתורים, תמונות וכותרות. */
body .lgh-emergency-widget .lgh-emergency-panel {
  color: var(--lgh-ink) !important;
  background: var(--lgh-surface) !important;
  text-align: right !important;
}

body .lgh-emergency-widget h2,
body .lgh-emergency-widget h2:focus {
  margin: 4px 0 10px !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--lgh-ink) !important;
  font-family: "Open Sans", Arial, sans-serif !important;
  font-size: 37px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-align: center !important;
  text-transform: none !important;
}

body .lgh-emergency-widget button.lgh-choice {
  position: static !important;
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 190px !important;
  margin: 0 !important;
  padding: 16px !important;
  float: none !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  border-radius: 16px !important;
  color: var(--lgh-ink) !important;
  box-shadow: none !important;
  font-family: "Open Sans", Arial, sans-serif !important;
  font-size: 32px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: none !important;
}

body .lgh-emergency-widget button.lgh-choice-safe {
  border: 4px solid var(--lgh-safe) !important;
  background: var(--lgh-safe-soft) !important;
}

body .lgh-emergency-widget button.lgh-choice-distress {
  border: 4px solid var(--lgh-distress) !important;
  background: var(--lgh-distress-soft) !important;
}

body .lgh-emergency-widget button.lgh-choice-safe:hover,
body .lgh-emergency-widget button.lgh-choice-safe:focus-visible {
  background: #d8f1e1 !important;
}

body .lgh-emergency-widget button.lgh-choice-distress:hover,
body .lgh-emergency-widget button.lgh-choice-distress:focus-visible {
  background: #f9dddd !important;
}

body .lgh-emergency-widget button.lgh-choice img {
  position: static !important;
  display: block !important;
  width: 104px !important;
  height: 104px !important;
  max-width: 104px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  float: none !important;
  align-self: center !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

body .lgh-emergency-widget button.lgh-close {
  display: grid !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  margin: -12px -12px 0 auto !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid var(--lgh-border) !important;
  border-radius: 50% !important;
  background: var(--lgh-surface) !important;
  color: var(--lgh-ink) !important;
  box-shadow: none !important;
  font-size: 33px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
}

body .lgh-emergency-widget button.lgh-primary,
body .lgh-emergency-widget button.lgh-secondary,
body .lgh-emergency-widget button.lgh-link-button {
  font-family: "Open Sans", Arial, sans-serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

body .lgh-emergency-widget button.lgh-primary {
  border: 1px solid var(--lgh-ink) !important;
  background: var(--lgh-ink) !important;
  color: #fff !important;
}

body .lgh-emergency-widget button.lgh-secondary {
  border: 1.5px solid var(--lgh-ink) !important;
  background: var(--lgh-surface) !important;
  color: var(--lgh-ink) !important;
}

@media (max-width: 540px) {
  body .lgh-emergency-widget h2,
  body .lgh-emergency-widget h2:focus { font-size: 33px !important; }
  body .lgh-emergency-widget button.lgh-choice {
    min-height: 160px !important;
    padding: 10px !important;
    font-size: 28px !important;
  }
  body .lgh-emergency-widget button.lgh-choice img {
    width: 84px !important;
    height: 84px !important;
    max-width: 84px !important;
  }
}

/* Front-end emergency management panel. */
body .lgh-emergency-manager {
  box-sizing: border-box !important;
  width: min(100%, 920px) !important;
  margin: 24px auto !important;
  padding: 28px !important;
  direction: rtl !important;
  border: 1px solid #d8dae1 !important;
  border-radius: 18px !important;
  background: #fff !important;
  color: #383a48 !important;
  font-family: "Open Sans", Arial, sans-serif !important;
  font-size: 20px !important;
  line-height: 1.5 !important;
}
body .lgh-emergency-manager *,
body .lgh-emergency-manager *::before,
body .lgh-emergency-manager *::after { box-sizing: border-box !important; }
body .lgh-emergency-manager h2 {
  margin: 0 0 20px !important;
  color: #383a48 !important;
  font: 700 37px/1.2 "Open Sans", Arial, sans-serif !important;
  text-align: center !important;
}
body .lgh-manager-notice {
  margin-bottom: 18px !important;
  padding: 14px 16px !important;
  border-right: 5px solid #2faf5d !important;
  border-radius: 10px !important;
  background: #eaf7ef !important;
  font-weight: 700 !important;
}
body .lgh-manager-state {
  display: grid !important;
  gap: 4px !important;
  margin-bottom: 20px !important;
  padding: 18px !important;
  border-radius: 12px !important;
  text-align: center !important;
}
body .lgh-manager-state strong { font-size: 27px !important; }
body .lgh-manager-state span { font-size: 23px !important; font-weight: 700 !important; }
body .lgh-manager-state small { font-size: 17px !important; }
body .lgh-manager-state-inactive { background: #f5f6f8 !important; }
body .lgh-manager-state-active { background: #fceeee !important; color: #8b1e1e !important; }
body .lgh-manager-state-ended { background: #eaf7ef !important; color: #176b36 !important; }
body .lgh-manager-form,
body .lgh-manager-actions {
  display: grid !important;
  gap: 18px !important;
}
body .lgh-emergency-manager form { margin: 0 !important; }
body .lgh-emergency-manager label {
  display: block !important;
  color: #383a48 !important;
  font: 700 20px/1.45 "Open Sans", Arial, sans-serif !important;
}
body .lgh-emergency-manager input[type="text"],
body .lgh-emergency-manager input[type="number"] {
  display: block !important;
  width: 100% !important;
  min-height: 56px !important;
  margin-top: 7px !important;
  padding: 10px 14px !important;
  border: 1.5px solid #bfc2cb !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #383a48 !important;
  font: 400 20px/1.4 "Open Sans", Arial, sans-serif !important;
}
body .lgh-manager-delay {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
body .lgh-manager-delay input[type="number"] { width: 130px !important; }
body .lgh-manager-button {
  display: inline-flex !important;
  min-height: 56px !important;
  padding: 12px 24px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #383a48 !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #383a48 !important;
  font: 700 22px/1.2 "Open Sans", Arial, sans-serif !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
}
body .lgh-manager-button-danger {
  border-color: #d63638 !important;
  background: #d63638 !important;
  color: #fff !important;
}
body .lgh-manager-button-danger:hover,
body .lgh-manager-button-danger:focus { border-color: #a61b1d !important; background: #a61b1d !important; color: #fff !important; }
body .lgh-manager-button-dark { background: #383a48 !important; color: #fff !important; }
body .lgh-manager-button-large {
  width: min(100%, 420px) !important;
  min-height: 84px !important;
  margin: 6px auto 0 !important;
  font-size: 32px !important;
}
body .lgh-manager-stats {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 20px !important;
}
body .lgh-manager-stats div {
  padding: 16px !important;
  border: 1px solid #d8dae1 !important;
  border-radius: 12px !important;
  text-align: center !important;
}
body .lgh-manager-stats span,
body .lgh-manager-stats strong { display: block !important; }
body .lgh-manager-stats strong { font-size: 38px !important; }
body .lgh-manager-distress {
  margin: 0 0 22px !important;
  padding: 18px !important;
  border: 2px solid #e55c5c !important;
  border-radius: 14px !important;
  background: #fff7f7 !important;
}
body .lgh-manager-distress h3 {
  margin: 0 0 14px !important;
  color: #8b1e1e !important;
  font: 700 27px/1.3 "Open Sans", Arial, sans-serif !important;
}
body .lgh-manager-no-distress { margin: 0 !important; }
body .lgh-manager-distress-list { display: grid !important; gap: 12px !important; }
body .lgh-manager-distress-item {
  padding: 16px !important;
  border: 1px solid #e8b9b9 !important;
  border-radius: 12px !important;
  background: #fff !important;
}
body .lgh-manager-distress-item header {
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 8px !important;
}
body .lgh-manager-distress-item header strong { font-size: 23px !important; }
body .lgh-manager-distress-item header span { color: #666976 !important; font-size: 16px !important; }
body .lgh-manager-distress-item p { margin: 5px 0 !important; }
body .lgh-manager-distress-links {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px 20px !important;
  margin-top: 10px !important;
  font-weight: 700 !important;
}
body .lgh-manager-actions { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
body .lgh-manager-actions form {
  display: grid !important;
  align-content: end !important;
  gap: 12px !important;
}
body .lgh-manager-message { text-align: center !important; }
body .lgh-manager-report {
  margin-bottom: 22px !important;
  padding: 20px !important;
  border: 2px solid #d63638 !important;
  border-radius: 14px !important;
  background: #fff7f7 !important;
}
body .lgh-manager-report h3 { margin-top: 0 !important; font-size: 27px !important; }
body .lgh-manager-report dl {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px 18px !important;
}
body .lgh-manager-report dl div { padding: 8px 0 !important; }
body .lgh-manager-report dt { font-weight: 700 !important; }
body .lgh-manager-report dd { margin: 0 !important; }

@media (max-width: 640px) {
  body .lgh-emergency-manager { padding: 20px !important; }
  body .lgh-manager-actions { grid-template-columns: 1fr !important; }
  body .lgh-manager-button { width: 100% !important; }
  body .lgh-manager-report dl { grid-template-columns: 1fr !important; }
}

@media (max-width: 340px) {
  body .lgh-emergency-widget button.lgh-choice {
    min-height: 132px !important;
    flex-direction: row !important;
  }
  body .lgh-emergency-widget button.lgh-choice img {
    width: 72px !important;
    height: 72px !important;
    max-width: 72px !important;
  }
}
