/* ---------- App installieren (PWA): Kopf-Button + Hilfe-Dialog ----------
   Logik in /js/pwa.js. Basis-Optik des Dialogs kommt von dialog.modal (style.css). */

/* [hidden] muss immer gewinnen (Button und Hilfe-Abschnitte werden per JS ein-/ausgeblendet) */
.pwa-install[hidden],
.pwa-help [data-pwa-help][hidden] { display: none !important; }

/* Kopf-Button: dezent, Gold-Akzent bei Hover/Fokus. Desktop: ganz rechts im Kopf */
.pwa-install {
  order: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--gold-line);
  border-radius: 6px;
  background: transparent;
  color: var(--gold);
  font: 600 .84rem/1.2 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.pwa-install svg { flex-shrink: 0; }
.pwa-install:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-hover);
}
.pwa-install:active { transform: translateY(1px); }
.pwa-install:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--gold); }

/* Schmal: nur Icon, zwischen Logo und Burger */
@media (max-width: 900px) {
  .pwa-install {
    order: 0;
    margin-left: auto;
    margin-right: 8px;
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }
  .pwa-install svg { width: 20px; height: 20px; }
  .pwa-install-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Hilfe-Dialog */
dialog.pwa-help {
  width: min(520px, calc(100vw - 32px));
  border-color: var(--gold-line);
  background: linear-gradient(180deg, #1c1a20, var(--surface) 140px);
  box-shadow: 0 24px 64px rgba(0,0,0,.6), 0 0 0 1px rgba(255,152,63,.08), 0 0 32px rgba(255,152,63,.08);
}
/* Abgedunkelt, bewusst KEIN backdrop-filter */
dialog.pwa-help::backdrop { background: rgba(6, 6, 8, .78); }
.pwa-help .modal-header { border-bottom-color: var(--gold-line); }
.pwa-help .modal-header h2 { font-size: 1.15rem; line-height: 1.3; }
.pwa-help-intro { color: var(--text-dim); font-size: .93rem; line-height: 1.55; margin: 0 0 16px; }
.pwa-help section > p { margin: 0 0 10px; line-height: 1.5; }
.pwa-help-head {
  margin: 0 0 10px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Nummerierte Schritte mit kleinem Symbol */
.pwa-steps {
  list-style: none;
  counter-reset: pwa-step;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.pwa-steps li {
  counter-increment: pwa-step;
  display: grid;
  grid-template-columns: 26px 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  font-size: .93rem;
  line-height: 1.5;
}
.pwa-steps li::before {
  content: counter(pwa-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: #21140b;
  font: 700 .8rem/1 var(--font);
}
.pwa-step-ico { font-size: 1rem; line-height: 24px; text-align: center; }
.pwa-steps strong { color: var(--text); }

.pwa-help-url {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border: 1px solid var(--gold-line);
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-hover);
  font-size: .9rem;
  user-select: all;
  overflow-wrap: anywhere;
}
.pwa-help-note {
  margin: 0;
  padding: 9px 12px;
  border-left: 3px solid var(--gold-line);
  border-radius: 0 6px 6px 0;
  background: rgba(255,255,255,.025);
  color: var(--text-dim);
  font-size: .86rem;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .pwa-help .modal-body { padding: 14px; }
  .pwa-steps li { grid-template-columns: 24px 20px minmax(0, 1fr); padding: 9px 10px; font-size: .95rem; }
}
