.pwa-install-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(920px, calc(100% - 24px)); z-index: 10020;
  display: grid; grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center; gap: 18px; padding: 16px 18px;
  background: #fff; color: #1f2922; border: 1px solid #d9dfd9;
  border-radius: 18px; box-shadow: 0 18px 55px rgba(18, 35, 25, .24);
  font-family: system-ui, sans-serif;
}
.pwa-install-banner[hidden], .offline-modal[hidden] { display: none !important; }
.pwa-install-copy { display: flex; align-items: center; gap: 13px; }
.pwa-install-copy p { margin: 3px 0 0; color: #59645c; font-size: .88rem; }
.pwa-install-icon, .offline-modal-icon {
  display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px;
  border-radius: 13px; color: #fff; background: #315b43; font-size: 1.25rem;
}
.pwa-install-actions, .offline-modal-actions { display: flex; gap: 8px; align-items: center; }
.offline-button {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  min-height: 42px; padding: 9px 14px; border: 0; border-radius: 10px;
  font: 700 .9rem/1 system-ui, sans-serif; cursor: pointer; text-decoration: none;
}
.offline-button.primary { background: #237345; color: #fff; }
.offline-button.secondary { background: #e8f0ea; color: #28523a; }
.offline-button.ghost { background: transparent; color: #526158; }
.offline-button.danger { background: #f8e4e2; color: #9a352f; }
.offline-button:disabled { opacity: .55; cursor: progress; }
.offline-switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font: 650 .86rem/1.25 system-ui, sans-serif;
}
.offline-switch { position: relative; flex: 0 0 48px; width: 48px; height: 27px; }
.offline-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.offline-switch-slider {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: #b8bfba; transition: .2s;
}
.offline-switch-slider::after {
  content: ""; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: .2s;
}
.offline-switch input:checked + .offline-switch-slider { background: #237345; }
.offline-switch input:checked + .offline-switch-slider::after { transform: translateX(21px); }
.offline-floating-button {
  position: fixed; right: 18px; bottom: 18px; z-index: 9990;
  display: flex; align-items: center; gap: 10px; max-width: 245px;
  padding: 10px 14px 10px 10px; border: 0; border-radius: 999px;
  background: #244c35; color: #fff; box-shadow: 0 10px 28px rgba(20,45,29,.3);
  cursor: pointer; text-align: left; font-family: system-ui, sans-serif;
}
.offline-floating-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.16); }
.offline-floating-button strong, .offline-floating-button small { display: block; }
.offline-floating-button small { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .78; font-size: .67rem; margin-top: 2px; }
.offline-modal { position: fixed; inset: 0; z-index: 10030; font-family: system-ui, sans-serif; }
.offline-modal-backdrop { position: absolute; inset: 0; background: rgba(10,20,14,.6); backdrop-filter: blur(3px); }
.offline-modal-card {
  position: relative; width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 32px);
  overflow: auto; margin: 16px auto; padding: 24px; background: #fff; color: #202720;
  border-radius: 19px; box-shadow: 0 24px 80px rgba(0,0,0,.34);
}
.offline-modal-close { position: absolute; right: 12px; top: 8px; border: 0; background: transparent; font-size: 28px; color: #526158; cursor: pointer; }
.offline-modal-heading { display: flex; gap: 14px; padding-right: 28px; }
.offline-modal-heading h2 { margin: 2px 0 4px; font-size: 1.55rem; }
.offline-modal-heading p { margin: 0; color: #5f6861; line-height: 1.45; }
.offline-status-card { display: flex; align-items: center; gap: 10px; margin: 20px 0; padding: 13px; border-radius: 11px; background: #f3f6f3; }
.offline-status-card strong, .offline-status-card small { display: block; }
.offline-status-card small { color: #677068; margin-top: 3px; }
.offline-status-dot { width: 11px; height: 11px; border-radius: 50%; background: #9ba29c; }
.offline-status-card.is-ready .offline-status-dot { background: #2a9653; box-shadow: 0 0 0 5px rgba(42,150,83,.12); }
.offline-field { display: grid; gap: 7px; margin: 14px 0; font-weight: 700; font-size: .86rem; }
.offline-field select { width: 100%; padding: 11px; border: 1px solid #cbd2cc; border-radius: 9px; background: #fff; }
.modal-switch { margin: 17px 0; padding: 13px; border: 1px solid #e1e5e1; border-radius: 10px; }
#offlineManagerProgress { width: 100%; height: 10px; }
#offlineManagerMessage { min-height: 20px; margin: 8px 0 15px; color: #556159; font-size: .86rem; }
.offline-modal-actions { flex-wrap: wrap; }
body.offline-modal-open { overflow: hidden; }

@media (max-width: 760px) {
  .pwa-install-banner { grid-template-columns: 1fr; gap: 12px; bottom: 8px; }
  .pwa-install-actions { justify-content: flex-end; }
  .offline-floating-button { right: 10px; bottom: 10px; }
}
@media (max-width: 480px) {
  .offline-floating-button small { display: none; }
  .offline-modal-actions { display: grid; }
  .offline-modal-actions > * { width: 100%; }
}
