/* LovePath Desktop-Dashboard.
   Wird nur ab 1100 px Breite angewendet (media-Attribut im <link>); die mobile
   Oberfläche bleibt dadurch unverändert. Keine Regeln außerhalb dieses Bereichs. */
@media (min-width: 1100px) {
:root { --sidebar-w: 252px; --dash-gap: 24px; }

/* ---------- Gerüst: Seitenleiste + Inhaltsfläche ---------- */
.shell { max-width: none; margin: 0; padding: 28px 48px 56px calc(var(--sidebar-w) + 48px); }
.masthead { margin-bottom: 24px; min-height: 52px; }
.masthead .brand, .shell .masthead .brand { font-size: 30px; letter-spacing: -1px; }
.shell .masthead .icon-btn { width: 42px; height: 42px; min-height: 42px; }
.shell .masthead .icon-btn svg { width: 20px; height: 20px; }
.masthead .sync-status { display: flex; }
a.brand[data-tab="home"] { font-size: 0 !important; }
a.brand[data-tab="home"]::after { content: "Übersicht"; font-size: 30px; letter-spacing: -1px; }

.bottom-nav {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); height: auto; transform: none; display: flex;
  flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 6px;
  padding: 96px 16px 24px; border: 0; border-right: 1px solid var(--line); border-radius: 0;
  background: var(--paper); box-shadow: none; z-index: 30;
}
.bottom-nav::before {
  content: "LovePath"; position: absolute; top: 30px; left: 28px;
  font-family: var(--serif); font-size: 30px; letter-spacing: -1px; color: var(--ink);
}
.bottom-nav button {
  flex-direction: row; justify-content: flex-start; align-items: center; gap: 14px;
  width: 100%; min-width: 0; padding: 13px 16px; border-radius: 16px; font-size: 15px; text-align: left;
}
.bottom-nav button svg { width: 22px; height: 22px; flex: 0 0 auto; }
.bottom-nav button.active { background: var(--coral); color: var(--ink); }
.bottom-nav button:hover:not(.active) { background: var(--surface); }

/* ---------- Dashboard Startseite ---------- */
.home-widgets:not(.home-editing) {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--dash-gap);
  align-items: stretch;
}
.home-widgets:not(.home-editing) > .home-widget,
.home-widgets:not(.home-editing) > .home-widget > .home-widget-content { min-width: 0; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="couple"],
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="couple"] > .home-widget-content { display: contents; }
.home-widgets:not(.home-editing) .home-hero { grid-column: 1 / -1; }
.home-widgets:not(.home-editing) .home-stats { grid-column: 1 / -1; margin-top: 0; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="couple"] > :not(.home-widget-content) { grid-column: span 6; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="events"] { grid-column: 1 / -1; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="lists"] { grid-column: 1 / span 12; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="memories"] { grid-column: 1 / span 12; }

.home-widgets .home-section .section-head { margin: 0 0 14px; }
.home-widgets .home-section .section-head h2 { font-size: 24px; }

section.hero.home-hero {
  display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  grid-template-areas: "top milestone" "copy milestone"; column-gap: 32px; row-gap: 18px;
  align-content: center; align-items: center; padding: 34px 38px; min-height: 280px; border-radius: 32px;
}
section.hero.home-hero .home-hero-top { grid-area: top; align-self: end; }
section.hero.home-hero .home-hero-copy { grid-area: copy; align-self: start; }
section.hero.home-hero .milestone-link { grid-area: milestone; align-self: center; margin: 0; }
.home-hero-avatar { width: 72px; height: 72px; font-size: 26px; }
.home-hero .duration { font-size: clamp(26px, 2.2vw, 36px); }
.home-hero .couple-name { font-size: 13px; letter-spacing: 2.4px; }
section.hero.home-hero .home-hero-heart { width: 120px; height: 120px; top: 20px; right: 26px; }

.home-stats { gap: 16px; }
.home-stat { padding: 20px 22px; border-radius: 24px; column-gap: 16px; }
.home-stat-icon { width: 48px; height: 48px; border-radius: 16px; }
.home-stat-icon svg { width: 22px; height: 22px; }
.home-stat strong { font-size: 34px; }
.home-stat > span:last-child { font-size: 13px; }

