/* Device long description modal */

.device-detail {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.device-detail[hidden] {
  display: none !important;
}

.device-detail__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(21, 32, 28, 0.62);
  cursor: pointer;
}

.device-detail__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 42rem);
  max-height: min(88svh, 52rem);
  overflow: hidden;
  border-radius: 1.25rem;
  background: var(--paper, #f3f5f3);
  color: var(--ink, #15201c);
  box-shadow: 0 24px 64px rgba(21, 32, 28, 0.28);
  animation: device-detail-in 0.32s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

@keyframes device-detail-in {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.device-detail__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(21, 32, 28, 0.06);
  color: var(--ink, #15201c);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.device-detail__close:hover {
  background: rgba(21, 32, 28, 0.12);
}

.device-detail__header {
  padding: 1.35rem 3.25rem 0.85rem 1.5rem;
  border-bottom: 1px solid var(--line, rgba(21, 32, 28, 0.12));
}

.device-detail__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moss, #5a7a68);
}

.device-detail__title {
  margin: 0;
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 500;
  line-height: 1.2;
}

.device-detail__body {
  overflow: auto;
  padding: 1.15rem 1.5rem 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.device-detail__raw {
  margin: 0;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 1.02rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: #121a17;
  font-weight: 450;
}

.device-detail__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.95rem 1.5rem 1.25rem;
  border-top: 1px solid var(--line, rgba(21, 32, 28, 0.12));
  background: rgba(228, 235, 230, 0.45);
}

.device-detail__footer .btn {
  flex: 1 1 10rem;
}

body.device-detail-open {
  overflow: hidden;
}
