/* ui-751 — Verbindungs-Nachricht: EINE Optik für die Einblendung im Viewer und die Kaltstart-Seite (public/offline.html).
   Texte + Aufbau: client/elements/connection-notice.js. Der Service Worker legt diese Datei vorab in den Cache.
   Farben nur aus tokens.css (die Kaltstart-Seite setzt dieselben Token inline, ein Test hält sie gleich). */

.cn-host { width: 100%; display: grid; justify-items: center; }

.cn-card {
  width: min(340px, calc(100% - 32px)); max-height: calc(100vh - 24px); overflow-y: auto; box-sizing: border-box;
  line-height: 1.45; /* der Prototyp erbt sie vom Seiten-Body; hier fest, damit der Knopf in jeder Hülle gleich sitzt */
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 20px 18px 18px; display: grid; gap: 10px; justify-items: center; text-align: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
}

.cn-ico {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red);
}
.cn-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.cn-ico .cn-arc-dim { opacity: .22; }
.cn-ico .cn-slash { display: none; }
.cn-card[data-kind="offline"] .cn-ico .cn-slash { display: inline; }

.cn-title { margin: 2px 0 0; font-size: 17px; font-weight: 600; line-height: 1.25; color: var(--text); }
.cn-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-dim); max-width: 32ch; }

.cn-btn {
  margin-top: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; width: 100%; max-width: 240px; box-sizing: border-box;
  border: 0; border-radius: 6px; background: var(--cyan); color: var(--bg);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: opacity .15s;
}
.cn-btn:hover { opacity: .88; }
.cn-btn[aria-busy="true"] { opacity: .65; cursor: default; }
.cn-spin {
  display: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: cn-spin .8s linear infinite;
}
.cn-btn[aria-busy="true"] .cn-spin { display: inline-block; }
@keyframes cn-spin { to { transform: rotate(360deg); } }

/* Viewer: Einblendung über allem (Popins, Leisten, Wartungs-Banner), das stehende Bild bleibt abgedunkelt sichtbar. */
.cn-overlay {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 74%, transparent); transition: opacity .22s;
}
.cn-overlay[hidden] { display: none; }
.cn-overlay.cn-gone { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .cn-spin { animation: none; }
  .cn-overlay { transition: none; }
}