.desktop-extra { display: block; }
.home-event-grid, .home-event-grid.is-single { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.home-event-grid .home-event-card { min-height: 108px; padding: 16px; }
.home-list-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.home-list-grid .home-list-tile, .home-list-grid .home-list-tile.is-empty { height: 168px; padding: 22px; }
.home-list-grid .home-list-tile h3 { font-size: 22px; }
.home-quick-section { margin-top: 32px; }
.home-quick { flex-wrap: wrap; }

/* ---------- Termine ---------- */
.page-content:has(.cal-top) {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr); gap: var(--dash-gap); align-items: start;
}
.page-content:has(.cal-top) > .cal-top { grid-column: 1 / -1; max-width: none; }
.cal-top .cal-views { flex: 0 1 440px; }
.cal-top .cal-add { margin-left: auto; }
.page-content:has(.cal-top) > .page-widget[data-page-widget="calendar"] { grid-column: 1; grid-row: 2; }
.page-content:has(.cal-top) > .page-widget[data-page-widget="upcoming"] { grid-column: 2; grid-row: 2; }
.page-content:has(.cal-top) > .page-widget[data-page-widget="upcoming"] .cal-upcoming { margin-top: 0; }
.cal-month-card { padding: 20px; }
.cal-month-card .day { min-height: 64px; font-size: 20px; }
.cal-strip { gap: 10px; }
.cal-chip { padding: 14px 0 12px; }
.cal-chip-num { font-size: 26px; }

/* ---------- Timeline ---------- */
.timeline-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.timeline-months { gap: 34px; }
.page-content .search { max-width: 520px; }
.page-content .btn.page-create { display: inline-flex; width: auto; min-width: 240px; }
.page-content > .page-head.page-tools { display: flex; align-items: center; justify-content: space-between; }
.page-content > .page-head.page-tools .page-create { margin-left: auto; }
.page-content > .btn.page-create { display: flex; width: fit-content; margin-left: auto; margin-bottom: 14px; }
.page-widget[data-page-widget="timeline"] { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 20px; align-items: center; }
.page-widget[data-page-widget="timeline"] > .page-create { grid-column: 2; grid-row: 1; }
.page-widget[data-page-widget="timeline"] > .search { grid-column: 1; grid-row: 1; margin: 0; max-width: 520px; }
.page-widget[data-page-widget="timeline"] > .timeline-months, .page-widget[data-page-widget="timeline"] > .empty { grid-column: 1 / -1; grid-row: 2; }
#main:focus { outline: none; }

/* ---------- Listen ---------- */
.lists-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.status-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.status-group > .status-group-heading { grid-column: 1 / -1; }
.status-group .item-row { margin-bottom: 0; }

