/* Shared mobile-first responsive layout */
.container {
  width: min(100% - 1.25rem, var(--max, 72rem));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .container { width: min(100% - 2rem, var(--max, 72rem)); }
}

/* ─── Landing header ─── */
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
}

.nav__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--btn-ghost-bg);
  cursor: pointer;
  flex-shrink: 0;
}

.nav__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

.nav--open .nav__toggle-bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav--open .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav--open .nav__toggle-bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.nav__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 0.75rem 0 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

.nav__menu.is-open { display: block; }

.nav__menu .nav__links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  list-style: none;
  margin-bottom: 0.85rem;
}

.nav__menu .nav__links a {
  display: block;
  padding: 0.75rem 0.25rem;
  font-size: 0.95rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.nav__menu .nav__cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
}

.nav__menu .nav__cta .btn,
.nav__menu .nav__cta .theme-switch {
  width: 100%;
  justify-content: center;
}

.nav__menu .theme-switch { justify-content: center; }

.nav { position: sticky; top: 0; z-index: 100; }

.nav .container.nav__inner { position: relative; }

@media (min-width: 768px) {
  .nav__toggle { display: none; }

  .nav__menu {
    display: flex !important;
    position: static;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .nav__menu .nav__links {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0;
  }

  .nav__menu .nav__links a {
    padding: 0;
    border: none;
  }

  .nav__menu .nav__cta {
    flex-direction: row;
    align-items: center;
    width: auto;
  }

  .nav__menu .nav__cta .btn,
  .nav__menu .nav__cta .theme-switch {
    width: auto;
  }
}

@media (max-width: 767px) {
  .brand__text span { display: none; }

  .nav__cta-desktop-only { display: none !important; }

  .hero { padding: 2rem 0 3rem; }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn { width: 100%; }

  .hero__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .hero__stat { width: 100%; }

  .hero__waves { height: 90px; }

  section { padding: 2.5rem 0; }

  .download-card {
    padding: 1.35rem 1rem;
    border-radius: 1.15rem;
  }

  .download-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .download-card__actions .btn { width: 100%; }

  .download-card__specs {
    padding: 0.85rem;
    font-size: 0.78rem;
  }

  .offline-banner { padding: 2.5rem 0; }

  .footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .preview { margin-top: 0.5rem; }
}

@media (max-width: 380px) {
  .container { width: min(100% - 0.85rem, var(--max, 72rem)); }

  .brand__mark {
    width: 2.15rem;
    height: 2.15rem;
  }

  .brand__text strong { font-size: 0.95rem; }
}

body.site-nav-open { overflow: hidden; }

/* ─── Dashboard header ─── */
.dash-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0;
  flex-wrap: nowrap;
}

.dash-header__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--btn-ghost-bg);
  cursor: pointer;
  flex-shrink: 0;
}

.dash-header__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

.dash-header--open .dash-header__toggle-bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.dash-header--open .dash-header__toggle-bar:nth-child(2) { opacity: 0; }
.dash-header--open .dash-header__toggle-bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.dash-header__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 0.75rem 0 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

.dash-header__menu.is-open { display: block; }

.dash-header__menu .dash-header__nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  list-style: none;
  margin-bottom: 0.85rem;
}

.dash-header__menu .dash-header__nav a {
  display: block;
  padding: 0.75rem 0.25rem;
  font-size: 0.95rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.dash-header__menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dash-header__menu-actions .theme-switch,
.dash-header__menu-actions .btn {
  width: 100%;
  justify-content: center;
}

.dash-header { position: sticky; top: 0; z-index: 50; }

.dash-header .container.dash-header__inner { position: relative; }

.dash-header__actions--bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .dash-header__toggle { display: none; }

  .dash-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
  }

  .dash-header__menu {
    display: flex !important;
    justify-content: center;
    position: static;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    grid-column: 2;
  }

  .dash-header__menu .dash-header__nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0;
  }

  .dash-header__menu .dash-header__nav a {
    padding: 0;
    border: none;
  }

  .dash-header__menu-actions { display: none !important; }

  .dash-header__actions--bar {
    grid-column: 3;
    justify-self: end;
  }

  .dash-header__actions--bar .theme-switch { display: inline-flex; }
}

@media (max-width: 767px) {
  .dash-header__inner > .dash-header__actions--bar .theme-switch,
  .dash-header__inner > .dash-header__actions--bar #dl-shortcut {
    display: none;
  }

  .dash-header__actions--bar #logout-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
  }

  .dash-main { padding: 1rem 0 2rem; }

  .dash-hero {
    padding: 1rem;
    border-radius: 1rem;
  }

  .dash-hero__title { font-size: 1.15rem; }

  .dash-hero__top {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-hero__badges { gap: 0.35rem; }

  .dash-badge { font-size: 0.68rem; }

  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }

  .dash-stat { padding: 0.75rem 0.65rem; }

  .dash-stat__value { font-size: 1.25rem; }

  .dash-panel__head,
  .dash-panel__body { padding-inline: 0.85rem; }

  .dash-grid { gap: 0.85rem; }

  .dash-header__inner .brand__text span { display: none; }
}

@media (max-width: 480px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }

  .dash-list__item {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-sync {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 767px) {
  .auth-theme-bar {
    top: max(0.5rem, env(safe-area-inset-top));
    left: max(0.5rem, env(safe-area-inset-left));
  }

  .login-form-inner {
    padding-top: 2.75rem;
  }
}
