/* KEEYNET DEVICE NETWORK MANAGE V2 */

.kc-device-network {
  margin: 18px 0 6px;
  padding: 14px 0 0;

  border: 0;
  border-top: 1px solid var(--line);

  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.kc-device-network h3 {
  margin: 0 0 4px;

  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: -.01em;

  color: var(--text);
}

.kc-device-network-row {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: center;
  gap: 24px;

  padding: 12px 0;

  border: 0;
  border-bottom: 1px solid var(--line);

  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.kc-device-network-copy strong {
  display: block;

  margin: 0 0 3px;

  font-size: 12.25px;
  font-weight: 500;

  color: var(--text);
}

.kc-device-network-copy p {
  max-width: 560px;

  margin: 0;

  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;

  color: var(--muted);
}

.kc-device-network-state {
  display: block;

  margin-top: 5px;

  font-size: 10.75px;
  font-weight: 450;

  color: var(--muted);
}

.kc-device-lan-networks {
  padding: 9px 0 11px;

  border-bottom: 1px solid var(--line);
}

.kc-device-network-label {
  display: block;

  margin-bottom: 5px;

  font-size: 10.5px;
  font-weight: 450;

  color: var(--muted);
}

#manage-device-lan-networks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;

  font-size: 11.5px;
  font-weight: 400;

  color: var(--muted);
}

#manage-device-lan-networks code {
  padding: 0;
  border: 0;

  background: transparent;

  font-family:
    "Roboto Mono",
    "SFMono-Regular",
    Consolas,
    monospace;

  font-size: 11px;
  font-weight: 400;

  color: var(--text);
}

.kc-device-switch {
  position: relative;

  display: inline-flex;

  width: 32px;
  height: 18px;

  flex: 0 0 auto;
}

.kc-device-switch input {
  position: absolute;
  opacity: 0;
}

.kc-device-switch span {
  position: absolute;
  inset: 0;

  border: 1px solid var(--line);
  border-radius: 999px;

  background: var(--surface-soft);

  cursor: pointer;

  transition:
    background-color 120ms ease,
    border-color 120ms ease;
}

.kc-device-switch span::after {
  position: absolute;

  top: 2px;
  left: 2px;

  width: 12px;
  height: 12px;

  border-radius: 50%;

  background: var(--muted);

  content: "";

  transition:
    transform 120ms ease,
    background-color 120ms ease;
}

.kc-device-switch input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
}

.kc-device-switch input:checked + span::after {
  transform: translateX(14px);
  background: #fff;
}

.kc-device-switch input:disabled + span {
  cursor: not-allowed;
  opacity: .42;
}

.kc-device-switch input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.kc-device-network-message {
  min-height: 16px;

  margin: 8px 0 0;

  font-size: 10.75px;
  font-weight: 400;

  color: var(--muted);
}

.kc-device-network-message.success {
  color: var(--success);
}

.kc-device-network-message.error {
  color: var(--danger, #dc2626);
}

.kc-device-network-actions {
  display: flex;
  justify-content: flex-end;

  padding-top: 4px;
}

#manage-device-network-save {
  min-height: 29px;
  padding: 5px 10px;

  font-size: 11px;
  font-weight: 500;
}

@media (max-width: 720px) {
  .kc-device-network-row {
    gap: 16px;
  }
}

#device-routing-controls select {
  display: block;
  width: 100%;
  max-width: 480px;
  padding: 10px 12px;
  margin: 8px 0 12px;
  border: 1px solid #dce5e0;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
}
#device-routing-report dt { font-weight: 600; margin-top: 14px; }
#device-routing-report dd { margin: 5px 0 14px; color: #52645c; overflow-wrap: anywhere; }
#device-exit-note { min-height: 1.5em; }
#device-lan-form { display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin:18px 0; }
#device-lan-form label {display:flex;flex-direction:column;gap:6px;}
#device-lan-form input,#device-lan-form select {max-width:100%;min-width:0;}
.device-lan-route-row {padding:14px 0;border-bottom:1px solid var(--border,#e5e7eb);overflow-wrap:anywhere;}
.device-lan-route-row button {margin:4px 8px 4px 0;}

/* R3: the active single-panel dialog has no Manage tab. */
#manage-device-dialog #manage-device-network[hidden] {display:block !important;}
#manage-device-dialog #device-access-options,
#manage-device-dialog #device-remote-actions,
#manage-device-dialog .kdm-access,
#manage-device-dialog .device-maintenance-grid,
#manage-device-dialog .kdm-stats,
#manage-device-network .kc-device-network-actions {display:none !important;}
#device-routing-controls details, #device-lan-controls details {margin:16px 0;}
#device-routing-controls summary, #device-lan-controls summary {cursor:pointer;}
#device-routing-controls .sharing-label {display:flex;align-items:center;justify-content:space-between;gap:16px;}
#device-routing-controls input[type=checkbox] {width:20px;height:20px;}
