.deviceGrid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-items: start;
}

.deviceTile {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.tileActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.tileActions button,
.tileActions .iconButton {
  width: 100%;
  min-width: 0;
  max-width: none;
  white-space: normal;
}

.tileActions .removeDevice {
  display: block;
  grid-column: 1 / -1;
  background: #62283a;
  color: #fff;
}

.groupActions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.groupActions button {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .deviceGrid { grid-template-columns: minmax(0, 1fr); }
  .groupBlock > summary { flex-wrap: wrap; }
  .groupActions { width: 100%; justify-content: stretch; }
  .groupActions button { flex: 1 1 150px; max-width: none !important; }
}

.removeDialog { width: min(460px, calc(100vw - 32px)); border: 1px solid #39445c; border-radius: 14px; padding: 0; background: #111722; color: #edf2ff; }
.removeDialog::backdrop { background: #000b; }
.removeDialog form { padding: 20px; }
.removeDialog h2 { margin: 0 0 8px; }
.removeDialog p { color: #9aa6bf; }
.confirmCheck { display: flex; align-items: center; gap: 9px; margin: 18px 0; color: #dce4f6; font-size: 13px; }
.confirmCheck input { width: auto; margin: 0; }
.dialogActions { display: flex; justify-content: flex-end; gap: 10px; }
.dialogActions button { align-self: center; }
.dialogActions .cancel { background: #293247; }

.managementPanel { border: 1px solid #252d3d; border-radius: 12px; background: #0c111b; }
.managementPanel > summary { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; color: #aeb9cf; }
.managementPanel > summary span { color: #65728c; font-size: 12px; }
.managementBody { display: grid; gap: 8px; padding: 0 10px 10px; }
.compactAdmin { padding: 9px 10px; border-radius: 9px; background: #101620; }
.compactAdmin > div { flex: 0 0 145px; }
.compactAdmin input { padding: 7px 9px; }
.compactAdmin button { padding: 8px 12px; }
.compactUserList { padding: 10px; border: 1px solid #252d3d; border-radius: 9px; }
.userRows .guestRow { padding: 6px 0; }

.deviceGrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.deviceTile.collapsed { padding: 0; }
.deviceToggle { min-height: 58px; padding: 10px 12px; cursor: pointer; justify-content: space-between; }
.deviceToggle > div { min-width: 0; }
.deviceToggle strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deviceToggle small { display: block; margin-top: 4px; color: #7f8ba4; }
.deviceToggle small.onlineText { color: #67e8a5; }
.deviceArrow { color: #7f8ba4; font-size: 24px; transition: transform .15s ease; }
.deviceToggle[aria-expanded="true"] .deviceArrow { transform: rotate(90deg); }
.deviceDetails { padding-top: 9px; }
.renameDevice { display: flex; gap: 7px; margin-bottom: 8px; }
.renameDevice input { min-width: 0; margin: 0; padding: 7px 9px; }
.renameDevice button { flex: 0 0 auto; align-self: stretch; padding: 7px 10px; }

.computerIcon { position: relative; flex: 0 0 38px; width: 38px; height: 31px; border: 3px solid currentColor; border-radius: 5px; color: #72809a; transition: opacity .2s ease, color .2s ease, filter .2s ease; }
.computerIcon::before { content: ''; position: absolute; left: 14px; bottom: -8px; width: 5px; height: 7px; background: currentColor; }
.computerIcon::after { content: ''; position: absolute; left: 8px; bottom: -10px; width: 18px; height: 3px; border-radius: 3px; background: currentColor; }
.computerIcon.online { color: #4f8cff; background: #2457b626; box-shadow: 0 0 16px #377dff55; }
.computerIcon.offline { color: #758096; opacity: .38; filter: grayscale(1); }
