/* Installation is an explicit action in Safari, never an automatic prompt. */
html:not(.ios-browser) [data-webapp-help]{display:none!important}
.fullscreen-browser-help{position:absolute;z-index:9;left:max(12px,env(safe-area-inset-left));top:max(10px,env(safe-area-inset-top));min-height:44px;padding:6px 10px;border-radius:5px;background:#14171ae8;color:white;font-size:11px}
.cinema-stage:not(.is-fullscreen) .fullscreen-browser-help,.controls-hidden .fullscreen-browser-help{display:none}
.safari-swipe-hint{
  position:absolute;top:calc(max(10px,env(safe-area-inset-top)) + 44px + 8px);left:50%;transform:translateX(-50%);z-index:10;
  width:min(420px,calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height:calc(100% - max(10px,env(safe-area-inset-top)) - 44px - 8px - 12px - env(safe-area-inset-bottom));overflow:auto;
  padding:16px;border:1px solid var(--line);border-radius:var(--radius);background:#1c1d22f5;color:var(--text);
  text-align:left;pointer-events:auto;overscroll-behavior:contain;font-size:13px;line-height:1.45;
}
.safari-swipe-hint[hidden]{display:none}
.safari-swipe-hint h2{font-size:18px;line-height:1.3;margin:0 0 6px;text-wrap:initial}
.safari-hint-heading{display:flex;align-items:flex-start;gap:8px;margin-bottom:4px}
.safari-hint-heading h2{flex:1;margin:0;padding-top:6px}
.safari-hint-heading .safari-hint-close{width:44px;height:44px;min-width:44px;min-height:44px;margin:-4px -4px 0 0}
.safari-hint-close svg{width:20px;height:20px}
.safari-swipe-hint p{font-size:12px;line-height:1.45}
.safari-hint-intro,.safari-hint-fallback{color:var(--muted)}
.safari-hint-steps{display:grid;gap:8px;margin:12px 0 8px;padding-left:21px}
.safari-hint-steps li{padding-left:3px}
.safari-hint-steps li::marker{color:var(--text);font-weight:800}
.safari-menu-symbol{width:19px;height:19px;vertical-align:-4px;display:inline-block}
.safari-menu-legacy{white-space:nowrap;color:var(--muted);font-size:.92em}
.safari-hint-actions,.webapp-help-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.safari-hint-actions .button,.webapp-help-actions .button{min-height:44px;padding:8px 12px;font-size:12px;white-space:normal;line-height:1.35}
.safari-hint-actions .button:first-child,.webapp-help-actions .button:first-child{flex:1}
.safari-hint-actions .button:last-child,.webapp-help-actions .button:last-child{flex:2}
.webapp-help-alternative{margin-top:14px;font-size:12px;color:var(--muted)}
.webapp-help-alternative summary{cursor:pointer;min-height:44px;display:list-item;padding-top:8px}
.webapp-help-alternative p{font-size:12px;margin-top:8px}

dialog.webapp-help{
  position:fixed;inset:0;margin:auto;
  width:min(440px,calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-width:none;max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding:24px;border:1px solid var(--line);border-radius:var(--radius);
  background:var(--panel);color:var(--text);overflow:auto;overscroll-behavior:contain;
  text-align:left;font-size:14px;line-height:1.6;
}
dialog.webapp-help::backdrop{background:#000b}
.webapp-help-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.webapp-help-heading h2{font-size:22px;line-height:1.25;padding-top:6px}
.webapp-help-heading .icon-button{margin:-4px -8px 0 0;min-width:44px;min-height:44px}
.webapp-help p{font-size:14px;line-height:1.6;color:var(--muted)}
.webapp-help-steps{margin:18px 0;padding-left:24px}
.webapp-help-steps li{padding-left:4px;margin:10px 0}
.webapp-help-steps li::marker{color:var(--accent);font-weight:800}
.webapp-help-steps strong{font-weight:700}
.webapp-help .webapp-help-launch{color:var(--text)}
.webapp-help .webapp-help-fallback{font-size:12px;margin-bottom:12px}
@media(max-height:500px){
  .safari-swipe-hint{padding:12px 16px}
  .safari-swipe-hint h2{font-size:17px;margin-bottom:4px}
  .safari-hint-steps{gap:5px;margin-top:8px;margin-bottom:6px}
  .safari-hint-actions{margin-top:10px}
  dialog.webapp-help{padding:16px 20px;max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
  .webapp-help-heading{margin-bottom:6px}
  .webapp-help-heading h2{font-size:20px}
  .webapp-help-steps{margin:10px 0}
  .webapp-help-steps li{margin:6px 0}
  .webapp-help-actions{margin-top:12px}
}
/* The standalone status bar overlays the page; fullscreen controls own their insets. */
@media(display-mode:standalone),(display-mode:fullscreen){
  body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
}
