.device-name-link { color: inherit; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.device-name-link:hover { color: #2563eb; }
.device-name-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
#deviceDetails { box-sizing: border-box; width: max-content; max-width: 94vw; max-height: 92dvh; padding: 12px; border: 1px solid #c7d2fe; border-radius: 20px; box-shadow: 0 24px 90px #312e8155; color: #17243b; background: linear-gradient(135deg, #eef2ff, #f5f3ff 60%, #f8fafc); }
#deviceDetails[open] { display: flex; flex-direction: column; }
#deviceDetails::backdrop { background: #0f172a99; backdrop-filter: blur(3px); }
#deviceDetails > header { display: flex; justify-content: space-between; align-items: start; gap: 2rem; padding: 0 0 6px; margin: 0; position: static; border-bottom: 1px solid #c7d2fe; background: transparent; }
#deviceDetails h2 { margin: 0; color: #4338ca; overflow-wrap: anywhere; }
#deviceDetailsIdentity { margin: 4px 0 0; color: #475569; }
#deviceDetails .device-details-close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 1px solid #cbd5e1; border-radius: 50%; background: #f1f5f9; color: #475569; font-size: 1.7rem; line-height: 1; box-shadow: none; }
#deviceDetails .device-details-close:hover { color: #fff; background: #475569; }
.device-details-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; flex-shrink: 0; }
#deviceDetailsRefresh { border: 1px solid #a5b4fc; background: #e0e7ff; color: #3730a3; }
#deviceDetailsStatus { margin: 0; color: #475569; font-size: .85rem; }
.device-details-scroll { overflow: auto; min-height: 0; margin-top: 6px; padding: 1px; }
.device-parameter-grid { display: grid; grid-template-columns: repeat(var(--device-details-columns, 4), minmax(0, 1fr)); gap: 2px 6px; }
.device-parameters-view .device-parameter { --parameter-accent: #4338ca; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 1px 10px; border: 1px solid #c7d2fe; border-top: 2px solid var(--parameter-accent); border-radius: 6px; background: #eef2ff; min-width: 0; box-shadow: 0 3px 8px #1e293b08; }
.device-parameters-view .device-parameter:nth-child(4n+2) { --parameter-accent: #1d4ed8; border-color: #bfdbfe; border-top-color: var(--parameter-accent); background: #eff6ff; }
.device-parameters-view .device-parameter:nth-child(4n+3) { --parameter-accent: #6d28d9; border-color: #ddd6fe; border-top-color: var(--parameter-accent); background: #f5f3ff; }
.device-parameters-view .device-parameter:nth-child(4n+4) { --parameter-accent: #475569; border-color: #cbd5e1; border-top-color: var(--parameter-accent); background: #f1f5f9; }
.device-parameters-view dt { font-size: .85rem; line-height: 1.25; font-weight: 600; color: #475569; overflow-wrap: anywhere; }
.device-parameters-view dd { margin: 0; color: var(--parameter-accent); font-size: .95rem; line-height: 1.15; flex-shrink: 0; font-weight: 750; overflow-wrap: anywhere; }
@media (max-width: 900px) { .device-parameter-grid { grid-template-columns: repeat(min(var(--device-details-columns, 4), 2), minmax(0, 1fr)); } }
@media (max-width: 520px) { #deviceDetails { padding: 10px; } .device-parameter-grid { grid-template-columns: minmax(0, 1fr); } .device-parameters-view .device-parameter { padding: 3px 10px; } }

.device-inline-parameters { padding: 6px; white-space: normal; background: linear-gradient(135deg, #eef2ff, #f5f3ff 60%, #f8fafc); border-radius: 6px; }
.device-inline-timestamp { margin: 0 0 6px; color: #475569; font-size: .85rem; }
@media screen {
  html[data-content-theme=dark] #deviceDetails { color-scheme:dark;background:#1b2a3f;color:#e2e8f0;border-color:#526783; }
  html[data-content-theme=dark] #deviceDetails > header { border-color:#364b68; }
  html[data-content-theme=dark] #deviceDetails h2 { color:#c4b5fd; }
  html[data-content-theme=dark] :is(#deviceDetailsIdentity,#deviceDetailsStatus,.device-inline-timestamp) { color:#a9bbd3; }
  html[data-content-theme=dark] #deviceDetails :is(.device-details-close,#deviceDetailsRefresh) { background:#26374f;color:#ddd6fe;border-color:#526783; }
  html[data-content-theme=dark] #deviceDetails :is(.device-details-close,#deviceDetailsRefresh):hover { background:#293e58;color:#fff; }
  html[data-content-theme=dark] .device-inline-parameters { background:#152238;color:#e2e8f0; }
  html[data-content-theme=dark] .device-parameters-view .device-parameter { --parameter-accent:#c4b5fd;background:#1b2a3f;border-color:#364b68;border-top-color:var(--parameter-accent); }
  html[data-content-theme=dark] .device-parameters-view .device-parameter:nth-child(4n+2) { --parameter-accent:#93c5fd; }
  html[data-content-theme=dark] .device-parameters-view .device-parameter:nth-child(4n+3) { --parameter-accent:#d8b4fe; }
  html[data-content-theme=dark] .device-parameters-view .device-parameter:nth-child(4n+4) { --parameter-accent:#cbd5e1; }
  html[data-content-theme=dark] .device-parameters-view dt { color:#c3d4ec; }
}
