:root {
  --bg: #0e0e14;
  --surface: #1a1a22;
  --surface-2: #24242f;
  --text: #f2f1f6;
  --muted: #9997a6;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #6c5ce7;
  --accent-2: #00d4b8;
  --white: #ffffff;
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  /* `manipulation` still explicitly allows pinch-zoom — only omitting the
     zoom capability entirely blocks both pinch- and double-tap-zoom, while
     pan-x/pan-y keep normal scrolling working. Also: iOS Safari deliberately
     ignores `user-scalable=no` in the viewport meta tag (an Apple
     accessibility override), so this touch-action rule is the one that
     actually works there — the meta tag alone is not enough. */
  touch-action: pan-x pan-y;
}

/* The `hidden` attribute has the same specificity as any class-based
   `display` rule, so without this, a later `.foo { display: flex }` rule
   silently wins the cascade and `hidden` stops working on that element. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

/* --- App-launch boot splash (installed PWA only, once per session) ----- */

.launch-splash {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #1b1830 0%, var(--bg) 70%);
  opacity: 1;
  transition: opacity 0.35s ease;
}

.launch-splash.hide {
  opacity: 0;
  pointer-events: none;
}

.launch-splash-mark-row {
  display: flex;
  align-items: baseline;
}

.launch-splash-mark {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: scale(0.85);
  animation: launch-mark-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s forwards;
}

@keyframes launch-mark-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Starts at width:0 (nothing reserved, so "Vioo" alone reads as centered)
   and widens out to its measured natural width once JS sets --lens-width —
   the visual read is "Vioo" sliding left as "Lens" reveals beside it, even
   though "Vioo" itself never actually moves. */
.launch-splash-lens {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  opacity: 0;
  animation: launch-lens-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.65s forwards;
}

@keyframes launch-lens-in {
  to {
    width: var(--lens-width, 4.5rem);
    opacity: 1;
  }
}

.launch-splash-tagline {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.55em;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--muted);
}

.launch-splash-tagline span {
  opacity: 0;
  transform: translateY(8px);
  animation: launch-tagline-in 0.4s ease forwards;
}

.launch-splash-tagline span:nth-child(1) {
  animation-delay: 1.25s;
}

.launch-splash-tagline span:nth-child(2) {
  animation-delay: 1.5s;
}

.launch-splash-tagline span:nth-child(3) {
  animation-delay: 1.75s;
}

@keyframes launch-tagline-in {
  to {
    opacity: 1;
    transform: translateY(0);
    color: var(--white);
  }
}

.launch-splash-tagline span:last-child {
  animation-name: launch-tagline-in-accent;
}

@keyframes launch-tagline-in-accent {
  to {
    opacity: 1;
    transform: translateY(0);
    color: var(--accent-2);
  }
}

/* --- First-login welcome splash --------------------------------------- */

.welcome-splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #1b1830 0%, var(--bg) 70%);
  color: var(--white);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.welcome-splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.welcome-mark {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.welcome-mark.show {
  opacity: 1;
  transform: scale(1);
}

.welcome-tagline {
  margin-top: 1.75rem;
  display: flex;
  gap: 0.6em;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--muted);
}

.welcome-tagline span {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.welcome-tagline span.show {
  opacity: 1;
  transform: translateY(0);
  color: var(--white);
}

.welcome-tagline span:last-child.show {
  color: var(--accent-2);
}

.welcome-skip {
  position: absolute;
  bottom: 2.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.welcome-skip.show {
  opacity: 1;
}

/* --- Dashboard shell ---------------------------------------------------- */

.dashboard {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* On short pages (few albums, settings) this keeps the footer pinned to the
   bottom of the viewport instead of stranding it mid-page with a dead void
   underneath — while still scrolling normally once content grows past 100vh. */
#dashboard-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  /* Reuses the landing page's `hero-in` keyframes — replays automatically
     whenever this goes from `hidden` (display:none) back to visible. */
  animation: hero-in 0.35s ease;
}

#album-view {
  animation: hero-in 0.35s ease;
}

.page-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 2rem 0;
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent-2);
  animation: gallery-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

