/* Rescue Life 247 — Larmcentral (original UI) */
html.rl247-ac-open #root { visibility: hidden !important; }
html.rl247-ac-open body { overflow: auto; background: #fff; }

.rl247-ac-root {
  --ac-text: #0f172a;
  --ac-muted: #64748b;
  --ac-border: #e2e8f0;
  --ac-pink: #fef2f2;
  --ac-pink-border: #fecaca;
  --ac-green: #16a34a;
  --ac-green-bg: #dcfce7;
  --ac-green-text: #166534;
  --ac-red: #dc2626;
  --ac-radius: 12px;
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  overflow: auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ac-text);
  background: #fff;
}
.rl247-ac-root *, .rl247-ac-root *::before, .rl247-ac-root *::after { box-sizing: border-box; }

.rl247-ac-page {
  --ac-page-max: 100%;
  width: min(100%, var(--ac-page-max));
  max-width: var(--ac-page-max);
  margin: 0 auto;
  min-height: 100%;
  padding: 0.85rem 1rem 2.5rem;
  position: relative;
}

/* Top bar: back arrow */
.rl247-ac-topbar {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  margin-bottom: 0.35rem;
}
.rl247-ac-icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  border: 1px solid #e8edf3;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color: #334155;
  cursor: pointer;
  padding: 0;
}
.rl247-ac-icon-btn:hover { background: #f8fafc; }
.rl247-ac-icon-btn svg { width: 1.15rem; height: 1.15rem; display: block; }

.rl247-ac-hero {
  text-align: center;
  padding: 0.15rem 0.5rem 0.85rem;
}
.rl247-ac-hero h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0b1736;
}
.rl247-ac-hero p {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: #7c8aa0;
  line-height: 1.35;
}
.rl247-ac-hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

/* Segmented tabs */
.rl247-ac-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.2rem;
  background: #eef1f5;
  border-radius: 12px;
  padding: 0.28rem;
  margin: 0.35rem 0 1rem;
}
.rl247-ac-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.55rem 0.2rem;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}
.rl247-ac-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

/* Empty state */
.rl247-ac-empty {
  text-align: center;
  padding: 3.5rem 1.25rem 2rem;
  color: #94a3b8;
}
.rl247-ac-empty svg {
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 0.85rem;
  display: block;
  opacity: 0.75;
}
.rl247-ac-empty p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Alarm cards */
.rl247-ac-list { display: flex; flex-direction: column; gap: 0.75rem; }

.rl247-ac-alarm {
  border-radius: 14px;
  padding: 0.95rem 1rem;
  border: 1px solid var(--ac-pink-border);
  background: var(--ac-pink);
}
.rl247-ac-alarm.active-alarm {
  border-color: #fca5a5;
  background: #fff1f2;
}
.rl247-ac-alarm.ack-alarm {
  border-color: #fde68a;
  background: #fffbeb;
}
.rl247-ac-alarm.resolved-alarm {
  border-color: #fecaca;
  background: #fef2f2;
}