/* ---------- Mehr / Profil / Erfolge ---------- */
.more-page { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: start; }
.page-content:has(.profile-hero) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--dash-gap); align-items: start; }
.page-content:has(.profile-hero) > .profile-hero,
.page-content:has(.profile-hero) > .profile-foot,
.page-content:has(.profile-hero) > .install-banner { grid-column: 1 / -1; }
.achievement-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Detailseiten ---------- */
.memory-page { max-width: 920px; }
.memory-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---------- Editor statt Dialog (Anlegen/Bearbeiten) ---------- */
dialog.flayz-modal:has(form[data-form="memory"]), dialog.flayz-modal:has(form[data-form="event"]),
dialog.flayz-modal:has(form[data-form="item"]), dialog.flayz-modal:has(form[data-form="list"]) {
  position: fixed; inset: 0 0 0 var(--sidebar-w); width: auto; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--paper); box-shadow: none; overflow: auto;
}
dialog.flayz-modal:has(form[data-form="memory"])::backdrop, dialog.flayz-modal:has(form[data-form="event"])::backdrop,
dialog.flayz-modal:has(form[data-form="item"])::backdrop, dialog.flayz-modal:has(form[data-form="list"])::backdrop { background: transparent; }
dialog.flayz-modal:has(form[data-form]) .dialog-head { padding: 30px max(56px, calc((100% - 1040px) / 2)); border-bottom: 1px solid var(--line); }
dialog.flayz-modal:has(form[data-form]) .dialog-head h2 { font-size: 38px; letter-spacing: -1px; }
dialog.flayz-modal:has(form[data-form]) .dialog-body { max-width: 1040px; margin: 0 auto; padding: 36px 56px 0; }
dialog.flayz-modal form[data-form] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; align-items: start; }
dialog.flayz-modal form[data-form] > .field:has(textarea), dialog.flayz-modal form[data-form] > fieldset,
dialog.flayz-modal form[data-form] > p, dialog.flayz-modal form[data-form] > .local-note,
dialog.flayz-modal form[data-form] > #custom-fields, dialog.flayz-modal form[data-form] > .text-btn,
dialog.flayz-modal form[data-form] > .form-grid, dialog.flayz-modal form[data-form] > .dialog-actions { grid-column: 1 / -1; }
dialog.flayz-modal form[data-form] textarea { min-height: 220px; }
dialog.flayz-modal form[data-form] .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
dialog.flayz-modal form[data-form] > .dialog-actions {
  position: sticky; bottom: 0; margin: 28px 0 0; padding: 18px 0 24px; background: var(--paper);
  border-top: 1px solid var(--line); justify-content: flex-end; z-index: 2;
}
dialog.flayz-modal form[data-form="list"] > .field { grid-column: 1 / -1; }
dialog.flayz-modal form[data-form] > .dialog-actions .btn { flex: 0 0 auto; width: auto; min-width: 200px; }
.page-content .filters { flex-wrap: wrap; overflow-x: visible; }
.album-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.notes-page { min-height: calc(100dvh - 150px); }
.note-rich { min-height: 62dvh; font-size: 17px; }
.page-content:has(.notes-page) { display: block; }
.notes-page { display: flex; flex-direction: column; width: 100%; }
.notes-page .note-bottombar { width: 100%; position: sticky; bottom: 0; }
.notes-page .note-toolbar { width: 100%; display: flex; flex-direction: row; justify-content: flex-start; gap: 6px; }
.notes-page .note-rich { width: 100%; }
dialog.flayz-modal form[data-form="memory"] > .rich-toolbar,
dialog.flayz-modal form[data-form="memory"] > .rich-editor,
dialog.flayz-modal form[data-form="memory"] > span.overline { grid-column: 1 / -1; }
dialog.flayz-modal form[data-form="memory"] > .rich-editor { min-height: 240px; }
.memory-photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---------- Feinschliff: Breite, Kacheln, Fokus, Editor ---------- */
.shell > .masthead, .shell > main { max-width: 1320px; margin-left: auto; margin-right: auto; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="events"] { grid-column: span 5; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="lists"] { grid-column: span 7; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="distance"],
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="mood"],
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="touch"] { grid-column: 1 / -1; }
/* Stehen Mood-Tracker und Touch of Love gemeinsam auf dem Home-Bildschirm, teilen sie sich eine Reihe mit gleicher Breite. */
.home-widgets:not(.home-editing):has([data-home-widget="mood"]):has([data-home-widget="touch"]) > .home-widget[data-home-widget="mood"],
.home-widgets:not(.home-editing):has([data-home-widget="mood"]):has([data-home-widget="touch"]) > .home-widget[data-home-widget="touch"] { grid-column: span 6; }
/* Gleich hohe Widgets in einer Reihe: Inhalt füllt die Zelle aus. */
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="mood"],
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="touch"] { display: flex; flex-direction: column; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="mood"] > .home-widget-content,
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="touch"] > .home-widget-content { flex: 1; display: flex; flex-direction: column; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="mood"] > .home-widget-content > section,
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="touch"] > .home-widget-content > section { flex: 1; margin-top: 0; }
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="mood"] > .home-widget-content > .mood-card,
.home-widgets:not(.home-editing) > .home-widget[data-home-widget="touch"] > .home-widget-content > .touch-card { flex: 1; margin: 0; display: flex; flex-direction: column; }
.home-widgets:not(.home-editing) .mood-action { margin-top: auto; align-self: flex-start; }
.home-widgets:not(.home-editing) .touch-card .touch-actions { margin-top: auto; }
.home-widgets:not(.home-editing) .home-event-grid, .home-widgets:not(.home-editing) .home-event-grid.is-single { grid-template-columns: 1fr; }
.home-widgets:not(.home-editing) .home-list-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-stat { display: flex; align-items: center; gap: 16px; padding: 16px 22px; }
.home-stat strong { order: 0; }
.home-stat > span:last-child { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.search input:focus-visible, .note-rich:focus-visible { outline: none; }
.memory-shell .notes-page { max-width: 860px; margin: 0 auto; }
.memory-shell .memory-page { margin: 0 auto; }
.shell .masthead .icon-btn { width: 44px; height: 44px; min-height: 44px; }
.page-widget[data-page-widget="timeline"]:has(> .empty){display:flex;flex-direction:column}
}