@keyframes gallery-spin {
  to {
    transform: rotate(360deg);
  }
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.dashboard-header .brand {
  font-weight: 800;
  font-size: 1.4rem;
  text-decoration: none;
}

.brand-lens {
  color: var(--accent-2);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dashboard-header a.logout,
.dashboard-header a.settings-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.dashboard-header a.logout:hover,
.dashboard-header a.settings-link:hover {
  color: var(--text);
  background: var(--surface);
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.back-link:hover {
  color: var(--text);
}

.settings-title {
  margin: 0 0 2rem;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 1.2rem;
}

.profile-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.profile-email {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.settings-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  color: var(--accent-2);
}

.settings-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.settings-status {
  margin: 0.9rem 0 0;
  color: var(--accent-2);
  font-size: 0.85rem;
  animation: hero-in 0.3s ease;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dashboard-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.4rem 1rem;
  border-radius: 16px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.dashboard-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dashboard-action-btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--white);
  box-shadow: 0 12px 30px rgba(108, 92, 231, 0.3);
}

.dashboard-action-btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.dashboard-action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.dashboard-action-btn.primary:hover:not(:disabled) {
  box-shadow: 0 16px 36px rgba(108, 92, 231, 0.4);
}

.dashboard-action-btn.secondary:hover:not(:disabled) {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.dashboard-action-btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* --- Album list --------------------------------------------------------- */

.album-list-section {
  margin-top: 2.5rem;
}

.album-list-section h2 {
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.album-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.album-card {
  position: relative;
  display: block;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  border-left: 4px solid;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: card-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.album-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.album-card:active {
  transform: scale(0.98);
}

.album-card-delete {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.album-card-delete:hover {
  color: #ff8a93;
  background: rgba(239, 110, 122, 0.15);
}

.album-card-delete:active {
  transform: scale(0.88);
}

.album-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 1.5rem; /* room for the delete icon on host cards */
}

.album-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.album-card-name {
  font-weight: 700;
}

.album-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

.album-card-photocount {
  color: var(--muted);
}

.status-pill-sm {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
}

.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Modals -------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
  /* Restarts automatically every time the element goes from `hidden` (display:
     none) back to visible, since a fresh mount replays CSS animations. */
  animation: modal-overlay-in 0.18s ease;
}

@keyframes modal-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal h2 {
  margin: 0;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.modal input[type='text'],
.modal input[type='datetime-local'] {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal input[type='text']:focus,
.modal input[type='datetime-local']:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(0, 212, 184, 0.18);
}

.modal-error {
  background: rgba(239, 110, 122, 0.15);
  color: #ff9aa2;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  animation: error-shake 0.35s ease;
}

@keyframes error-shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }
  40%,
  60% {
    transform: translateX(4px);
  }
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.12s ease;
}

.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.btn-danger:active:not(:disabled) {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--white);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  background: #e5484d;
  color: var(--white);
}

.btn-danger:hover {
  background: #c9393e;
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.danger-link {
  display: block;
  margin: 1.5rem auto 0;
  background: none;
  border: none;
  color: #ff8a93;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}

.danger-link:hover {
  text-decoration: underline;
}

.segmented {
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.segmented label {
  flex: 1;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.segmented label:active {
  transform: scale(0.96);
}

/* Native radio is kept for accessibility/keyboard support but visually
   replaced by the label's own checked-state background below. */
.segmented input[type='radio'] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.segmented label:has(input:checked) {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--white);
}

.theme-picker {
  display: flex;
  gap: 0.6rem;
}

.theme-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.15s ease;
}

.theme-swatch.selected {
  border-color: var(--white);
  transform: scale(1.12);
}

.theme-swatch:active {
  transform: scale(0.9);
}

/* --- Album view ----------------------------------------------------------- */

.album-hero {
  margin-bottom: 1.5rem;
}

.album-name-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.album-theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.album-hero h1 {
  margin: 0;
  font-size: 1.6rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pill.waiting {
  background: rgba(108, 92, 231, 0.14);
  color: #beb2fa;
  border-color: rgba(108, 92, 231, 0.35);
}

.status-pill.revealed {
  background: rgba(0, 212, 184, 0.14);
  color: var(--accent-2);
  border-color: rgba(0, 212, 184, 0.35);
}

.invite-code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.invite-code-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.invite-code-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.invite-code-card-row strong {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.invite-code-card-hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* --- Countdown card ------------------------------------------------------- */

.countdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.countdown-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.countdown-card-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.6rem;
}

.countdown-unit strong {
  font-size: 1.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.countdown-unit small {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

.countdown-sep {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--border);
  transform: translateY(-0.3rem);
}

.countdown-card-hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  flex: 0 0 auto;
}

.copy-btn:hover {
  background: var(--border);
}

.copy-btn:active {
  transform: scale(0.96);
}

.copy-btn.copied {
  background: rgba(0, 212, 184, 0.15);
  color: var(--accent-2);
  border-color: rgba(0, 212, 184, 0.35);
}

.album-stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.album-stats-card #photo-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.member-list {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.member-chip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.camera-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.15rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--white);
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(108, 92, 231, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.camera-cta:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(108, 92, 231, 0.4);
}

.camera-cta:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.camera-cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

#photo-count.pulse {
  animation: photo-count-pulse 0.4s ease;
}

@keyframes photo-count-pulse {
  0% {
    transform: scale(1);
    color: var(--accent);
  }
  50% {
    transform: scale(1.08);
    color: var(--accent);
  }
  100% {
    transform: scale(1);
    color: var(--text);
  }
}

.consensus-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.consensus-box p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Camera --------------------------------------------------------------- */

.camera-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Two-finger touches here drive the custom camera-zoom gesture (see
     album.js) — disable the browser's native pinch-zoom so it doesn't fight
     with that instead of just relying on the (disabled) page zoom. */
  touch-action: none;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#camera-video.mirrored {
  transform: scaleX(-1);
}

.camera-close {
  position: absolute;
  top: env(safe-area-inset-top, 1rem);
  right: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  z-index: 2;
}

.camera-flip {
  position: absolute;
  /* Sits beside the shutter instead of a top corner — vertically centered
     against it (shutter is 82px tall vs. this button's 42px, hence the extra
     +20px) and offset far enough right to clear the shutter's own radius. */
  bottom: calc(env(safe-area-inset-bottom, 0px) + 2.5rem + 20px);
  left: calc(50% + 61px);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease;
  z-index: 2;
}

.camera-flip:active {
  transform: scale(0.9) rotate(180deg);
}

.camera-shutter {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 2.5rem);
  left: 50%;
  transform: translateX(-50%);
  width: 82px;
  height: 82px;
  border-radius: 50%;
  padding: 5px;
  background: transparent;
  border: 3.5px solid rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.camera-shutter::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), background 0.12s ease;
}

.camera-shutter:active {
  transform: translateX(-50%) scale(0.96);
  border-color: var(--accent-2);
}

.camera-shutter:active::before {
  transform: scale(0.8);
  background: var(--accent-2);
}

.camera-error {
  position: absolute;
  bottom: 6rem;
  left: 1.5rem;
  right: 1.5rem;
  background: rgba(239, 110, 122, 0.9);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  text-align: center;
  z-index: 3;
  animation: error-shake 0.35s ease;
}

/* Only shown when the device/browser actually exposes hardware zoom control
   (mainly Android Chrome) — hidden entirely elsewhere, incl. all of iOS. */
.camera-zoom {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  z-index: 2;
}

.camera-zoom-label {
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.camera-zoom input[type='range'] {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 6px;
  height: 150px;
  accent-color: var(--accent-2);
  cursor: pointer;
}

.camera-preview {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  animation: camera-preview-in 0.25s ease;
}

@keyframes camera-preview-in {
  from {
    opacity: 0;
    transform: scale(1.03);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.camera-preview img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.camera-preview-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.camera-preview-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Covers the whole preview (image + Retake/Save row) so the upload can't be
   interrupted mid-flight, and keeps the screen visibly busy instead of
   looking stuck during the ~1-2s JPEG encode + upload on this hardware. */
.camera-saving-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 16px;
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.camera-saving-overlay.show {
  opacity: 1;
}

.spinner-lg {
  width: 38px;
  height: 38px;
  border-width: 3.5px;
}

.camera-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.camera-flash.flash {
  animation: camera-flash-pop 0.28s ease;
}

@keyframes camera-flash-pop {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
  }
}

.camera-saved-flash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  font-size: 1.8rem;
  font-weight: 700;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.camera-saved-flash.show {
  opacity: 1;
}

/* --- Join-success flash -------------------------------------------------- */

.join-success-flash {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(14, 14, 20, 0.94);
  color: var(--white);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.join-success-flash.show {
  opacity: 1;
}

.join-success-check {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(108, 92, 231, 0.4);
}

.join-success-flash.show .join-success-check {
  animation: join-check-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes join-check-pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.join-success-text {
  font-size: 1.3rem;
  font-weight: 800;
}

/* --- Reveal intro ----------------------------------------------------- */

.reveal-intro {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #1b1830 0%, var(--bg) 70%);
  color: var(--white);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.reveal-intro.show {
  opacity: 1;
}

.reveal-intro.hide {
  opacity: 0;
}

.reveal-intro-mark {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: reveal-pop 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-intro-name {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.1rem;
}

@keyframes reveal-pop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Gallery (full-screen viewing mode) ---------------------------------- */

.gallery-fullscreen {
  position: relative;
  min-height: 100vh;
  /* --gallery-tint-* set inline per-album (see showGallery in album.js) —
     a subtle top-down wash of the album's own theme colors instead of a
     flat dark background, kept dark enough that photos stay the focus. */
  background: radial-gradient(
      circle at 50% 0%,
      color-mix(in srgb, var(--gallery-tint-primary, #6c5ce7) 16%, var(--bg)) 0%,
      var(--bg) 65%
    );
  display: flex;
  flex-direction: column;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem max(1.5rem, env(safe-area-inset-bottom));
}

.gallery-loading-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: radial-gradient(circle at 50% 45%, #1b1830 0%, var(--bg) 70%);
  opacity: 1;
  transition: opacity 0.4s ease;
}

.gallery-loading-screen.hide {
  opacity: 0;
}

.loading-ring-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  animation: loading-ring-pulse 2.2s ease-in-out infinite, loading-ring-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes loading-ring-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes loading-ring-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

.loading-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.loading-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.loading-ring-progress {
  fill: none;
  stroke: url(#loading-ring-gradient);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 276.5;
  stroke-dashoffset: 276.5;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-ring-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gallery-loading-text {
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 1.3em;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.gallery-loading-text.fade {
  opacity: 0;
}

.gallery-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.25rem auto 0;
}

.gallery-more-wrap {
  position: relative;
}

.gallery-more-menu {
  position: absolute;
  bottom: calc(100% + 0.6rem);
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  animation: gallery-more-menu-in 0.15s ease;
}

@keyframes gallery-more-menu-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-more-menu-item {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.gallery-more-menu-item:hover {
  background: var(--surface);
}

.gallery-more-menu-item.danger {
  color: #ff8a93;
}

.exit-fullscreen-btn {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: 1rem;
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

/* Immersive mode: header/position/download chrome hidden, nav arrows
   overlaid directly on the photo instead of beside it, image maximized. */
#gallery-view.immersive .gallery-fullscreen-header,
#gallery-view.immersive .gallery-dots,
#gallery-view.immersive .gallery-actions,
#gallery-view.immersive .auto-delete-notice {
  display: none;
}

#gallery-view.immersive .gallery-nav {
  position: relative;
}

#gallery-view.immersive .gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}

#gallery-view.immersive #gallery-prev {
  left: 0.75rem;
}

#gallery-view.immersive #gallery-next {
  right: 0.75rem;
}

#gallery-view.immersive .photo-card {
  max-width: 100%;
}

#gallery-view.immersive .photo-card-frame img {
  height: min(88vh, 1000px);
}

#gallery-view.immersive.gallery-fullscreen {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.gallery-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  width: 100%;
  margin: 0 auto 2rem;
}

.gallery-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.gallery-back:hover {
  color: var(--text);
}

.gallery-fullscreen-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}

.gallery-nav-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-cards {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Direction-aware: advancing ("next") exits left and enters from the right;
   going back ("prev") does the mirror image — so the motion reads as a real
   photo-viewer strip rather than a generic fade. */
.gallery-cards.swap-out-next {
  opacity: 0;
  transform: translateX(-32px);
}

.gallery-cards.swap-out-prev {
  opacity: 0;
  transform: translateX(32px);
}

.gallery-cards.swap-in-next {
  animation: gallery-card-in-next 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-cards.swap-in-prev {
  animation: gallery-card-in-prev 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes gallery-card-in-next {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gallery-card-in-prev {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.photo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 420px;
  /* flex (not width:100%) so a single card still fills the row, but two
     cards in "two at a time" mode split it evenly instead of each demanding
     full width — which used to force them into a broken vertical stack on
     mobile via a flex-direction:column fallback below 480px. min-width:0
     lets them actually shrink below their content's intrinsic size. */
  flex: 1 1 0;
  min-width: 0;
}

@media (min-width: 700px) {
  .photo-card {
    max-width: 520px;
  }
}

.photo-card-frame {
  position: relative;
  width: 100%;
  padding: 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--card-primary, #6c5ce7), var(--card-secondary, #00d4b8));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.photo-card-attribution {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem 0.3rem 0.3rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.photo-card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.photo-card-author-name {
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.photo-card-frame img {
  display: block;
  width: 100%;
  /* A fixed box + object-fit:contain shows the whole photo, letterboxed —
     `cover` would crop portrait photos (the common case) to fit a fixed box. */
  height: min(62vh, 520px);
  object-fit: contain;
  border-radius: 14px;
  background: #000;
}

.photo-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.75rem;
}

.photo-card-time {
  font-size: 0.85rem;
  color: var(--muted);
  /* In "two at a time" mode each card is much narrower — this keeps the
     timestamp as one wrapping unit that drops to its own line, instead of
     breaking mid-phrase into a stack of one-or-two-word fragments. */
  white-space: nowrap;
}

.photo-card-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.92);
}

.gallery-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 0.5rem;
  margin-top: 1rem;
  max-height: 4rem;
  overflow-y: auto;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.15s ease, background 0.15s ease, width 0.15s ease;
}

.gallery-dot:hover {
  background: var(--muted);
}

.gallery-dot.active {
  width: 20px;
  border-radius: 4px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.auto-delete-notice {
  text-align: center;
  color: #e0b34d;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 1rem 0 0;
}

.download-all-box {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.download-all-box a {
  text-decoration: none;
  text-align: center;
}

/* --- Landing page -------------------------------------------------------- */

.landing {
  overflow-x: hidden;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}

.landing-nav .brand {
  font-weight: 800;
  font-size: 1.3rem;
}

.hero {
  margin-top: 1.5rem;
  padding: 5rem 1.5rem 6rem;
  text-align: center;
  background: radial-gradient(circle at 50% 20%, #211d3a 0%, #0a0a0d 75%);
  color: var(--white);
  border-radius: 0 0 32px 32px;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--accent-2);
  font-weight: 700;
  margin: 0 0 1rem;
  animation: hero-in 0.6s ease both;
}

.hero-tagline {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 780px;
  margin: 0 auto 1.25rem;
  animation: hero-in 0.6s ease 0.1s both;
}

.hero-tagline span {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 560px;
  margin: 0 auto 2.25rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
  line-height: 1.6;
  animation: hero-in 0.6s ease 0.2s both;
}

.btn-large {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1.05rem;
  border-radius: 14px;
  animation: hero-in 0.6s ease 0.3s both;
  box-shadow: 0 12px 30px rgba(108, 92, 231, 0.35);
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.how-it-works,
.install-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  text-align: center;
}

.how-it-works h2,
.install-section h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.install-sub {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
  text-align: left;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--white);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}

.step p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.install-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
  text-align: left;
}

.install-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.install-card h3 {
  font-size: 1rem;
  margin: 0 0 0.9rem;
}

.install-card ol {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.landing-footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.landing-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.landing-footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.landing-footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.landing-footer-links .dot {
  opacity: 0.5;
}

/* --- App footer (dashboard / settings) ----------------------------------- */

.footer-spacer {
  flex: 1;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  flex-wrap: wrap;
}

.app-footer a {
  color: var(--muted);
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.app-footer .dot {
  opacity: 0.5;
}

/* --- Legal pages (privacy / terms) --------------------------------------- */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.legal-page .back-link {
  display: inline-block;
  margin-bottom: 2rem;
}

.legal-page h1 {
  font-size: 2rem;
  margin: 0 0 0.4rem;
}

.legal-page .legal-updated {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 2.5rem;
}

.legal-page h2 {
  font-size: 1.2rem;
  margin: 2.2rem 0 0.75rem;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.96rem;
}

.legal-page ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0 1rem;
}

.legal-page li {
  margin-bottom: 0.4rem;
}

.legal-page strong {
  color: var(--text);
}

.legal-page a {
  color: var(--accent-2);
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr 1fr;
  }
  .install-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .download-all-box {
    flex-direction: column;
  }
  .welcome-mark {
    font-size: 2.6rem;
  }
  .welcome-tagline {
    font-size: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    padding: 0 1.5rem;
  }
  .dashboard-actions {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 3.5rem 1.25rem 4rem;
    border-radius: 0 0 24px 24px;
  }
  .steps {
    grid-template-columns: 1fr;
  }
}
