/* ═══════════════════════════════════════════════════════════════════════════
   Desktop-Anpassungen (ab 1024 px), beide Oberflächen. Auf dem Handy ändert sich nichts.
   - Navigation im Kopf (partials/top-nav.ejs) statt unterer Leiste
   - Dashboard (neu) zweispaltig: links Wertung, rechts Feed & Co. (Slots in v2/dashboard.ejs)
   - Sheets (Eintragen, Vergleich, …) als Fenster in der Mitte
   - breitere Unterseiten mit Raster statt einer schmalen Spalte
   ═══════════════════════════════════════════════════════════════════════════ */
.top-nav { display: none; }

@media (min-width: 1024px) {
  /* ── Kopf + Navigation ── */
  .top-nav { display: flex; align-items: center; gap: 2px; margin: 0 auto 0 28px; }
  .top-nav-item {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
    color: var(--muted) !important; font-weight: 600; font-size: 0.92rem; text-decoration: none; white-space: nowrap;
  }
  .top-nav-item:hover { background: var(--bg3); color: var(--text) !important; }
  .top-nav-item.active { color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .top-nav-add {
    margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 10px;
    background: var(--accent); color: #0d1117 !important; font-weight: 700; font-size: 0.92rem; text-decoration: none;
  }
  .top-nav-add:hover { filter: brightness(1.08); }
  body.v2 .top-nav-add { background: var(--v2-accent); color: var(--v2-on-accent) !important; }
  .header-inner { max-width: 1240px; padding: 0 32px; justify-content: flex-start; }
  .header-inner .header-right { margin-left: 0; }
  .v2-header { padding: 0 32px; }
  .bottom-nav { display: none !important; }
  #feedback-fab { left: auto; right: 24px; bottom: 24px; }

  /* ── Dashboard (neu) ── */
  .v2-main { max-width: 1240px; padding: 24px 32px 48px; }
  .v2-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .v2-cols:has(> .v2-col:empty) { grid-template-columns: minmax(0, 1fr); }
  .v2-col { display: flex; flex-direction: column; min-width: 0; }
  .v2-col:empty { display: none; }
  .dash-top { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
  .dash-top > .pb-card, .dash-top > .gi-card { margin-bottom: 0; }
  .gi-card { padding: 20px 24px; }
  .gi-card h2.gi-name { font-size: 1.7rem; }
  .v2-dash-footer { flex-direction: row; align-items: center; justify-content: space-between; margin-top: 16px; }
  .v2-dash-footer .v2-btn { width: auto; padding: 0 20px; }
  .v2-dash-footer .v2-footnote { margin: 0; }

  /* Hover-Rückmeldung (am Handy gibt es kein Hover) */
  .v2-row summary:hover { background: var(--v2-surface2); }
  .v2-feed li { border-radius: 10px; padding-left: 8px; padding-right: 8px; }
  .v2-feed li:hover { background: var(--v2-surface); }
  .v2-btn:hover:not(:disabled) { filter: brightness(1.08); }
  .v2-chip:hover, .gi-chip:hover, .v2-tile:hover { border-color: var(--v2-accent, var(--accent)); }
  .v2-icon-btn:hover, .v2-like:hover { background: var(--v2-surface2); color: var(--v2-text); }
  a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--v2-accent, var(--accent)); outline-offset: 2px; }

  /* ── Sheets als Fenster in der Mitte ── */
  .v2-sheet {
    inset: 0; margin: auto; width: calc(100% - 64px); max-width: 600px; height: fit-content; max-height: 86vh;
    border: 1px solid var(--v2-line); border-radius: 20px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  }
  .v2-sheet[open] { animation: v2-pop-in .18s ease-out; }
  .v2-compare { max-width: 760px; }
  .v2-compare[open] { height: 86vh; }
  .v2-sheet-handle { display: none; }
  .v2-sheet-head { padding-top: 14px; }
  .v2-sport-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .v2-sheet-foot, .v2-success-actions { padding-bottom: 20px; }
  .v2-success-actions { flex-direction: row-reverse; }
  .v2-success-actions > * { flex: 1; }

  /* ── Unterseiten breiter ── */
  .page-content, body.v2 .page-content { max-width: 1000px; padding: 28px 32px 48px; }
  .v2-banner { max-width: none; }

  /* Statistik: Kennzahlen in einer Reihe, Diagramme der Seite „Ich“ nebeneinander */
  .stat-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #tab-personal:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  #tab-personal > .stat-kpi-grid, #tab-personal > .stat-empty { grid-column: 1 / -1; margin-bottom: 0; }
  #tab-personal > .stat-card { margin-bottom: 0; }

  /* Meine Einträge: Eintragen/Import links (bleibt stehen), Liste rechts, Zeilen kompakt */
  .acts-page { display: grid; grid-template-columns: 320px minmax(0, 1fr); column-gap: 28px; align-items: start; max-width: 1180px !important; }
  .acts-page > * { grid-column: 2; }
  .acts-page > .card-dark:first-of-type { grid-column: 1; grid-row: 1 / span 40; position: sticky; top: calc(var(--header-h) + 24px); }
  .activity-item { padding: 10px 14px; }
  .activity-item .act-right { flex-direction: row; align-items: center; gap: 8px; }
  .activity-item .act-right form { margin: 0; }
  .activity-item .act-points { min-width: 36px; text-align: right; }

  /* Profil: Einstellungen und Verbindungen zweispaltig */
  #ptab-content-einstellungen:not(.hidden) { columns: 2; column-gap: 20px; }
  #ptab-content-einstellungen > * { break-inside: avoid; }
  #ptab-content-einstellungen .card, #ptab-content-einstellungen details.integ { display: inline-block; width: 100%; }

  /* Dashboard (klassisch): Kacheln zweispaltig */
  #dashboard-widgets { columns: 2; column-gap: 20px; }
  #dashboard-widgets > .dash-widget { break-inside: avoid; display: inline-block; width: 100%; }
}

@keyframes v2-pop-in { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .v2-sheet[open] { animation: none; } }
