
.live { padding-block: 48px 64px; }
.live-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
.live-head h1 { font-size: 34px; margin: 0 0 4px; letter-spacing: -0.01em; }
.live-head p { margin: 0; max-width: 640px; }

button.button { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
button.button:hover { opacity: 0.88; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); color: var(--fg); font: inherit; font-size: 14px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.danger { color: #c4271b; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #ff6b5e; } }
.link { border: 0; padding: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.link:hover { color: var(--fg); }

.banner { padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--rule); margin: 0 0 24px; }

.empty { text-align: center; padding: 56px 16px; border: 1px dashed var(--rule); border-radius: 14px; }
.empty h2 { margin: 0 0 8px; font-size: 22px; }
.empty p { max-width: 520px; margin: 0 auto 20px; }

/* One device per row so each screen uses the full content width. */
.cards { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); flex: none; }
.dot.ok { background: #2f9e44; }
.dot.bad { background: #d9480f; }
.dot.loading { background: var(--muted); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .dot.loading { animation: none; } }

/* E-ink panels are white whatever the page theme, so the frame stays light. */
.frame { position: relative; background: #fff; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.frame img { width: 100%; height: auto; display: block; }
/* Portrait panels would be very tall at full width: fit them to the window and centre them. */
.card.portrait .frame { width: fit-content; max-width: 100%; margin-inline: auto; }
.card.portrait .frame img { width: auto; max-width: 100%; max-height: 85vh; }
.placeholder { margin: 0; aspect-ratio: 5 / 3; display: grid; place-items: center; color: #8a8a8e; font-size: 14px; }
.frame:fullscreen { background: #000; border: 0; border-radius: 0; display: flex; align-items: center; justify-content: center; }
.frame:fullscreen img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }

.card .error { margin: 0; font-size: 14px; color: #c4271b; }
@media (prefers-color-scheme: dark) { .card .error, #form-error { color: #ff6b5e; } }

.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.meta { margin: 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta span:empty { display: none; }
.meta [data-role="filename"] { font-family: ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.live-notes { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); max-width: 760px; }
.live-notes p { margin: 0 0 10px; }
.live-notes strong { color: var(--fg); }

dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--rule); border-radius: 14px; padding: 22px; background: var(--surface); color: var(--fg); }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog h2 { margin: 0 0 16px; font-size: 20px; }
dialog label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
dialog input[type="text"], dialog input[type="password"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); color: var(--fg); font: inherit;
}
dialog input:focus-visible, .btn:focus-visible, .button:focus-visible, .link:focus-visible { outline: 2px solid #3478f6; outline-offset: 2px; }
dialog label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); }
#form-error { margin: 12px 0 0; font-size: 14px; color: #c4271b; }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.dialog-actions .spacer { flex: 1; }
.dialog-actions .button { padding: 8px 18px; }
