.device-network-bar {
  position: absolute;
  z-index: 72;
  top: 116px;
  left: 0;
  right: 0;
  display: none;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
}

.device-network-bar.show {
  display: flex;
}

.device-network-bar.offline,
.device-network-bar.error {
  background: #b42318;
}

.device-network-bar.pending {
  background: #805b00;
}

.device-network-bar.synced {
  background: #007a5e;
}

.device-network-bar button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.device-lock-button {
  font-size: 15px;
  line-height: 1;
}

.device-modal-backdrop,
.device-lock-screen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(0, 20, 16, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.device-lock-screen {
  z-index: 30000;
  background:
    radial-gradient(circle at 50% 16%, rgba(20, 216, 168, 0.34), transparent 28%),
    linear-gradient(145deg, rgba(2, 8, 6, 0.97), rgba(0, 83, 67, 0.97));
}

.device-settings-modal,
.device-passcode-modal,
.device-lock-card {
  position: relative;
  width: min(100%, 760px);
  max-height: min(900px, calc(100vh - 28px));
  overflow: auto;
  overflow-x: hidden;
  border: 1px solid #a9e4d7;
  border-radius: 20px;
  background: #f7fffc;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.device-passcode-modal,
.device-lock-card {
  width: min(100%, 410px);
  padding: 26px 20px 22px;
}

.device-settings-head {
  padding: 24px 24px 18px;
  border-bottom: 1px solid #d2eee7;
  background:
    radial-gradient(circle at 94% 12%, rgba(31, 212, 168, 0.22), transparent 34%),
    linear-gradient(145deg, #ffffff, #ebfff9);
}

.device-settings-head span,
.device-lock-card > span {
  color: #00765d;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.09em;
}

.device-settings-head h2,
.device-passcode-modal h2,
.device-lock-card h2 {
  margin: 5px 0 7px;
  color: #073c31;
  font-size: 25px;
}

.device-settings-head p,
.device-passcode-modal > p,
.device-lock-card > p {
  margin: 0;
  color: #527068;
  line-height: 1.45;
}

.device-modal-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  border: 1px solid #b9dfd5;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #075c49;
  font-weight: 850;
  cursor: pointer;
}

.device-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 14px 0;
}

.device-setting-card {
  margin: 0;
  padding: 16px;
  border: 1px solid #c8e8e0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 84, 68, 0.07);
}

.device-setting-card.full {
  margin: 12px 14px 0;
}

.device-setting-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}

.device-setting-title > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  background: #e5faf4;
  font-size: 21px;
}

.device-setting-title h3 {
  margin: 0 0 3px;
  color: #123f35;
  font-size: 16px;
}

.device-setting-title p {
  margin: 0;
  color: #698078;
  font-size: 12px;
}

.device-status-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  margin-bottom: 12px;
  padding: 11px;
  border-radius: 10px;
  background: #f3fbf8;
  color: #4a655e;
  font-size: 12px;
}

.device-status-list b {
  color: #075c49;
  text-align: right;
}

.device-field {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: #294c43;
  font-size: 12px;
  font-weight: 800;
}

.device-field input,
.device-field select,
.device-lock-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #b9ddd4;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #102e27;
  font: inherit;
}

.device-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: #294c43;
  font-size: 13px;
  font-weight: 750;
}

.device-check input {
  width: 18px;
  height: 18px;
  accent-color: #008e70;
}

.device-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.device-btn {
  min-height: 42px;
  border: 1px solid #b2ddd2;
  border-radius: 10px;
  padding: 9px 13px;
  background: #f7fffc;
  color: #173f35;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.device-btn.primary {
  border-color: #008d70;
  background: linear-gradient(135deg, #006b55, #00a987);
  color: #fff;
}

.device-btn.biometric {
  border-color: #3978a9;
  background: linear-gradient(135deg, #245d8a, #318fc1);
  color: #fff;
}

.device-btn.danger {
  border-color: #e0aaa4;
  background: #fff3f1;
  color: #a92619;
}

.device-btn.full {
  width: 100%;
}

.device-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.device-note {
  margin: 11px 0 0;
  color: #637a73;
  font-size: 11px;
  line-height: 1.45;
}

.device-reminder-list {
  display: grid;
  gap: 7px;
}

.device-reminder-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d8eee8;
  border-radius: 10px;
  background: #f9fffd;
}

.device-reminder-row span {
  color: #00745c;
  font-size: 12px;
  font-weight: 900;
}

.device-reminder-row small {
  display: block;
  margin-top: 2px;
  color: #6a837c;
  font-weight: 600;
}

.device-reminder-row b {
  overflow-wrap: anywhere;
  color: #173f35;
  font-size: 13px;
}

.device-empty {
  padding: 14px;
  border: 1px dashed #b8ddd4;
  border-radius: 10px;
  color: #667e77;
  text-align: center;
}

.device-settings-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding: 13px 14px;
  border-top: 1px solid #cce9e2;
  background: rgba(247, 255, 252, 0.96);
  backdrop-filter: blur(8px);
}

.device-passcode-modal form,
.device-lock-card form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.device-passcode-modal .device-modal-close {
  position: static;
  float: right;
  margin: -12px -6px 8px 12px;
}

.device-form-error {
  min-height: 20px;
  color: #b42318;
  font-size: 12px;
  font-weight: 750;
}

.device-lock-card {
  overflow: visible;
  text-align: center;
}

.device-lock-card > img {
  width: 82px;
  height: 82px;
  margin: -66px auto 14px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background: #020806;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

.device-lock-card input {
  min-height: 56px;
  text-align: center;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.device-lock-card small {
  display: block;
  margin-top: 14px;
  color: #6f837e;
}

body.device-app-locked > :not(#deviceLockRoot) {
  pointer-events: none !important;
  user-select: none !important;
}

body.web-layout .device-network-bar {
  position: fixed;
  top: 44px;
  left: 240px;
}

@media (max-width: 760px) {
  .device-modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .device-settings-modal {
    width: 100%;
    max-height: calc(100vh - max(8px, env(safe-area-inset-top)));
    border-radius: 20px 20px 0 0;
  }

  .device-settings-head {
    padding: 22px 18px 15px;
  }

  .device-settings-head h2 {
    font-size: 21px;
  }

  .device-settings-head p {
    padding-right: 54px;
    font-size: 12px;
  }

  .device-settings-grid {
    grid-template-columns: 1fr;
  }

  .device-button-row .device-btn {
    flex: 1 1 135px;
  }

  .device-settings-footer .device-btn {
    flex: 1;
  }

  .device-reminder-row {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  body.web-layout .device-network-bar {
    left: 0;
  }
}

@media (display-mode: standalone) {
  .device-network-bar {
    top: 58px;
  }
}