.rl247-ac-alarm-top {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}
.rl247-ac-status-icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}
.rl247-ac-status-icon.ok { background: #22c55e; color: #fff; }
.rl247-ac-status-icon.warn { background: #f59e0b; color: #fff; }
.rl247-ac-status-icon.bad { background: #ef4444; color: #fff; }
.rl247-ac-status-icon svg { width: 0.75rem; height: 0.75rem; }

.rl247-ac-alarm-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.rl247-ac-alarm-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.25;
}
.rl247-ac-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  line-height: 1.2;
}
.rl247-ac-badge.resolved { background: var(--ac-green-bg); color: var(--ac-green-text); }
.rl247-ac-badge.active { background: #fee2e2; color: #b91c1c; }
.rl247-ac-badge.acknowledged { background: #fef3c7; color: #b45309; }

.rl247-ac-alarm-meta {
  margin: 0.55rem 0 0 1.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.8rem;
  color: #64748b;
}
.rl247-ac-alarm-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.rl247-ac-alarm-meta svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
  opacity: 0.85;
}
.rl247-ac-alarm-note {
  margin: 0.55rem 0 0 1.9rem;
  font-size: 0.75rem;
  color: #94a3b8;
}
.rl247-ac-alarm-actions {
  margin: 0.75rem 0 0 1.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rl247-ac-btn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}
.rl247-ac-btn:hover { background: #f8fafc; }
.rl247-ac-btn.primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.rl247-ac-btn.primary:hover { filter: brightness(1.08); }
.rl247-ac-btn.block {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}
.rl247-ac-btn.ghost {
  background: #fff;
  border-color: #0f172a;
  color: #0f172a;
}
.rl247-ac-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Timeline */
.rl247-ac-timeline-wrap {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 16px;
  padding: 1rem 1rem 0.5rem 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.rl247-ac-timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rl247-ac-timeline::before {
  content: "";
  position: absolute;
  left: 0.72rem;
  top: 0.4rem;
  bottom: 0.8rem;
  width: 2px;
  background: #dbeafe;
}
.rl247-ac-tl-item {
  position: relative;
  padding: 0 0 1.15rem 2.15rem;
}
.rl247-ac-tl-dot {
  position: absolute;
  left: 0.28rem;
  top: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.rl247-ac-tl-dot.ok { background: #22c55e; color: #fff; }
.rl247-ac-tl-dot.bad {
  background: #ef4444;
  color: #fff;
  border-radius: 0.2rem;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  width: 1rem;
  height: 0.9rem;
  border-radius: 0;
}
.rl247-ac-tl-dot.bad-tri {
  background: transparent;
  color: #ef4444;
  width: 1.15rem;
  height: 1.15rem;
}
.rl247-ac-tl-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 750;
  color: #0f172a;
}
.rl247-ac-tl-sub {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.35;
}
.rl247-ac-tl-time {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Settings modal */
.rl247-ac-modal {
  position: fixed;
  inset: 0;
  z-index: 2147482100;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
}
.rl247-ac-modal-sheet {
  width: min(480px, 100%);
  max-height: 100%;
  margin: 0 auto;
  background: #fff;
  overflow: auto;
  display: flex;
  flex-direction: column;
  animation: rl247-ac-up 0.2s ease;
}
@keyframes rl247-ac-up {
  from { transform: translateY(10px); opacity: 0.7; }
  to { transform: none; opacity: 1; }
}
.rl247-ac-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid #eef2f6;
  padding: 1rem 1.1rem 0.9rem;
  text-align: center;
}
.rl247-ac-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}
.rl247-ac-modal-head p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}
.rl247-ac-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  border: none;
  background: transparent;
  color: #64748b;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}
.rl247-ac-modal-close:hover { background: #f1f5f9; }
.rl247-ac-modal-body {
  padding: 0.25rem 1.15rem 1.5rem;
  flex: 1;
}

.rl247-ac-sec {
  padding: 1rem 0;
  border-bottom: 1px solid #eef2f6;
}
.rl247-ac-sec:last-of-type { border-bottom: none; }
.rl247-ac-sec-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 750;
  color: #0f172a;
}
.rl247-ac-sec-title svg {
  width: 1rem;
  height: 1rem;
  color: #64748b;
  flex-shrink: 0;
}
.rl247-ac-sec-hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}
.rl247-ac-sec-empty {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
}

.rl247-ac-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  color: #0f172a;
}
.rl247-ac-row > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.rl247-ac-row svg { width: 0.95rem; height: 0.95rem; color: #64748b; flex-shrink: 0; }

.rl247-ac-field {
  display: block;
  margin: 0.55rem 0;
}
.rl247-ac-field > span {
  display: block;
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 0.35rem;
}
.rl247-ac-field input[type="email"],
.rl247-ac-field input[type="text"],
.rl247-ac-field input[type="time"] {
  width: 100%;
  border: 1px solid #d0d7e2;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  background: #fff;
  color: #0f172a;
}
.rl247-ac-num-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.15rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #475569;
}
.rl247-ac-num-row input[type="number"] {
  width: 3.5rem;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  padding: 0.4rem 0.45rem;
  font-size: 0.9rem;
  text-align: center;
  background: #fff;
}
.rl247-ac-delay-block { margin-bottom: 0.85rem; }
.rl247-ac-delay-block > label {
  display: block;
  font-size: 0.875rem;
  color: #0f172a;
  margin-bottom: 0.15rem;
}
.rl247-ac-delay-block small {
  display: block;
  color: #94a3b8;
  font-size: 0.75rem;
  margin-top: 0.2rem;
  line-height: 1.35;
}

/* Toggle switch */
.rl247-ac-switch {
  position: relative;
  width: 2.75rem;
  height: 1.55rem;
  flex-shrink: 0;
}
.rl247-ac-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.rl247-ac-switch span {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}
.rl247-ac-switch span::after {
  content: "";
  position: absolute;
  width: 1.2rem;
  height: 1.2rem;
  left: 0.18rem;
  top: 0.175rem;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s;
}
.rl247-ac-switch input:checked + span { background: #0f172a; }
.rl247-ac-switch input:checked + span::after { transform: translateX(1.15rem); }

.rl247-ac-quiet-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
}
.rl247-ac-quiet-item button {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
}
.rl247-ac-settings-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.5rem 0 1rem;
}

