/* Accès distant — dashboard mobile-first */
.remote-main {
  width: min(960px, calc(100% - 2rem));
  margin: calc(var(--header-h) + 1.5rem) auto 3rem;
}
.remote-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.remote-eyebrow {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.remote-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
}
.remote-lead {
  margin: 0.4rem 0 0;
  color: var(--muted);
}
.remote-share {
  margin: 0 0 1.15rem;
  padding: 0.9rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.remote-share label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.45rem;
}
.remote-share-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.remote-share-row input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: inherit;
  font-size: 0.82rem;
}
.remote-share-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.remote-webui-hint {
  margin-top: 0.35rem;
  color: color-mix(in srgb, var(--gold) 70%, var(--muted));
}
.remote-device.is-focus {
  outline: 2px solid color-mix(in srgb, var(--gold) 55%, transparent);
  outline-offset: 2px;
}
.remote-devices {
  display: grid;
  gap: 1rem;
}
.remote-device {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.remote-device-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.remote-device-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.remote-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--line-soft);
  color: var(--muted);
}
.remote-badge.is-online {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.35);
  background: rgba(34, 197, 94, 0.12);
}
.remote-badge.is-offline {
  color: var(--muted);
}
.remote-meta {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.remote-inst {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line-soft);
}
.remote-inst-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: top center;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: #05070a;
  order: 3;
  flex: 1 0 100%;
}
.remote-inst:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.remote-inst-name {
  font-weight: 600;
}
.remote-inst-state {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.remote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
  justify-content: flex-end;
}
.remote-actions .btn {
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
}
.remote-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.remote-device.is-online {
  border-color: color-mix(in srgb, #22c55e 35%, var(--line));
}
.remote-inst-state.is-running { color: #86efac; }
.remote-inst-state.is-paused { color: #fbbf24; }
.remote-inst-state.is-stopped { color: var(--muted); }
.remote-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#remote-msg.is-ok {
  color: #86efac;
}
#remote-msg.is-error {
  color: #fca5a5;
}
/* v2 */
.rm-main {
  position: relative;
  isolation: isolate;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
.rm-bg {
  position: absolute;
  inset: -3rem -8rem auto;
  height: 26rem;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 70% at 50% 0%, rgba(245, 183, 14, 0.14), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: radial-gradient(ellipse at top, #000 35%, transparent 75%);
}
@media (max-width: 1200px) {
  .rm-bg { inset: -3rem 0 auto; }
}
.rm-main .remote-head {
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}
.rm-head-copy { flex: 1; min-width: 0; }
.rm-icon,
.rm-share-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.4rem;
  height: 3.4rem;
  color: var(--gold);
  border: 1px solid var(--line);
  background: var(--gold-soft);
  box-shadow: 0 0 26px rgba(245, 183, 14, 0.22);
}
.rm-icon svg { width: 1.7rem; height: 1.7rem; animation: rm-pulse 2.4s ease-in-out infinite; }
.rm-share-ico { width: 2.6rem; height: 2.6rem; box-shadow: none; }
.rm-share-ico svg { width: 1.2rem; height: 1.2rem; }
.rm-main .remote-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.rm-main .remote-share,
.rm-main .remote-device,
.rm-main .remote-empty {
  border-radius: 0;
}
.rm-main .remote-share {
  display: flex;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  background: linear-gradient(135deg, rgba(245, 183, 14, 0.06), transparent 45%), var(--bg-panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}
.rm-share-body { flex: 1; min-width: 0; }
.rm-main .remote-share-row input {
  padding: 0.65rem 0.8rem;
  border-radius: 0;
  font-family: ui-monospace, Consolas, monospace;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.rm-main .remote-share-row input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 183, 14, 0.16);
}
.rm-main .remote-devices { gap: 1.25rem; }
.rm-main .remote-device {
  position: relative;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
  animation: rm-in 0.45s var(--ease) both;
}
.rm-main .remote-device::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--line-soft);
}
.rm-main .remote-device.is-online::before {
  background: linear-gradient(#22c55e, rgba(34, 197, 94, 0.2));
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.5);
}
.rm-main .remote-device:hover { transform: translateY(-2px); }
.rm-main .remote-device-head h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}
.rm-main .remote-badge.is-online::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: rm-pulse 1.8s ease-in-out infinite;
}
.rm-main .remote-inst {
  margin-top: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-soft);
  background: var(--bg-elev);
  transition: border-color 0.25s var(--ease);
}
.rm-main .remote-inst:first-of-type { padding-top: 0.85rem; border-top: 1px solid var(--line-soft); }
.rm-main .remote-inst:hover { border-color: var(--line); }
.rm-main .remote-inst-preview { border-radius: 0; }
.rm-main .remote-inst-state::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.05rem;
}
.rm-main .remote-empty {
  padding: 3rem 1rem;
  background: var(--bg-panel);
}
@keyframes rm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes rm-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
html[data-theme="light"] .rm-bg {
  background:
    radial-gradient(40% 70% at 50% 0%, rgba(180, 83, 9, 0.1), transparent 70%),
    linear-gradient(rgba(17, 24, 39, 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(17, 24, 39, 0.04) 1px, transparent 1px) 0 0 / 44px 44px;
}
html[data-theme="light"] .rm-main .remote-share,
html[data-theme="light"] .rm-main .remote-device {
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}
@media (prefers-reduced-motion: reduce) {
  .rm-icon svg,
  .rm-main .remote-device,
  .rm-main .remote-badge.is-online::before { animation: none; }
}
@media (max-width: 640px) {
  .rm-main .remote-head { flex-direction: row; flex-wrap: wrap; }
  .rm-main .remote-head .btn { width: 100%; }
  .rm-share-ico { display: none; }
}
@media (max-width: 640px) {
  .remote-main {
    width: min(960px, calc(100% - 1.25rem));
    margin-top: calc(var(--header-h) + 1rem);
  }
  .remote-head {
    flex-direction: column;
    align-items: stretch;
  }
  .remote-inst {
    flex-direction: column;
    align-items: stretch;
  }
  .remote-actions {
    width: 100%;
  }
  .remote-actions .btn {
    flex: 1;
  }
}
