:root { --koudmen-tools-height: 0px; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.pwa-tools-visible { padding-bottom: calc(var(--koudmen-tools-height) + 20px); }
body.pwa-tools-visible .toast { bottom: calc(var(--koudmen-tools-height) + 14px); }
#mobile-app-tools { color: #233e34; }
#mobile-app-tools [hidden] { display: none !important; }
.pwa-dock {
  position: fixed;
  z-index: 45;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px max(18px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.pwa-install-card, .pwa-network { pointer-events: auto; max-width: 900px; margin: 0 auto; }
.pwa-install-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fffefa;
  border: 1px solid #c8d1c0;
  border-radius: 16px;
  box-shadow: 0 8px 32px #173f351f;
}
.pwa-brand-mark {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #173f35;
  color: #fffefa;
  display: grid;
  place-items: center;
  font: 32px/1 Georgia, serif;
  padding-bottom: 4px;
}
.pwa-install-copy { flex: 1 1 auto; min-width: 0; }
.pwa-install-copy strong { display: block; font-size: 14px; line-height: 1.5; font-weight: 650; }
.pwa-install-copy p { font-size: 12px; line-height: 1.6; color: #56644e; margin: 2px 0 0; }
.pwa-button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  cursor: pointer;
}
.pwa-primary { color: #fffefa; background: #173f35; }
.pwa-primary:hover:not(:disabled) { background: #245344; }
.pwa-button:disabled { opacity: .6; cursor: wait; }
.pwa-network {
  background: #fbefdf;
  border: 1px solid #d8bd94;
  color: #72501d;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.6;
}
.pwa-network:last-child { margin-bottom: 0; }
.pwa-dialog {
  width: min(540px, calc(100vw - 32px));
  max-width: 540px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #d6dbce;
  border-radius: 20px;
  background: #fffefa;
  color: #233e34;
  padding: 22px 26px 26px;
}
.pwa-dialog::backdrop { background: #173f3570; backdrop-filter: blur(3px); }
.pwa-dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pwa-kicker { font-size: 11px; line-height: 1.7; font-weight: 650; text-transform: uppercase; letter-spacing: 1.1px; color: #69746b; }
.pwa-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid #dddcd1;
  border-radius: 50%;
  background: #f6f3eb;
  color: #233e34;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.pwa-dialog h2 { font-family: Georgia, serif; font-size: 30px; line-height: 1.2; font-weight: 400; margin: 0 0 18px; }
.pwa-platforms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 17px; }
.pwa-platforms button {
  min-height: 44px;
  flex: 1 1 auto;
  border: 1px solid #d8ddcf;
  border-radius: 8px;
  padding: 9px 11px;
  background: #f6f3eb;
  color: #465442;
  font-size: 13px;
  font-weight: 600;
}
.pwa-platforms button[aria-pressed="true"] { background: #173f35; border-color: #173f35; color: #fffefa; }
.pwa-dialog .pwa-guide-intro { font-size: 14px; line-height: 1.7; color: #56644e; margin: 0 0 20px; }
.pwa-steps { list-style: none; counter-reset: install-step; display: grid; gap: 20px; padding: 0; margin: 0 0 20px; }
.pwa-steps li { counter-increment: install-step; position: relative; padding-left: 40px; }
.pwa-steps li::before { content: counter(install-step); position: absolute; left: 0; top: -2px; width: 27px; height: 27px; border: 1px solid #b7c4ad; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; color: #465442; }
.pwa-steps strong { font-size: 14px; line-height: 1.6; display: block; font-weight: 650; }
.pwa-dialog .pwa-steps p { font-size: 14px; line-height: 1.7; color: #56644e; margin: 4px 0 0; }
.pwa-dialog .pwa-guide-note { padding: 13px 15px; border-radius: 10px; background: #edf0e5; color: #4b5d40; font-size: 13px; line-height: 1.7; margin: 0 0 15px; }
.pwa-dialog .pwa-local-note { font-size: 12px; line-height: 1.7; color: #69746b; margin: 0; }
.pwa-dialog .pwa-local-note + .pwa-local-note { margin-top: 9px; }
.pwa-dialog-actions { display: flex; justify-content: flex-end; margin-top: 21px; }
.pwa-sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; padding: 0; }
#mobile-app-tools button:focus-visible { outline: 3px solid #c16b46; outline-offset: 3px; }
@media(max-width: 600px) {
  .pwa-dock { padding-top: 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .pwa-install-card { flex-wrap: wrap; gap: 8px 11px; padding: 12px; border-radius: 13px; }
  .pwa-brand-mark { width: 35px; height: 35px; flex-basis: 35px; font-size: 28px; border-radius: 10px; }
  .pwa-install-copy { flex-basis: calc(100% - 46px); }
  .pwa-install-copy strong { font-size: 13px; }
  .pwa-install-copy p { font-size: 12px; line-height: 1.5; }
  .pwa-install-card > .pwa-button { width: 100%; min-height: 44px; padding: 9px 13px; }
  .pwa-dialog { padding: 17px 19px 21px; }
  .pwa-dialog h2 { font-size: 27px; }
  .pwa-dialog-actions .pwa-button { width: 100%; }
  .pwa-platforms button { font-size: 12px; padding-left: 8px; padding-right: 8px; }
  .pwa-network { font-size: 12px; padding: 11px 13px; }
}
@media(max-height: 500px) and (min-width: 601px) {
  .pwa-install-card { padding: 9px 13px; }
  .pwa-install-copy p { display: none; }
}
@media(prefers-reduced-motion: reduce) { .pwa-dock, .pwa-dialog { scroll-behavior: auto; } }
