/* Official Apple badges stay intact; the surrounding interface carries the brand. */
html { scrollbar-gutter: stable; }
html.download-dialog-open { overflow: hidden; }
.app-store-badge { flex: 0 0 auto; }
.app-store-badge img { display: block; width: 100%; height: auto; }
.marketing-header .header-download {
  display: inline-flex;
  width: auto;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  line-height: 0;
}
.header-download img { width: auto; height: 44px; }
.mobile-app-access { display: none; }
.mobile-app-access[hidden] { display: none; }

.download-dialog {
  position: fixed;
  inset: 0;
  width: min(440px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  overflow: auto;
  padding: 36px 32px 26px;
  border: 1px solid #ebdfc9;
  border-radius: 28px;
  background: #fffcf6;
  color: #302316;
  box-shadow: 0 28px 100px #25170740;
  text-align: center;
}
.download-dialog::backdrop { background: #211a14a6; backdrop-filter: blur(8px); }
.download-dialog:not([open]) { display: none; }
.download-dialog[open] { animation: download-appear 180ms ease-out; }
.download-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 12px;
  border: 1px solid #ebdfc9;
  border-radius: 50%;
  background: #fff5df;
  cursor: pointer;
}
.download-close:hover { background: #ffedc4; }
.download-close svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.download-mark { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 16px; }
.download-dialog h2 { margin: 0 auto 12px; max-width: 13em; font-size: 1.85rem; line-height: 1.12; letter-spacing: -.04em; }
.download-dialog #download-dialog-description { max-width: 31ch; margin: 0 auto 20px; font-size: .96rem; line-height: 1.5; color: #71614f; }
.download-qr { display: block; width: 232px; max-width: 100%; height: auto; margin: 0 auto 22px; border: 1px solid #e8e0d3; border-radius: 12px; background: #fff; }
.download-dialog .download-direct { width: 160px; margin: 0 auto; }
.download-dialog .download-note { margin: 18px auto 0; max-width: 30ch; font-size: .72rem; line-height: 1.5; color: #71614f; }
.download-dialog :focus-visible { outline: 3px solid #a5440a; outline-offset: 4px; box-shadow: none; }

@keyframes download-appear { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .download-dialog[open] { animation: none; } }
@media (min-width: 761px) and (max-width: 1050px) {
  .marketing-nav a:nth-child(n+3) { display: none; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 68px; scroll-padding-bottom: 112px; }
  .marketing-header { min-height: 56px; height: 56px; padding: 0; gap: 12px; flex-wrap: nowrap; }
  .marketing-header::before { height: 56px; background: #fffcf6f5; }
  .marketing-header > .marketing-nav,
  .marketing-header > .language-switch,
  .marketing-header > .header-download { display: none; }
  .marketing-header .brand { font-size: .67rem; letter-spacing: .12em; }
  .mobile-menu { display: block; margin-left: auto; }
  .mobile-menu summary { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid #eadfcd; border-radius: 13px; background: #fff9eb; font-size: .82rem; font-weight: 850; cursor: pointer; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu summary span { font-size: 1rem; }
  .mobile-menu nav { position: absolute; top: 56px; right: 0; width: min(300px,calc(100vw - 28px)); padding: 10px; display: grid; border: 1px solid #eedfc2; border-radius: 18px; background: #fffdf7; box-shadow: 0 12px 32px #3322111c; }
  .mobile-menu nav a { min-height: 46px; padding: 12px 16px; display: flex; align-items: center; color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 800; border-radius: 10px; }
  .mobile-menu nav a:hover { background: #fff0c8; }
  .mobile-menu nav { max-height: calc(100dvh - 170px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
  .mobile-app-access {
    position: fixed;
    z-index: 110;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: block;
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 10px;
    border: 1px solid #eadfcd;
    border-radius: 19px;
    background: #fffcf6f5;
    box-shadow: 0 8px 32px #47311f30;
    backdrop-filter: blur(16px);
    transform: translateX(-50%);
  }
  .mobile-download { width: auto; }
  .mobile-download img { width: auto; height: 52px; }
  .marketing-footer { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
  .marketing-page .analytics-consent { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 190px); overflow: auto; }
}
@media (max-height: 580px) and (min-width: 761px) {
  .download-dialog { padding-block: 20px; }
  .download-mark { width: 44px; height: 44px; margin-bottom: 10px; border-radius: 11px; }
  .download-dialog h2 { font-size: 1.5rem; }
  .download-dialog #download-dialog-description { font-size: .86rem; margin-bottom: 12px; }
  .download-qr { width: 180px; margin-bottom: 14px; }
  .download-dialog .download-note { margin-top: 12px; }
}