/* Help modal (smaller) */
.rl247-ac-help-box {
  background: #fff;
  border-radius: 16px;
  margin: auto 1rem;
  max-width: 400px;
  width: 100%;
  padding: 1.25rem 1.2rem 1.1rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}
.rl247-ac-help-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
}
.rl247-ac-help-box p {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.45;
}
.rl247-ac-help-box ul {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.45;
}

.rl247-ac-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 2147483000;
  background: #0f172a;
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  max-width: 90vw;
}

@media (min-width: 640px) {
  .rl247-ac-page {
    --ac-page-max: 640px;
    padding: 1.25rem 1.5rem 3rem;
  }
  .rl247-ac-hero h1 { font-size: 1.75rem; }
  .rl247-ac-tab { font-size: 0.85rem; padding: 0.6rem 0.35rem; }
  .rl247-ac-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

/* Padda */
@media (min-width: 768px) {
  .rl247-ac-page {
    --ac-page-max: 820px;
    padding: 1.5rem 1.75rem 3rem;
  }
  .rl247-ac-topbar { margin-bottom: 0.5rem; }
  .rl247-ac-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title actions"
      "sub actions";
    align-items: center;
    column-gap: 1rem;
    text-align: left;
    padding: 0.25rem 0 1rem;
  }
  .rl247-ac-hero h1 { grid-area: title; }
  .rl247-ac-hero > p { grid-area: sub; margin-top: 0.2rem; }
  .rl247-ac-hero-actions {
    grid-area: actions;
    margin-top: 0;
    justify-content: flex-end;
  }
  .rl247-ac-tabs {
    max-width: none;
    margin-bottom: 1.25rem;
  }
  .rl247-ac-tab { font-size: 0.9rem; padding: 0.65rem 0.5rem; }
  .rl247-ac-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
  .rl247-ac-timeline-wrap { padding: 1.25rem 1.35rem 0.75rem; }
  .rl247-ac-modal {
    align-items: center;
    padding: 1.5rem;
  }
  .rl247-ac-modal-sheet {
    width: min(560px, 100%);
    max-height: min(920px, 92vh);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  }
}

/* Dator */
@media (min-width: 1024px) {
  .rl247-ac-page {
    --ac-page-max: 1100px;
    padding: 1.75rem 2rem 3.5rem;
  }
  .rl247-ac-hero h1 { font-size: 2rem; }
  .rl247-ac-hero > p { font-size: 0.95rem; }
  .rl247-ac-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rl247-ac-empty { padding: 4.5rem 2rem; }
  .rl247-ac-empty svg { width: 5rem; height: 5rem; }
}

@media (min-width: 1280px) {
  .rl247-ac-page { --ac-page-max: 1200px; }
  .rl247-ac-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tidslogg: alltid en kolumn */
.rl247-ac-timeline-wrap {
  grid-column: 1 / -1;
}

