/*
 * my.ferien-macher.ch Frontend 1.1
 * Visual layer only. Existing application logic and page structures remain intact.
 */

:root {
    --fm-bg: #f4f7f8;
    --fm-bg-soft: #eef5f4;
    --fm-surface: #ffffff;
    --fm-surface-glass: rgba(255, 255, 255, 0.88);
    --fm-ink: #15263a;
    --fm-ink-soft: #40536a;
    --fm-muted: #6f7f91;
    --fm-line: #dfe7ea;
    --fm-line-strong: #cad7dc;
    --fm-brand: #e96679;
    --fm-brand-dark: #ce465c;
    --fm-accent: #168b82;
    --fm-accent-dark: #0e716a;
    --fm-accent-soft: #dff3f0;
    --fm-warm: #fff0e7;
    --fm-danger: #b73f4d;
    --fm-danger-soft: #fff0f1;
    --fm-success: #23795c;
    --fm-success-soft: #e8f7f0;
    --fm-warning: #9b6817;
    --fm-warning-soft: #fff6df;
    --fm-shadow-xs: 0 1px 2px rgba(17, 38, 57, 0.05);
    --fm-shadow-sm: 0 8px 24px rgba(17, 38, 57, 0.08);
    --fm-shadow-md: 0 18px 48px rgba(17, 38, 57, 0.12);
    --fm-shadow-lg: 0 28px 70px rgba(17, 38, 57, 0.18);
    --fm-radius-sm: 10px;
    --fm-radius: 16px;
    --fm-radius-lg: 24px;
    --fm-radius-xl: 32px;
    --fm-content: 1440px;
    --fm-header-height: 82px;
    --fm-ease: cubic-bezier(.2, .75, .2, 1);
}

html {
    max-width: 100%;
    overflow-x: clip;
    scroll-behavior: smooth;
    background: var(--fm-bg);
}

body,
input,
select,
textarea,
button {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--fm-ink-soft);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    background:
        radial-gradient(circle at 8% 3%, rgba(22, 139, 130, 0.10), transparent 28rem),
        radial-gradient(circle at 92% 12%, rgba(233, 102, 121, 0.09), transparent 30rem),
        linear-gradient(180deg, #fbfcfc 0, var(--fm-bg) 36rem, #f7f9fa 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .28;
    background-image:
        linear-gradient(rgba(21, 38, 58, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 38, 58, .025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, #000 0, transparent 75%);
}

::selection {
    color: #fff;
    background: var(--fm-accent);
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: var(--fm-accent-dark);
    border-bottom: 0;
    text-decoration-thickness: .08em;
    text-underline-offset: .18em;
}

a:hover {
    color: var(--fm-brand-dark) !important;
}

:focus-visible {
    outline: 3px solid rgba(22, 139, 130, .36);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100000;
    padding: .7rem 1rem;
    border-radius: 999px;
    color: #fff;
    background: var(--fm-ink);
    transform: translateY(-150%);
    transition: transform .2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--fm-ink);
    font-family: inherit;
    text-transform: none;
}

h1 {
    max-width: 18ch;
    margin: 0 0 .6rem;
    font-size: clamp(2.15rem, 5vw, 4.65rem);
    font-weight: 790;
    line-height: 1.04;
    letter-spacing: -.055em;
}

h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 .8rem;
    font-weight: 750;
    line-height: 1.22;
    letter-spacing: -.025em;
}

h2 { font-size: clamp(1.35rem, 2vw, 2rem); }
h3 { font-size: clamp(1.1rem, 1.5vw, 1.4rem); }
h4 { font-size: 1rem; }

p {
    margin: 0 0 1.2rem;
}

small,
.small {
    color: var(--fm-muted);
}

hr {
    height: 1px;
    margin: clamp(2rem, 5vw, 4rem) 0;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--fm-line-strong) 12%, var(--fm-line-strong) 88%, transparent);
}

/* Header */
#header {
    position: sticky;
    top: 0;
    z-index: 10000;
    width: 100%;
    padding: 0;
    border-bottom: 1px solid rgba(202, 215, 220, .72);
    background: rgba(250, 252, 252, .82);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

#header > .inner {
    width: min(100%, var(--fm-content));
    min-height: var(--fm-header-height);
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#header .logo {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    border: 0;
    color: var(--fm-ink);
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

#header .logo:hover {
    color: var(--fm-ink) !important;
}

#header .logo .symbol {
    flex: 0 0 auto;
    margin: 0 .72rem 0 0;
}

#header .logo .symbol img {
    width: 46px;
    height: 46px;
    padding: 7px;
    border-radius: 14px;
    object-fit: contain;
    background: linear-gradient(145deg, #fff, #edf4f3);
    box-shadow: var(--fm-shadow-sm), inset 0 0 0 1px rgba(21, 38, 58, .06);
}

#header .brand-copy {
    display: grid;
    min-width: 0;
    line-height: 1.1;
}

#header .logo .title {
    overflow: hidden;
    color: var(--fm-ink);
    font-size: clamp(.95rem, 2vw, 1.08rem);
    font-weight: 800;
    letter-spacing: -.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#header .brand-kicker {
    margin-top: .22rem;
    color: var(--fm-muted);
    font-size: .70rem;
    font-weight: 650;
    letter-spacing: .035em;
    white-space: nowrap;
}

#header nav.header-actions {
    position: static;
    flex: 0 0 auto;
}

#header nav.header-actions ul {
    gap: .5rem;
}

#header nav.header-actions ul li a,
#header nav.header-actions ul li button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 46px;
    padding: 0 .9rem;
    border: 1px solid var(--fm-line);
    border-radius: 14px;
    color: var(--fm-ink) !important;
    background: rgba(255,255,255,.82);
    box-shadow: var(--fm-shadow-xs);
    font-size: .86rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
    transition: transform .2s var(--fm-ease), border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

#header nav.header-actions ul li a:hover {
    border-color: rgba(22, 139, 130, .38);
    color: var(--fm-accent-dark) !important;
    background: #fff;
    box-shadow: var(--fm-shadow-sm);
    transform: translateY(-2px);
}

#header nav.header-actions ul li a[href="#menu"] {
    width: auto;
    min-width: 50px;
    padding: 0 .85rem;
    overflow: visible;
    text-indent: 0;
    white-space: nowrap;
}

#header nav.header-actions ul li a[href="#menu"]::before,
#header nav.header-actions ul li a[href="#menu"]::after {
    display: none;
}

.menu-trigger-icon {
    position: relative;
    width: 20px;
    height: 14px;
    display: inline-block;
}

.menu-trigger-icon::before,
.menu-trigger-icon::after,
.menu-trigger-icon span {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.menu-trigger-icon::before { top: 0; }
.menu-trigger-icon span { top: 6px; }
.menu-trigger-icon::after { top: 12px; }

.menu-trigger-label {
    margin-left: .55rem;
}

.header-icon-link {
    padding: 0 !important;
}

/* Main shell */
#site-shell,
.site-shell {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    overflow-x: clip;
}

#wrapper {
    min-height: 100vh;
}

#wrapper > * > .inner,
#main > .inner,
#footer > .inner {
    width: min(100%, var(--fm-content));
    max-width: none;
    margin: 0 auto;
    padding-right: clamp(1rem, 3vw, 2.5rem);
    padding-left: clamp(1rem, 3vw, 2.5rem);
}

#main {
    min-height: calc(100vh - var(--fm-header-height));
    padding: clamp(2.1rem, 5vw, 5rem) 0 clamp(4rem, 8vw, 7rem);
}

#main > .inner > header:first-child,
.page-hero {
    position: relative;
    isolation: isolate;
    max-width: 100%;
    margin: 0 0 clamp(2rem, 5vw, 4rem);
    padding: clamp(1.55rem, 4vw, 3.4rem);
    overflow: hidden;
    border: 1px solid rgba(202, 215, 220, .75);
    border-radius: var(--fm-radius-xl);
    background:
        radial-gradient(circle at 85% 18%, rgba(233, 102, 121, .18), transparent 23rem),
        radial-gradient(circle at 6% 100%, rgba(22, 139, 130, .18), transparent 25rem),
        rgba(255,255,255,.82);
    box-shadow: var(--fm-shadow-sm);
}

#main > .inner > header:first-child::after,
.page-hero::after {
    content: "";
    position: absolute;
    right: -4rem;
    bottom: -5.5rem;
    z-index: -1;
    width: 18rem;
    height: 18rem;
    border: 1px solid rgba(22, 139, 130, .16);
    border-radius: 50%;
    box-shadow:
        0 0 0 2.8rem rgba(22, 139, 130, .035),
        0 0 0 5.6rem rgba(233, 102, 121, .025);
}

#main > .inner > header:first-child p,
.page-hero p {
    max-width: 62ch;
    margin: 0;
    color: var(--fm-ink-soft);
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    line-height: 1.6;
}

#main > .inner > header:first-child h2 {
    margin-top: .75rem;
    color: var(--fm-ink-soft);
    font-size: clamp(1rem, 1.9vw, 1.35rem);
    font-weight: 560;
    line-height: 1.5;
    letter-spacing: -.01em;
}

header.major {
    margin-bottom: 1.4rem;
}

header.major h2 {
    margin-bottom: .35rem;
}

header.major p {
    max-width: 68ch;
    color: var(--fm-muted);
}

/* Home and trip tiles */
.tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2.1vw, 1.6rem);
    margin: 0;
}

* + .tiles {
    margin-top: clamp(1.4rem, 3vw, 2.2rem);
}

.tiles article {
    width: auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(202, 215, 220, .78);
    border-radius: var(--fm-radius-lg);
    background: var(--fm-surface);
    box-shadow: var(--fm-shadow-sm);
    transition: transform .32s var(--fm-ease), box-shadow .32s var(--fm-ease), border-color .2s ease;
}

.tiles article:hover {
    border-color: rgba(22, 139, 130, .36);
    box-shadow: var(--fm-shadow-md);
    transform: translateY(-7px);
}

.tiles article > .image {
    width: 100%;
    min-height: 250px;
    aspect-ratio: 16 / 12;
    overflow: hidden;
    border-radius: 0;
    background: linear-gradient(135deg, var(--fm-accent-soft), var(--fm-warm));
}

.tiles article > .image img,
.tiles article > .image img[style] {
    width: 100% !important;
    height: 100% !important;
    min-height: 250px;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 0;
    filter: saturate(.92) contrast(1.02);
    transition: transform .7s var(--fm-ease), filter .4s ease;
}

.tiles article:hover > .image img {
    filter: saturate(1.05) contrast(1.03);
    transform: scale(1.055);
}

.tiles article > .image::before {
    z-index: 1;
    opacity: 1;
    background: linear-gradient(180deg, rgba(12, 29, 45, .04) 18%, rgba(12, 29, 45, .22) 55%, rgba(12, 29, 45, .88) 100%) !important;
}

.tiles article > .image::after {
    display: none;
}

.tiles article > a {
    justify-content: flex-end;
    align-items: flex-start;
    padding: clamp(1.1rem, 3vw, 1.55rem);
    border-radius: inherit;
    color: #fff;
    text-align: left;
}

.tiles article > a h2 {
    max-width: 100%;
    margin: 0;
    color: #fff;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 780;
    line-height: 1.12;
    letter-spacing: -.035em;
    text-shadow: 0 2px 16px rgba(0,0,0,.24);
}

.tiles article > a .content {
    max-height: none;
    margin-top: .55rem;
    opacity: .88;
    color: rgba(255,255,255,.92);
    font-size: .93rem;
    line-height: 1.42;
    transition: opacity .2s ease;
}

.tiles article > a .content p {
    margin: 0;
}

.tiles article:hover > a .content {
    opacity: 1;
}

.tiles .trip-badge,
.tiles .offline-trip-bubble {
    align-self: flex-start;
    border: 1px solid rgba(255,255,255,.28) !important;
    background: rgba(12, 29, 45, .72) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    backdrop-filter: blur(10px);
}

/* Sections and cards */
section:not(.tiles),
.box,
.section-box,
.info-box,
.accordion-item,
.notif-item,
.currency-converter,
.trip-calendar,
.worldmap-wrap,
.trip-card,
.info-container > * {
    scroll-margin-top: calc(var(--fm-header-height) + 1rem);
}

.box,
.section-box,
.info-box,
.accordion-item,
.currency-converter,
.trip-card,
.worldmap-wrap {
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius);
    background: rgba(255,255,255,.9);
    box-shadow: var(--fm-shadow-xs);
}

.box {
    padding: clamp(1.1rem, 2.6vw, 1.7rem);
}

.section-box {
    margin: 0 0 1rem;
    overflow: hidden;
}

.section-title {
    margin: 0;
    padding: .9rem 1.05rem;
    color: var(--fm-ink);
    font-size: .95rem;
    font-weight: 750;
    letter-spacing: -.015em;
    background: linear-gradient(180deg, #fbfcfc, #f4f8f7);
    border-bottom: 1px solid var(--fm-line);
}

.section-content {
    padding: 1rem 1.05rem;
}

.section-content > :last-child {
    margin-bottom: 0;
}

.info-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    gap: 1rem;
    margin: 1.4rem 0;
}

.info-box {
    min-width: 0;
    padding: 1rem 1.05rem;
    cursor: pointer;
    transition: transform .2s var(--fm-ease), box-shadow .2s ease, border-color .2s ease;
}

.info-box:hover {
    border-color: rgba(22, 139, 130, .32);
    box-shadow: var(--fm-shadow-sm);
    transform: translateY(-2px);
}

/* Forms */
form {
    overflow: visible;
}

#main form:not(.inline-form):not([style*="display:inline"]):not([style*="display: inline"]) {
    max-width: 100%;
}

form > .fields {
    width: auto;
    margin: 0 0 1.45rem;
    gap: 1rem;
}

form > .fields > .field,
form > .fields > .field.half,
form > .fields > .field.third,
form > .fields > .field.quarter {
    min-width: 0;
    padding: 0;
}

form > .fields > .field { width: 100%; }
form > .fields > .field.half { width: calc(50% - .5rem); }
form > .fields > .field.third { width: calc(33.333% - .67rem); }
form > .fields > .field.quarter { width: calc(25% - .75rem); }

label {
    margin: 0 0 .45rem;
    color: var(--fm-ink);
    font-size: .83rem;
    font-weight: 720;
    letter-spacing: .005em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="url"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: .72rem .88rem;
    border: 1px solid var(--fm-line-strong);
    border-radius: 12px;
    color: var(--fm-ink);
    background: rgba(255,255,255,.94);
    box-shadow: inset 0 1px 2px rgba(17, 38, 57, .035);
    font-size: 1rem;
    line-height: 1.35;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="url"],
input[type="search"],
select {
    height: 48px;
}

textarea {
    min-height: 132px;
    padding-top: .85rem;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--fm-accent) !important;
    outline: 0;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(22, 139, 130, .12) !important;
}

input::placeholder,
textarea::placeholder {
    color: #95a2af;
}

select {
    padding-right: 2.8rem;
    background-color: #fff;
}

input[type="checkbox"] + label,
input[type="radio"] + label {
    min-height: 2rem;
    padding-left: 2.4rem;
    color: var(--fm-ink-soft);
    font-size: .94rem;
    font-weight: 500;
}

input[type="checkbox"] + label::before,
input[type="radio"] + label::before {
    top: .05rem;
    width: 1.65rem;
    height: 1.65rem;
    border-color: var(--fm-line-strong);
    line-height: 1.55rem;
    background: #fff;
}

input[type="checkbox"]:checked + label::before,
input[type="radio"]:checked + label::before {
    border-color: var(--fm-accent);
    background: var(--fm-accent);
}

/* Buttons */
input[type="submit"],
input[type="reset"],
input[type="button"],
button,
.button {
    width: auto;
    max-width: 100%;
    min-height: 44px;
    height: auto;
    padding: .72rem 1.05rem;
    overflow: visible;
    border: 1px solid var(--fm-line-strong);
    border-radius: 12px;
    color: var(--fm-ink) !important;
    background: rgba(255,255,255,.95);
    box-shadow: var(--fm-shadow-xs);
    font-size: .82rem;
    font-weight: 750;
    letter-spacing: .01em;
    line-height: 1.25;
    text-transform: none;
    text-overflow: clip;
    white-space: normal;
    transition: transform .18s var(--fm-ease), box-shadow .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}

input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
button:hover,
.button:hover {
    border-color: rgba(22, 139, 130, .45);
    color: var(--fm-accent-dark) !important;
    background: #fff;
    box-shadow: var(--fm-shadow-sm);
    transform: translateY(-2px);
}

input[type="submit"]:active,
input[type="reset"]:active,
input[type="button"]:active,
button:active,
.button:active {
    background: var(--fm-accent-soft);
    transform: translateY(0);
}

input[type="submit"].primary,
input[type="reset"].primary,
input[type="button"].primary,
button.primary,
.button.primary {
    border-color: transparent;
    color: #fff !important;
    background: linear-gradient(135deg, var(--fm-accent), var(--fm-accent-dark));
    box-shadow: 0 10px 24px rgba(22, 139, 130, .22);
}

input[type="submit"].primary:hover,
input[type="reset"].primary:hover,
input[type="button"].primary:hover,
button.primary:hover,
.button.primary:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #1b9f94, var(--fm-accent));
}

.button.small,
button.small,
input.small {
    min-height: 38px;
    padding: .55rem .78rem;
    font-size: .78rem;
}

.delete-button,
.button.danger,
button.danger {
    border-color: rgba(183, 63, 77, .28);
    color: var(--fm-danger) !important;
    background: var(--fm-danger-soft);
}

.delete-button:hover,
.button.danger:hover,
button.danger:hover {
    border-color: rgba(183, 63, 77, .55);
    color: #942f3c !important;
    background: #ffe4e7;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .7rem;
    margin: 1.2rem 0 0;
}

.actions li {
    flex: 0 1 auto;
    padding: 0;
}

.actions .button,
.actions button,
.actions input {
    margin: 0 !important;
}

/* Tables */
.table-wrapper,
.table-scroll {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius);
    background: #fff;
    box-shadow: var(--fm-shadow-xs);
    -webkit-overflow-scrolling: touch;
}

table {
    min-width: 680px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

table thead {
    border: 0;
}

table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: .8rem .9rem;
    color: var(--fm-ink);
    background: #f3f7f7;
    border-bottom: 1px solid var(--fm-line-strong);
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .02em;
}

table td {
    padding: .85rem .9rem;
    border-bottom: 1px solid var(--fm-line);
    vertical-align: top;
}

table tbody tr,
table tbody tr:nth-child(2n + 1) {
    border: 0;
    background: #fff;
}

table tbody tr:hover {
    background: #f8fbfb;
}

table tbody tr:last-child td {
    border-bottom: 0;
}

/* Accordions and destination lists */
.destination-list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.destination-list > li,
.destination-list li {
    padding: 0;
    border: 0;
}

.accordion-item {
    overflow: hidden;
}

.accordion-title {
    min-height: 64px;
    padding: 1rem 1.15rem;
    border: 0;
    border-bottom: 1px solid transparent;
    color: var(--fm-ink);
    background: linear-gradient(180deg, #fff, #f8fafb);
    font-size: 1rem;
    font-weight: 720;
    transition: background .18s ease, border-color .18s ease;
}

.accordion-title:hover {
    background: #f2f8f7;
}

.accordion-content {
    padding: 1.1rem;
    border-top: 1px solid var(--fm-line);
    background: #fff;
}

.trip-icon {
    width: 32px;
    height: 32px;
    padding: 5px;
    border-radius: 10px;
    background: var(--fm-accent-soft);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    border-radius: 999px;
    background: var(--fm-warm);
}

/* Galleries */
.thumbnail-gallery,
.pdf-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .75rem;
}

.thumbnail-gallery .thumbnail,
.thumbnail-gallery a,
.pdf-gallery a {
    display: block;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--fm-line);
    border-radius: 14px;
    background: #f2f6f6;
    box-shadow: var(--fm-shadow-xs);
    transition: transform .2s var(--fm-ease), box-shadow .2s ease;
}

.thumbnail-gallery a:hover,
.pdf-gallery a:hover {
    box-shadow: var(--fm-shadow-sm);
    transform: translateY(-3px);
}

.thumbnail-gallery img,
.thumbnail-gallery video,
.thumbnail-gallery img[width],
.thumbnail-gallery video[style] {
    width: 100% !important;
    height: auto !important;
    min-height: 118px;
    aspect-ratio: 1 / 1;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: cover !important;
}

/* Maps */
#map,
#worldMap,
.trip-card-map,
[id$="Map"],
.leaflet-container {
    max-width: 100%;
    border-radius: var(--fm-radius) !important;
}

#map,
#worldMap {
    min-height: min(62vh, 520px);
    overflow: hidden;
    border: 1px solid var(--fm-line);
    box-shadow: var(--fm-shadow-sm);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    color: var(--fm-ink-soft);
    background: #fff;
}

/* Dashboard calendar cards */
.trip-view-toggle {
    display: inline-flex !important;
    flex-wrap: wrap;
    gap: .35rem !important;
    padding: .35rem !important;
    border: 1px solid var(--fm-line) !important;
    background: #edf3f3 !important;
}

.trip-view-toggle button {
    box-shadow: none !important;
}

.trip-view-toggle button.is-active {
    color: #fff !important;
    background: var(--fm-ink) !important;
}

.trip-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)) !important;
    gap: 1rem !important;
}

.trip-card {
    min-width: 0;
    overflow: hidden;
    box-shadow: var(--fm-shadow-sm) !important;
}

.trip-card-body {
    padding: 1.15rem !important;
}

.trip-card-title {
    color: var(--fm-ink);
}

.worldmap-wrap {
    overflow: hidden;
    box-shadow: var(--fm-shadow-sm) !important;
}

.worldmap-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.2rem;
    padding: .9rem 1rem;
    color: var(--fm-muted);
    background: #fff;
}

/* Notifications */
.notif-list,
.notifications-list {
    display: grid;
    gap: .85rem;
}

.notif-item {
    margin: 0 0 .9rem;
    padding: 0;
    border: 0;
    background: transparent;
}

.notif-meta {
    margin: 0 0 .35rem .5rem;
    color: var(--fm-muted);
    font-size: .78rem;
}

.notif-bubble {
    padding: 1rem 1.1rem !important;
    border: 1px solid var(--fm-line) !important;
    border-radius: 16px !important;
    color: var(--fm-ink-soft);
    background: #fff !important;
    box-shadow: var(--fm-shadow-xs);
}

.notif-bubble.unread {
    border-color: rgba(22, 139, 130, .34) !important;
    background: linear-gradient(135deg, #f7fffd, #edf9f7) !important;
    box-shadow: 0 10px 28px rgba(22, 139, 130, .10);
}

.notif-type-row {
    color: var(--fm-accent-dark);
    font-size: .8rem;
    font-weight: 750;
}

/* Login and registration */
body.page-login #main > .inner,
body.page-register #main > .inner {
    max-width: 860px;
}

body.page-login #main,
body.page-register #main {
    display: grid;
    align-items: center;
    min-height: calc(100vh - var(--fm-header-height));
}

body.page-login #main > .inner > header:first-child,
body.page-register #main > .inner > header:first-child {
    margin-bottom: 1rem;
}

body.page-login #main form,
body.page-register #main form {
    padding: clamp(1.2rem, 4vw, 2rem);
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius-lg);
    background: rgba(255,255,255,.92);
    box-shadow: var(--fm-shadow-sm);
}

/* Trip share blocks */
.share-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    align-items: start;
    gap: 1rem;
    margin-top: 2rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius-lg);
    background: #fff;
    box-shadow: var(--fm-shadow-sm);
    text-align: center;
}

.share-section > div {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius);
    background: #f8fbfb;
}

.share-section img {
    width: min(200px, 100%);
    border-radius: 12px;
}

/* Menu drawer */
#menu {
    width: min(420px, 92vw);
    max-width: 92vw;
    color: #fff;
    background:
        radial-gradient(circle at 105% -5%, rgba(233, 102, 121, .28), transparent 18rem),
        radial-gradient(circle at -5% 105%, rgba(22, 139, 130, .32), transparent 20rem),
        #14283a;
    box-shadow: -20px 0 60px rgba(7, 22, 35, .28);
}

#menu > .inner {
    padding: 2rem 1.4rem 2rem;
}

#menu .menu-head {
    margin: 0 0 1.1rem;
    padding: 0 .45rem 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,.13);
}

#menu h2 {
    margin: 0 0 .25rem;
    color: #fff;
    font-size: 1.4rem;
    letter-spacing: -.035em;
}

#menu .menu-subtitle {
    margin: 0;
    color: rgba(255,255,255,.62);
    font-size: .82rem;
}

#menu > .inner > ul {
    display: grid;
    gap: .35rem;
    margin: 0;
}

#menu > .inner > ul > li,
#menu > .inner > ul > li:first-child {
    margin: 0;
    border: 0;
}

#menu > .inner > ul > li a {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 48px;
    padding: .72rem .8rem;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255,255,255,.84);
    font-size: .95rem;
    font-weight: 590;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s var(--fm-ease);
}

#menu > .inner > ul > li a:hover,
#menu > .inner > ul > li.is-active a {
    border-color: rgba(255,255,255,.11);
    color: #fff !important;
    background: rgba(255,255,255,.10);
    transform: translateX(3px);
}

#menu > .inner > ul > li.is-active a {
    background: linear-gradient(135deg, rgba(22,139,130,.45), rgba(22,139,130,.25));
}

#menu .menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #fff;
    background: rgba(255,255,255,.09);
}

#menu > .close {
    top: 1rem;
    left: -4rem;
    width: 3rem;
    height: 3rem;
    text-indent: 4rem;
    border-radius: 14px;
    background: rgba(255,255,255,.92);
    box-shadow: var(--fm-shadow-sm);
}

#menu > .close::before,
#menu > .close::after {
    background-size: 1.25rem 1.25rem;
}

body.is-menu-visible #site-shell {
    pointer-events: none;
    opacity: .36;
    filter: saturate(.7);
}

/* Footer */
#footer {
    padding: 0;
    border-top: 1px solid var(--fm-line);
    background: rgba(239, 244, 245, .88);
}

#footer > .inner {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 2rem;
    padding-top: clamp(2rem, 5vw, 3.5rem);
    padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

#footer > .inner section:nth-child(1),
#footer > .inner section:nth-child(2) {
    width: auto;
    margin: 0;
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

.footer-brand img {
    width: 42px;
    height: 42px;
    padding: 7px;
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--fm-shadow-xs);
}

.footer-brand h2 {
    margin: 0 0 .25rem;
    font-size: 1.05rem;
}

.footer-brand p {
    max-width: 48ch;
    margin: 0;
    color: var(--fm-muted);
    font-size: .88rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem 1rem;
    margin: 0;
}

.footer-links a {
    color: var(--fm-ink-soft);
    font-size: .86rem;
    font-weight: 650;
}

#footer > .inner .copyright {
    grid-column: 1 / -1;
    width: 100%;
    margin: .2rem 0 0;
    padding-top: 1.2rem;
    border-top: 1px solid var(--fm-line);
    color: var(--fm-muted);
    font-size: .78rem;
}

#footer > .inner .copyright li {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Loader */
#loading-circle {
    width: 84px !important;
    height: 84px !important;
    border: 1px solid rgba(202,215,220,.9);
    background: rgba(255,255,255,.93) !important;
    box-shadow: var(--fm-shadow-lg) !important;
    backdrop-filter: blur(16px);
}

#loading-circle .spinner-container,
#loading-circle .progress-ring {
    width: 84px !important;
    height: 84px !important;
}

#loading-circle .progress-ring {
    transform: rotate(-90deg) scale(.68) !important;
    transform-origin: center;
}

#loading-circle .progress-ring__circle {
    stroke: var(--fm-accent) !important;
}

#loading-circle .loading-logo {
    width: 42% !important;
}

/* Inline messages */
.error-message,
.alert,
.notice,
.success-message,
[role="alert"] {
    padding: .85rem 1rem;
    border: 1px solid var(--fm-line);
    border-radius: 12px;
    background: #fff;
}

.error-message,
.alert-error {
    border-color: rgba(183,63,77,.26);
    color: var(--fm-danger);
    background: var(--fm-danger-soft);
}

/* Responsive */
@media screen and (max-width: 1100px) {
    .tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 980px) {
    :root {
        --fm-header-height: 74px;
    }

    #header > .inner {
        min-height: var(--fm-header-height);
    }

    #footer > .inner {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media screen and (max-width: 736px) {
    body {
        font-size: 15px;
    }

    #header {
        padding: 0;
    }

    #header .brand-kicker {
        display: none;
    }

    #header .logo .symbol {
        margin-right: .55rem;
    }

    #header .logo .symbol img {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    #header nav.header-actions {
        right: auto;
        top: auto;
    }

    .menu-trigger-label {
        display: none;
    }

    #main {
        padding-top: 1.25rem;
        padding-bottom: 4rem;
    }

    #main > .inner > header:first-child,
    .page-hero {
        margin-bottom: 1.4rem;
        padding: 1.35rem;
        border-radius: 22px;
    }

    h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    form > .fields > .field,
    form > .fields > .field.half,
    form > .fields > .field.third,
    form > .fields > .field.quarter {
        width: 100%;
    }

    .actions,
    ul.actions {
        align-items: stretch;
    }

    .actions li {
        flex: 0 1 auto;
    }

    .actions .button,
    .actions button,
    .actions input {
        width: 100%;
    }

    .info-container {
        grid-template-columns: 1fr;
    }

    #map,
    #worldMap {
        min-height: 390px;
    }

    #menu > .inner {
        padding: 1.4rem 1rem 2rem;
    }
}

@media screen and (max-width: 560px) {
    .tiles {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tiles article > .image,
    .tiles article > .image img,
    .tiles article > .image img[style] {
        min-height: 225px;
        aspect-ratio: 16 / 10;
    }

    .thumbnail-gallery,
    .pdf-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .share-section {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        align-items: center;
    }
}

@media screen and (max-width: 420px) {
    #header .logo .title {
        max-width: 47vw;
        font-size: .9rem;
    }

    #header nav.header-actions ul {
        gap: .3rem;
    }

    #header nav.header-actions ul li a,
    #header nav.header-actions ul li button {
        min-width: 42px;
        height: 42px;
        padding: 0 .72rem;
        border-radius: 12px;
    }

    #header nav.header-actions .header-icon-link:not([style*="display: none"]):not([style*="display:none"]) + li {
        margin-left: 0;
    }

    #main > .inner > header:first-child,
    .page-hero {
        padding: 1.15rem;
        border-radius: 18px;
    }

    .box,
    .section-content,
    .accordion-content {
        padding: .9rem;
    }

    .thumbnail-gallery,
    .pdf-gallery {
        gap: .55rem;
    }

    #map,
    #worldMap {
        min-height: 330px;
    }
}


/* Keep the off-canvas navigation outside the document width. */
body:not(.is-menu-visible) #menu {
    pointer-events: none;
}

body.page-login ul.actions,
body.page-register ul.actions {
    align-items: center;
    align-content: flex-start;
    min-height: 0;
    height: auto;
}

body.page-login ul.actions li,
body.page-register ul.actions li {
    flex: 0 1 auto;
    height: auto;
}

@media screen and (max-width: 480px) {
    body.page-login ul.actions li,
    body.page-register ul.actions li {
        flex: 0 0 auto;
        padding-top: .7rem;
    }

    body.page-login ul.actions li:first-child,
    body.page-register ul.actions li:first-child {
        padding-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    #header,
    #footer,
    #menu,
    #loading-circle,
    .actions,
    .share-section button {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    #main {
        padding: 0;
    }

    #main > .inner {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .box,
    .section-box,
    .accordion-item,
    .trip-card {
        box-shadow: none;
        break-inside: avoid;
    }
}

/* ========================================================================== */
/* Frontend 1.1.1: fixer Kopf, Reise-Kontext und mobile Kartenbedienung       */
/* ========================================================================== */

:root {
    --fm-header-height: 82px;
}

/* Der Kopf bleibt immer erreichbar. */
#header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20000;
    padding-top: env(safe-area-inset-top, 0px);
}

#site-shell,
.site-shell {
    padding-top: calc(var(--fm-header-height) + env(safe-area-inset-top, 0px));
}

#header > .inner {
    height: var(--fm-header-height);
    min-height: var(--fm-header-height);
}

/* Die alte Template-CSS setzte Listenpunkte im Header teilweise absolut. */
#header nav.header-actions,
#header nav.header-actions ul,
#header nav.header-actions li {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
}

#header nav.header-actions ul {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    list-style: none;
}

#header nav.header-actions li {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    border: 0;
}

#header nav.header-actions a {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    margin: 0;
}

#header .header-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    min-width: 46px;
    padding: 0 !important;
    text-align: center;
}

#header .header-icon-link i,
#header .trip-context-back i,
#menu .menu-icon i,
.button i,
button i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    margin: 0;
    line-height: 1;
    vertical-align: middle;
}

.trip-context-back {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .48rem;
    min-width: 0 !important;
    padding-right: .9rem !important;
    padding-left: .9rem !important;
}

.trip-back-label-short {
    display: none;
}

/* Buttons und ihre Icons sitzen auf einer gemeinsamen Grundlinie. */
input[type="submit"],
input[type="reset"],
input[type="button"],
button,
.button {
    align-items: center;
    justify-content: center;
    gap: .48rem;
    vertical-align: middle;
}

button,
.button,
a.button {
    display: inline-flex;
}

.actions,
ul.actions {
    align-items: center;
}

.actions li,
ul.actions li {
    display: flex;
    align-items: center;
}

/* Reise-Menü im normalen Off-Canvas-Menü. */
#menu > .inner {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

#menu .menu-eyebrow {
    display: block;
    margin-bottom: .28rem;
    color: #65d3c7;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

#menu .menu-section + .menu-section {
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(255,255,255,.11);
}

#menu .menu-section h3 {
    margin: 0 0 .55rem;
    padding: 0 .45rem;
    color: rgba(255,255,255,.54);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

#menu .menu-list {
    display: grid;
    gap: .32rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

#menu .menu-list > li,
#menu .menu-list > li:first-child {
    margin: 0;
    padding: 0;
    border: 0;
}

#menu .menu-list > li a {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 48px;
    padding: .7rem .78rem;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255,255,255,.84);
    font-size: .92rem;
    font-weight: 590;
    line-height: 1.25;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s var(--fm-ease);
}

#menu .menu-list > li a:hover,
#menu .menu-list > li.is-active a {
    border-color: rgba(255,255,255,.11);
    color: #fff !important;
    background: rgba(255,255,255,.10);
    transform: translateX(3px);
}

#menu .menu-list > li.is-active a {
    background: linear-gradient(135deg, rgba(22,139,130,.45), rgba(22,139,130,.25));
}

/* Reise-Kopf mit kompakter, integrierter Karte. */
body.page-view-trip #main > .inner > header.trip-hero {
    padding: clamp(1.35rem, 3vw, 2.5rem);
}

.trip-hero-top {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(330px, .82fr);
    align-items: stretch;
    gap: clamp(1.25rem, 3vw, 2.2rem);
}

.trip-hero-copy {
    min-width: 0;
    align-self: center;
}

.trip-hero-copy h1 {
    max-width: 16ch;
}

.trip-hero-copy h2 {
    max-width: 48ch;
    margin-bottom: 0;
}

.trip-hero-map-shell {
    position: relative;
    min-width: 0;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid rgba(202, 215, 220, .9);
    border-radius: 20px;
    background: #dfeae8;
    box-shadow: var(--fm-shadow-sm);
}

.trip-hero-map-shell #map {
    width: 100% !important;
    height: 100% !important;
    min-height: 260px;
    margin: 0 !important;
    border: 0;
    border-radius: 20px !important;
    box-shadow: none;
}

.trip-map-actions {
    position: absolute;
    right: .65rem;
    bottom: .65rem;
    z-index: 800;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
    pointer-events: none;
}

.trip-map-actions > * {
    min-height: 38px;
    padding: .55rem .72rem;
    border: 1px solid rgba(21,38,58,.16);
    border-radius: 11px;
    color: var(--fm-ink) !important;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 22px rgba(17,38,57,.16);
    font-size: .74rem;
    font-weight: 760;
    line-height: 1;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.trip-map-actions > *:hover {
    color: var(--fm-accent-dark) !important;
    background: #fff;
}

.trip-map-interaction-toggle {
    display: none;
}

.trip-hero-tools {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1.1rem;
}

.trip-hero-tools .button {
    margin: 0;
}

/* Alte Einzel-Links werden durch den zentralen Kopf ersetzt. */
.has-trip-context .trip-return-legacy {
    display: none !important;
}

/* Journalbilder bleiben echte Thumbnails, auch wenn nur ein Bild vorhanden ist. */
.journal-thumbnail-gallery {
    grid-template-columns: repeat(auto-fill, minmax(112px, 150px));
    justify-content: start;
}

.journal-thumbnail-gallery .thumbnail,
.journal-thumbnail-gallery a {
    width: 100%;
    max-width: 150px;
    aspect-ratio: 1 / 1;
}

.journal-thumbnail-gallery img,
.journal-thumbnail-gallery video,
.journal-thumbnail-gallery img[width],
.journal-thumbnail-gallery video[style] {
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    aspect-ratio: 1 / 1;
    object-fit: cover !important;
}

.trip-icon {
    display: block;
    flex: 0 0 32px;
    margin: 0;
    object-fit: contain;
}

.dest-header,
.dest-header-left,
.dest-header-right,
.dest-meta,
.status-badge-link {
    min-width: 0;
}

.dest-header,
.dest-header-right,
.dest-meta,
.status-badge-link {
    display: flex;
    align-items: center;
}

.dest-header {
    justify-content: space-between;
    gap: .8rem;
}

.dest-header-right {
    flex: 0 0 auto;
    gap: .45rem;
}

.dest-meta {
    flex-wrap: wrap;
    gap: .35rem .8rem;
}

.status-badge-link {
    border: 0;
}

/* Leaflet darf den Seiten-Scroll auf Touch-Geräten erst nach Aktivierung fangen. */
.trip-hero-map-shell.is-map-locked .leaflet-container {
    cursor: default;
}

@media (pointer: coarse) {
    .trip-map-interaction-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .35rem;
    }
}

@media screen and (max-width: 980px) {
    :root {
        --fm-header-height: 74px;
    }

    .trip-hero-top {
        grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr);
    }

    .trip-hero-map-shell,
    .trip-hero-map-shell #map {
        min-height: 230px;
    }
}

@media screen and (max-width: 736px) {
    #header > .inner {
        gap: .55rem;
        padding-right: .8rem;
        padding-left: .8rem;
    }

    #header nav.header-actions ul {
        gap: .34rem;
    }

    #header nav.header-actions ul li a,
    #header nav.header-actions ul li button,
    #header .header-icon-link {
        width: 42px;
        min-width: 42px;
        height: 42px;
        padding: 0 .68rem;
        border-radius: 12px;
    }

    #header .trip-context-back {
        width: auto;
        min-width: 42px;
        padding-right: .72rem !important;
        padding-left: .72rem !important;
    }

    .trip-hero-top {
        grid-template-columns: 1fr;
    }

    .trip-hero-map-shell,
    .trip-hero-map-shell #map {
        min-height: 210px;
    }

    .trip-map-actions {
        right: .5rem;
        bottom: .5rem;
        left: .5rem;
        justify-content: space-between;
    }

    .trip-map-actions > * {
        min-height: 36px;
        padding: .5rem .62rem;
        font-size: .7rem;
    }

    .journal-thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(92px, 118px));
    }

    .journal-thumbnail-gallery .thumbnail,
    .journal-thumbnail-gallery a {
        max-width: 118px;
    }
}

@media screen and (max-width: 560px) {
    body.has-trip-context #header .brand-copy {
        display: none;
    }

    body.has-trip-context #header .logo .symbol {
        margin-right: 0;
    }

    .trip-back-label-full {
        display: none;
    }

    .trip-back-label-short {
        display: inline;
    }

    .trip-hero-tools {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .trip-hero-tools .button {
        width: 100%;
    }
}

@media screen and (max-width: 390px) {
    #header > .inner {
        padding-right: .55rem;
        padding-left: .55rem;
    }

    #header .logo .symbol img {
        width: 38px;
        height: 38px;
    }

    #header nav.header-actions ul {
        gap: .25rem;
    }

    #header nav.header-actions ul li a,
    #header nav.header-actions ul li button,
    #header .header-icon-link {
        width: 40px;
        min-width: 40px;
        height: 40px;
        padding: 0 .58rem;
    }

    #header .trip-context-back {
        width: 40px;
        padding: 0 !important;
    }

    .trip-back-label-short {
        display: none;
    }

    .trip-hero-tools {
        grid-template-columns: 1fr;
    }
}

@media print {
    #site-shell,
    .site-shell {
        padding-top: 0;
    }
}

/* Reiseansicht: ältere Inline-Stile zentralisiert und bereinigt. */
.interactive-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.interactive-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + .55rem);
    z-index: 1000;
    display: none;
    width: max-content;
    max-width: min(260px, 80vw);
    padding: .55rem .7rem;
    border-radius: 9px;
    color: #fff;
    background: rgba(8, 22, 34, .94);
    box-shadow: var(--fm-shadow-sm);
    font-size: .82rem;
    line-height: 1.4;
    white-space: pre-line;
    transform: translateX(-50%);
}

.interactive-tooltip:hover::after,
.interactive-tooltip:focus-visible::after {
    display: block;
}

.custom-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.info-content {
    display: none;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--fm-line);
}

.date-info,
.weather-info {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    margin: 0;
    color: var(--fm-muted);
    font-size: .85rem;
    line-height: 1.35;
}

.weather-info a {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.dest-title {
    display: block;
    min-width: 0;
    color: var(--fm-ink);
    font-weight: 700;
    line-height: 1.3;
}

.dest-stars {
    flex: 0 0 auto;
    color: #e39a22;
    font-size: .92rem;
    line-height: 1;
    letter-spacing: .03em;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .86rem;
    line-height: 1;
}

.status-badge-booked {
    border-color: rgba(35, 121, 92, .28);
    color: var(--fm-success);
    background: var(--fm-success-soft);
}

.status-badge-idea {
    border-color: rgba(155, 104, 23, .28);
    color: var(--fm-warning);
    background: var(--fm-warning-soft);
}

.status-label {
    display: inline-flex;
    align-items: center;
    margin-left: .45rem;
    padding: .2rem .48rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
}

.status-label-booked {
    color: var(--fm-success);
    background: var(--fm-success-soft);
}

.status-label-idea {
    color: var(--fm-warning);
    background: var(--fm-warning-soft);
}

.status-badge-link {
    display: inline-flex;
    align-items: center;
    border: 0;
    text-decoration: none;
}

.status-badge-link .status-badge {
    cursor: pointer;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    padding: 1rem;
    background: rgba(5, 16, 26, .84);
    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(540px, calc(100% - 2rem));
    max-height: min(84vh, 720px);
    overflow: auto;
    padding: 1.2rem;
    border-radius: var(--fm-radius);
    color: var(--fm-ink-soft);
    background: #fff;
    box-shadow: var(--fm-shadow-lg);
    transform: translate(-50%, -50%);
}

.button.icon::before,
button.icon::before,
a.icon::before {
    vertical-align: -.08em;
}

.button.icon::before,
button.icon::before {
    margin-right: 0;
}

.trip-hero-map-shell.is-map-locked #map,
.trip-hero-map-shell.is-map-locked .leaflet-container {
    pointer-events: none;
}

[id^="dest-"],
section[id],
article[id] {
    scroll-margin-top: calc(var(--fm-header-height) + 1rem + env(safe-area-inset-top, 0px));
}

/* ========================================================================== 
   Frontend 1.1.2: gezielte Qualitätsrunde
   ========================================================================== */

.page-hero-compact {
    padding: clamp(1.45rem, 3.2vw, 2.55rem);
}

.page-hero-compact h1 {
    max-width: 22ch;
    font-size: clamp(2rem, 4.4vw, 3.85rem);
}

.page-eyebrow {
    display: block;
    margin: 0 0 .45rem;
    color: var(--fm-accent-dark);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .14em;
    line-height: 1.3;
    text-transform: uppercase;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.message-card {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0 0 1rem;
    padding: .9rem 1rem;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius);
    background: #fff;
    box-shadow: var(--fm-shadow-xs);
    font-weight: 650;
}

.message-card.is-success {
    border-color: rgba(35, 121, 92, .28);
    color: var(--fm-success);
    background: var(--fm-success-soft);
}

.message-card.is-error {
    border-color: rgba(183, 63, 77, .3);
    color: var(--fm-danger);
    background: var(--fm-danger-soft);
}

.empty-state {
    padding: clamp(2rem, 5vw, 4rem) 1.25rem;
    border: 1px dashed var(--fm-line-strong);
    border-radius: var(--fm-radius-lg);
    color: var(--fm-muted);
    background: rgba(255,255,255,.72);
    text-align: center;
}

.empty-state > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 1rem;
    border-radius: 18px;
    color: var(--fm-accent-dark);
    background: var(--fm-accent-soft);
    font-size: 1.4rem;
}

.empty-state h2,
.empty-state h3 {
    margin-bottom: .35rem;
}

.empty-state p {
    margin: 0 auto;
    max-width: 48ch;
}

.count-badge,
.tag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: .25rem .62rem;
    border-radius: 999px;
    color: var(--fm-accent-dark);
    background: var(--fm-accent-soft);
    font-size: .76rem;
    font-weight: 750;
    line-height: 1.1;
}

/* Reiseziele: zuerst geschlossen, sauberer Zustand und bündige Aktionen. */
.accordion-content,
.accordion-content[hidden] {
    display: none !important;
}

.accordion-item.is-open > .accordion-content {
    display: block !important;
}

.accordion-item.is-open > .accordion-title {
    border-bottom-color: var(--fm-line);
    background: linear-gradient(180deg, #f2fbf9, #fff);
}

.accordion-title {
    position: relative;
    padding-right: 3.25rem;
    cursor: pointer;
}

.accordion-title::after {
    content: '\f078';
    position: absolute;
    top: 50%;
    right: 1.15rem;
    margin: 0;
    color: var(--fm-muted);
    font-family: 'Font Awesome 5 Free';
    font-size: .75rem;
    font-weight: 900;
    transform: translateY(-50%);
    transition: transform .2s ease;
}

.accordion-item.is-open > .accordion-title::after {
    transform: translateY(-50%) rotate(180deg);
}

.accordion-content > .actions {
    display: flex;
    align-items: stretch;
    gap: .7rem;
}

.accordion-content > .actions form {
    display: flex !important;
    align-items: stretch;
    margin: 0 !important;
}

.accordion-content > .actions .button,
.accordion-content > .actions button {
    min-height: 44px;
    margin: 0 !important;
}

/* Währungsrechner */
.currency-card {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius-xl);
    background: rgba(255,255,255,.94);
    box-shadow: var(--fm-shadow-md);
}

.currency-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.currency-card-head h2 {
    margin: 0;
}

.currency-rate-badge {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    flex: 0 0 auto;
    padding: .45rem .7rem;
    border-radius: 999px;
    color: var(--fm-success);
    background: var(--fm-success-soft);
    font-size: .75rem;
    font-weight: 700;
}

.currency-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 1rem;
}

.currency-field {
    display: block;
    margin: 0;
    padding: 0;
}

.currency-field-label {
    display: block;
    margin-bottom: .5rem;
    color: var(--fm-ink);
    font-size: .86rem;
    font-weight: 750;
}

.currency-input-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
    min-height: 68px;
    overflow: hidden;
    border: 1px solid var(--fm-line-strong);
    border-radius: var(--fm-radius);
    background: #fff;
    box-shadow: var(--fm-shadow-xs);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.currency-input-shell:focus-within {
    border-color: var(--fm-accent);
    box-shadow: 0 0 0 4px rgba(22,139,130,.1);
}

.currency-code {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: 0 1rem;
    border-right: 1px solid var(--fm-line);
    color: var(--fm-ink);
    background: #f4f8f7;
    font-size: .88rem;
    font-weight: 800;
}

.currency-input-shell input {
    width: 100%;
    height: 100%;
    min-height: 66px;
    margin: 0;
    padding: .7rem 1rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--fm-ink);
    background: transparent;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 750;
    text-align: right;
}

.currency-input-shell input:focus {
    box-shadow: none;
}

.currency-equals {
    align-self: end;
    display: grid;
    place-items: center;
    width: 64px;
    min-width: 64px;
    height: 68px;
    min-height: 68px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--fm-line);
    border-radius: 20px;
    color: var(--fm-ink);
    background: linear-gradient(145deg, #f8fbfb, #eaf1f1);
    box-shadow: var(--fm-shadow-xs);
    font-size: 1.35rem;
    font-weight: 850;
    line-height: 1;
}


.currency-quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: 1.25rem;
}

.currency-quick > span {
    margin-right: .15rem;
    color: var(--fm-muted);
    font-size: .82rem;
    font-weight: 650;
}

.currency-quick button {
    min-height: 34px;
    padding: .42rem .7rem;
    border-radius: 999px;
    font-size: .75rem;
}

.currency-hint {
    margin: 1.2rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--fm-line);
    color: var(--fm-muted);
    font-size: .82rem;
}

/* Persönliches Benachrichtigungs-Center */
.notification-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, 980px);
    margin: 0 auto 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius);
    background: rgba(255,255,255,.88);
    box-shadow: var(--fm-shadow-xs);
}

.notification-summary > div {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    color: var(--fm-muted);
}

.notification-summary-count {
    color: var(--fm-ink);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.notification-summary form {
    margin: 0;
}

.notification-summary .is-hidden {
    display: none;
}

.notifications-list {
    display: grid;
    gap: .85rem;
    width: min(100%, 980px);
    margin: 0 auto;
    transition: opacity .2s ease, transform .2s ease;
}

.notifications-list.refresh-flash {
    opacity: .8;
    transform: translateY(-2px);
}

.notification-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius-lg);
    background: rgba(255,255,255,.94);
    box-shadow: var(--fm-shadow-sm);
}

.notification-card.is-unread {
    border-color: rgba(22,139,130,.3);
    background: linear-gradient(135deg, #fff, rgba(223,243,240,.72));
}

.notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    color: var(--fm-accent-dark);
    background: var(--fm-accent-soft);
    font-size: 1.1rem;
}

.notification-type-flight_checkin .notification-icon { color: #2f62a4; background: #eaf2ff; }
.notification-type-pretrip_weather .notification-icon,
.notification-type-daily_weather .notification-icon { color: #8a6511; background: #fff5d8; }
.notification-type-memory .notification-icon { color: #8a456b; background: #fbeaf4; }

.notification-main {
    min-width: 0;
}

.notification-topline {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}

.notification-type {
    color: var(--fm-muted);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.notification-new {
    padding: .16rem .42rem;
    border-radius: 999px;
    color: #fff;
    background: var(--fm-accent);
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.notification-card h2 {
    margin: 0 0 .28rem;
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    line-height: 1.35;
}

.notification-body {
    color: var(--fm-ink-soft);
    font-size: .92rem;
    line-height: 1.5;
}

.notification-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .9rem;
    margin-top: .55rem;
    color: var(--fm-muted);
    font-size: .76rem;
}

.notification-meta span,
.notification-meta a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}


.notification-delivery {
    padding: .16rem .42rem;
    border-radius: 999px;
    background: var(--fm-surface-soft);
    border: 1px solid var(--fm-line);
}
.notification-delivery-sent { color: var(--fm-accent-dark); }
.notification-delivery-vapid_error,
.notification-delivery-failed { color: var(--fm-danger); }

.notification-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.notification-actions form {
    display: flex;
    margin: 0;
}

.notification-open {
    white-space: nowrap;
}

.notification-icon-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 11px;
    color: var(--fm-muted) !important;
}

.notification-icon-button.is-danger {
    color: var(--fm-danger) !important;
    background: var(--fm-danger-soft);
}

/* Packliste */
.packlist-overview {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius-lg);
    background: rgba(255,255,255,.9);
    box-shadow: var(--fm-shadow-xs);
}

.packlist-progress-copy {
    display: grid;
    line-height: 1.25;
}

.packlist-progress-copy strong {
    color: var(--fm-ink);
}

.packlist-progress-copy span {
    color: var(--fm-muted);
    font-size: .78rem;
}

.packlist-progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7eeee;
}

.packlist-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--fm-accent), #54b7a8);
}

.packlist-progress-value {
    color: var(--fm-accent-dark);
    font-weight: 800;
}

.packlist-add-card {
    margin-bottom: 1rem;
}

.packlist-add-form > label {
    display: block;
    margin-bottom: .5rem;
    color: var(--fm-ink);
    font-size: .88rem;
    font-weight: 750;
}

.packlist-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .7rem;
}

.packlist-add-row input {
    margin: 0;
}

.packlist-panel {
    overflow: hidden;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius-lg);
    background: rgba(255,255,255,.94);
    box-shadow: var(--fm-shadow-sm);
}

.packlist-panel-head {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--fm-line);
}

.packlist-panel-head h2 {
    margin: 0;
}

.pack-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pack-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--fm-line);
    transition: background .18s ease;
}

.pack-item:last-child {
    border-bottom: 0;
}

.pack-item:hover {
    background: #f8fbfb;
}

.pack-item.is-packed {
    background: rgba(232,247,240,.58);
}

.pack-toggle-form,
.pack-delete-form,
.pack-edit-form {
    margin: 0;
}

.pack-toggle-form,
.pack-delete-form {
    display: flex;
}

.pack-edit-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
}

.pack-edit-form input {
    min-width: 0;
    margin: 0;
}

.pack-item.is-packed .pack-edit-form input {
    color: var(--fm-muted);
    text-decoration: line-through;
}

.pack-checkbox {
    display: inline-flex;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.pack-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pack-checkbox > span:not(.sr-only) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--fm-line-strong);
    border-radius: 10px;
    color: transparent;
    background: #fff;
    transition: all .18s ease;
}

.pack-checkbox input:checked + span {
    border-color: var(--fm-accent);
    color: #fff;
    background: var(--fm-accent);
}

.pack-checkbox input:focus-visible + span {
    outline: 3px solid rgba(22,139,130,.3);
    outline-offset: 2px;
}

/* Reise-Links */
.link-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.link-form-grid label {
    display: grid;
    gap: .4rem;
    margin: 0;
    color: var(--fm-ink);
    font-size: .86rem;
    font-weight: 750;
}

.link-form-grid input,
.link-form-grid textarea {
    margin: 0;
}

.link-form-grid .field-wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end;
}

.link-library {
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius-lg);
    background: rgba(255,255,255,.94);
    box-shadow: var(--fm-shadow-sm);
}

.link-library-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--fm-line);
}

.link-library-head h2 {
    margin: 0;
}

.trip-link-list {
    display: grid;
}

.trip-link-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--fm-line);
}

.trip-link-card:last-child {
    border-bottom: 0;
}

.trip-link-card.is-editing {
    background: #f8fbfb;
}

.trip-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: var(--fm-accent-dark);
    background: var(--fm-accent-soft);
}

.trip-link-copy {
    min-width: 0;
}

.trip-link-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}

.trip-link-heading > a {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--fm-ink);
    font-size: 1.04rem;
    font-weight: 750;
}

.trip-link-url {
    display: block;
    margin-top: .2rem;
    overflow: hidden;
    color: var(--fm-muted);
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trip-link-copy p {
    margin: .35rem 0 0;
    color: var(--fm-ink-soft);
    font-size: .88rem;
}

.trip-link-actions {
    display: grid;
    grid-template-columns: repeat(2, 132px);
    align-items: stretch;
    gap: .55rem;
}

.trip-link-actions form {
    display: flex;
    margin: 0;
}

.trip-link-actions .button,
.trip-link-actions button {
    width: 100%;
    min-height: 42px;
    margin: 0 !important;
}

.trip-link-edit {
    grid-column: 2 / -1;
    padding-top: 1rem;
    border-top: 1px solid var(--fm-line);
}

/* Hochauflösende Reisekacheln: Originale werden lazy geladen und sauber beschnitten. */
.page-dashboard .tiles article .image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    image-rendering: auto;
}

/* Hilfe bleibt erreichbar und erhält das gemeinsame Oberflächengefühl. */
.page-index .help-content-box,
.help-content-box {
    border-color: var(--fm-line) !important;
    border-radius: var(--fm-radius-lg) !important;
    box-shadow: var(--fm-shadow-sm);
}

.help-topic-btn {
    border-color: var(--fm-line) !important;
    border-radius: 12px !important;
    color: var(--fm-ink) !important;
    background: #fff !important;
}

.help-topic-item.help-topic-active .help-topic-btn {
    border-color: rgba(22,139,130,.35) !important;
    background: var(--fm-accent-soft) !important;
}

@media (max-width: 900px) {
    .currency-fields {
        grid-template-columns: 1fr;
    }

    .currency-equals {
        width: 58px;
        min-width: 58px;
        height: 42px;
        min-height: 42px;
        margin: .1rem auto;
        border-radius: 15px;
        transform: none;
    }

    .notification-card {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    
.notification-delivery {
    padding: .16rem .42rem;
    border-radius: 999px;
    background: var(--fm-surface-soft);
    border: 1px solid var(--fm-line);
}
.notification-delivery-sent { color: var(--fm-accent-dark); }
.notification-delivery-vapid_error,
.notification-delivery-failed { color: var(--fm-danger); }

.notification-actions {
        grid-column: 2;
        justify-content: flex-start;
    }

    .pack-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .pack-delete-form {
        grid-column: 2;
        justify-content: flex-end;
    }

    .trip-link-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .trip-link-actions,
    .trip-link-edit {
        grid-column: 2;
    }
}

@media (max-width: 640px) {
    .page-hero-compact h1 {
        font-size: clamp(1.8rem, 10vw, 2.7rem);
    }

    .currency-card-head,
    .notification-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .currency-rate-badge {
        white-space: normal;
    }

    .currency-code {
        padding: 0 .75rem;
    }

    .notification-card {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: .75rem;
        padding: .85rem;
    }

    .notification-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    
.notification-delivery {
    padding: .16rem .42rem;
    border-radius: 999px;
    background: var(--fm-surface-soft);
    border: 1px solid var(--fm-line);
}
.notification-delivery-sent { color: var(--fm-accent-dark); }
.notification-delivery-vapid_error,
.notification-delivery-failed { color: var(--fm-danger); }

.notification-actions {
        grid-column: 1 / -1;
        padding-left: 0;
    }

    .notification-open {
        flex: 1;
    }

    .packlist-overview {
        grid-template-columns: 1fr auto;
    }

    .packlist-progress-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .packlist-add-row,
    .pack-edit-form,
    .link-form-grid {
        grid-template-columns: 1fr;
    }

    .packlist-add-row .button,
    .pack-edit-form .button {
        width: 100%;
    }

    .pack-item {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .pack-edit-form,
    .pack-delete-form {
        grid-column: 2;
    }

    .pack-delete-form .button {
        width: 100%;
    }

    .link-form-grid .field-wide {
        grid-column: auto;
    }

    .form-actions .button {
        width: 100%;
    }

    .trip-link-card {
        grid-template-columns: 1fr;
        gap: .7rem;
    }

    .trip-link-icon {
        display: none;
    }

    .trip-link-actions,
    .trip-link-edit {
        grid-column: 1;
    }

    .trip-link-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .accordion-content > .actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .accordion-content > .actions form,
    .accordion-content > .actions .button,
    .accordion-content > .actions button {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .trip-link-actions,
    .accordion-content > .actions {
        grid-template-columns: 1fr;
    }
}

/* Frontend 1.1.2: Tastaturfokus der Reiseziele */
.accordion-title:focus-visible {
    outline: 3px solid rgba(22,139,130,.25);
    outline-offset: -3px;
}

/* =========================================================
   Frontend 1.1.3: Theme switch, kompakter Footer, Kalender
   ========================================================= */

/* Theme-Schalter */
.theme-toggle {
    position: relative;
    cursor: pointer;
}

.theme-toggle .theme-icon-sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle .theme-icon-moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle .theme-icon-sun {
    display: inline-block;
}

/* Footer: bewusst eine einzige, ruhige Zeile */
#footer {
    background: rgba(239, 244, 245, .9);
}

#footer > .inner.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.footer-identity {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: .55rem;
    color: var(--fm-muted);
    font-size: .78rem;
    white-space: nowrap;
}

.footer-identity img {
    width: 30px;
    height: 30px;
    padding: 5px;
    border-radius: 10px;
    background: var(--fm-surface);
    box-shadow: var(--fm-shadow-xs);
}

.footer-identity strong {
    color: var(--fm-ink);
    font-size: .82rem;
}

#footer .footer-links {
    flex: 0 1 auto;
    justify-content: flex-end;
    gap: .4rem 1rem;
}

#footer .footer-links a {
    white-space: nowrap;
}

/* Öffentlicher Währungsrechner change.php */
.currency-public-toolbar {
    width: min(100%, 980px);
    margin: 0 auto 1rem;
    padding: .85rem;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius);
    background: var(--fm-surface-glass);
    box-shadow: var(--fm-shadow-xs);
}

.currency-select-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .38fr);
    align-items: end;
    gap: .85rem;
    margin: 0;
}

.currency-select-control {
    display: grid;
    grid-template-rows: auto 64px;
    gap: .42rem;
    min-width: 0;
}

.currency-select-control label {
    margin: 0;
    color: var(--fm-ink);
    font-size: .86rem;
    font-weight: 750;
}

.currency-select-control select,
.currency-switch-button {
    width: 100%;
    height: 64px;
    min-height: 64px;
    margin: 0 !important;
    border-radius: 16px !important;
}

.currency-select-control select {
    padding-top: 0;
    padding-bottom: 0;
    font-size: 1rem;
    font-weight: 650;
}

.currency-switch-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    padding: 0 1.25rem !important;
    line-height: 1.2 !important;
    white-space: nowrap;
}

.page-change .currency-card,
.page-change .currency-error {
    width: min(100%, 980px);
    margin-right: auto;
    margin-left: auto;
}

/* Neuer Reisekalender */
.calendar-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: stretch;
    gap: .8rem;
    margin-bottom: 1rem;
}

.calendar-stat {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    padding: .9rem 1rem;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius);
    background: var(--fm-surface-glass);
    box-shadow: var(--fm-shadow-xs);
}

.calendar-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: var(--fm-accent-dark);
    background: var(--fm-accent-soft);
}

.calendar-stat > span:last-child {
    display: grid;
    line-height: 1.15;
}

.calendar-stat strong {
    color: var(--fm-ink);
    font-size: 1.2rem;
}

.calendar-stat small {
    color: var(--fm-muted);
    font-size: .72rem;
}

.calendar-map-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin: 0;
}

.trip-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    align-items: start;
    gap: 1rem;
}

.calendar-day-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius-lg);
    background: var(--fm-surface-glass);
    box-shadow: var(--fm-shadow-sm);
    transition: border-color .2s ease, transform .2s var(--fm-ease), box-shadow .2s ease;
}

.calendar-day-card:hover {
    border-color: rgba(22, 139, 130, .32);
    box-shadow: var(--fm-shadow-md);
    transform: translateY(-3px);
}

.calendar-day-card.is-today {
    border-color: rgba(22, 139, 130, .52);
    box-shadow: 0 18px 44px rgba(22, 139, 130, .14);
}

.calendar-day-card.is-free {
    box-shadow: var(--fm-shadow-xs);
}

.calendar-day-head {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin: 0;
    padding: 1rem;
    border-bottom: 1px solid var(--fm-line);
    background: linear-gradient(135deg, rgba(223, 243, 240, .72), rgba(255, 240, 231, .58));
}

.calendar-date-tile {
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    width: 58px;
    min-height: 60px;
    overflow: hidden;
    border: 1px solid rgba(22, 139, 130, .18);
    border-radius: 16px;
    background: rgba(255,255,255,.88);
    box-shadow: var(--fm-shadow-xs);
    line-height: 1;
}

.calendar-date-tile span {
    padding-top: .55rem;
    color: var(--fm-ink);
    font-size: 1.45rem;
    font-weight: 820;
}

.calendar-date-tile small {
    width: 100%;
    padding: .3rem .2rem .4rem;
    color: #fff;
    background: var(--fm-accent);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: center;
}

.calendar-day-kicker {
    display: block;
    margin-bottom: .18rem;
    color: var(--fm-accent-dark);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.calendar-day-head h2 {
    margin: 0;
    font-size: 1.18rem;
}

.calendar-day-events {
    display: grid;
    gap: .65rem;
    padding: .8rem;
}

.calendar-event {
    position: relative;
    display: grid;
    gap: .18rem;
    min-width: 0;
    padding: .8rem 2.5rem .8rem .85rem;
    border: 1px solid var(--fm-line);
    border-radius: 14px;
    color: var(--fm-ink-soft);
    background: var(--fm-surface);
    box-shadow: var(--fm-shadow-xs);
    transition: border-color .18s ease, background .18s ease, transform .18s var(--fm-ease);
}

.calendar-event:hover {
    border-color: rgba(22,139,130,.4);
    color: var(--fm-ink-soft) !important;
    background: var(--fm-accent-soft);
    transform: translateX(3px);
}

.calendar-event-time {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--fm-muted);
    font-size: .72rem;
    font-weight: 650;
}

.calendar-event strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--fm-ink);
    font-size: .96rem;
    line-height: 1.3;
}

.calendar-event-arrow {
    position: absolute;
    top: 50%;
    right: .9rem;
    color: var(--fm-accent-dark);
    transform: translateY(-50%);
}

.calendar-free-day {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 76px;
    padding: .85rem;
    border: 1px dashed var(--fm-line-strong);
    border-radius: 14px;
    color: var(--fm-muted);
    background: rgba(255,255,255,.34);
}

.calendar-free-day > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--fm-warning);
    background: var(--fm-warning-soft);
}

.calendar-free-day > div {
    display: grid;
    line-height: 1.3;
}

.calendar-free-day strong {
    color: var(--fm-ink-soft);
    font-size: .88rem;
}

.calendar-free-day span {
    font-size: .75rem;
}

/* Edler Dark Mode */
html[data-theme="dark"] {
    --fm-bg: #07111d;
    --fm-bg-soft: #0a1725;
    --fm-surface: #101f2e;
    --fm-surface-glass: rgba(15, 30, 45, .88);
    --fm-ink: #eef6ff;
    --fm-ink-soft: #bfd0df;
    --fm-muted: #8ea3b7;
    --fm-line: #26394b;
    --fm-line-strong: #344b60;
    --fm-brand: #ff7f91;
    --fm-brand-dark: #ff96a5;
    --fm-accent: #52c8bc;
    --fm-accent-dark: #7bd9cf;
    --fm-accent-soft: #143b3b;
    --fm-warm: #3b2730;
    --fm-danger: #ff8d9a;
    --fm-danger-soft: #3a1d27;
    --fm-success: #79d7ae;
    --fm-success-soft: #14372d;
    --fm-warning: #e7bc6d;
    --fm-warning-soft: #382d18;
    --fm-shadow-xs: 0 1px 2px rgba(0, 0, 0, .25);
    --fm-shadow-sm: 0 12px 30px rgba(0, 0, 0, .28);
    --fm-shadow-md: 0 22px 56px rgba(0, 0, 0, .38);
    --fm-shadow-lg: 0 32px 82px rgba(0, 0, 0, .48);
    color-scheme: dark;
    background: var(--fm-bg);
}

html[data-theme="dark"] body {
    color: var(--fm-ink-soft);
    background:
        radial-gradient(circle at 9% 4%, rgba(82, 200, 188, .14), transparent 30rem),
        radial-gradient(circle at 92% 10%, rgba(255, 127, 145, .12), transparent 32rem),
        linear-gradient(180deg, #081522 0, var(--fm-bg) 34rem, #09131e 100%);
}

html[data-theme="dark"] body::before {
    opacity: .42;
    background-image:
        linear-gradient(rgba(191, 208, 223, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(191, 208, 223, .035) 1px, transparent 1px);
}

html[data-theme="dark"] #header {
    border-bottom-color: rgba(52, 75, 96, .74);
    background: rgba(8, 20, 32, .84);
    box-shadow: 0 1px 0 rgba(255,255,255,.025);
}

html[data-theme="dark"] #header .logo .symbol img,
html[data-theme="dark"] .footer-identity img {
    background: linear-gradient(145deg, #172a3b, #0c1925);
    box-shadow: var(--fm-shadow-sm), inset 0 0 0 1px rgba(255,255,255,.045);
}

html[data-theme="dark"] #header nav.header-actions ul li a,
html[data-theme="dark"] #header nav.header-actions ul li button {
    border-color: var(--fm-line);
    color: var(--fm-ink) !important;
    background: rgba(16,31,46,.86);
}

html[data-theme="dark"] #header nav.header-actions ul li a:hover,
html[data-theme="dark"] #header nav.header-actions ul li button:hover {
    border-color: rgba(82,200,188,.52);
    color: var(--fm-accent-dark) !important;
    background: #15283a;
}

html[data-theme="dark"] #main > .inner > header:first-child,
html[data-theme="dark"] .page-hero {
    border-color: var(--fm-line);
    background:
        radial-gradient(circle at 85% 18%, rgba(255,127,145,.16), transparent 23rem),
        radial-gradient(circle at 6% 100%, rgba(82,200,188,.17), transparent 25rem),
        rgba(13,27,41,.86);
    box-shadow: var(--fm-shadow-sm);
}

html[data-theme="dark"] #main > .inner > header:first-child::after,
html[data-theme="dark"] .page-hero::after {
    border-color: rgba(82,200,188,.16);
    box-shadow:
        0 0 0 2.8rem rgba(82,200,188,.035),
        0 0 0 5.6rem rgba(255,127,145,.025);
}

html[data-theme="dark"] .box,
html[data-theme="dark"] .section-box,
html[data-theme="dark"] .info-box,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .currency-converter,
html[data-theme="dark"] .trip-card,
html[data-theme="dark"] .worldmap-wrap,
html[data-theme="dark"] .currency-card,
html[data-theme="dark"] .currency-public-toolbar,
html[data-theme="dark"] .notification-summary,
html[data-theme="dark"] .notification-card,
html[data-theme="dark"] .packlist-overview,
html[data-theme="dark"] .packlist-panel,
html[data-theme="dark"] .link-library,
html[data-theme="dark"] .calendar-stat,
html[data-theme="dark"] .calendar-day-card {
    border-color: var(--fm-line);
    background: var(--fm-surface-glass);
}

html[data-theme="dark"] .section-title,
html[data-theme="dark"] .packlist-panel-head,
html[data-theme="dark"] .link-library-head {
    border-color: var(--fm-line);
    background: linear-gradient(180deg, #132536, #0e1d2b);
}

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    border-color: var(--fm-line-strong);
    color: var(--fm-ink);
    background: rgba(11, 25, 38, .96);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.24);
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    color: var(--fm-ink);
    background: #102235;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #6f8599;
}

html[data-theme="dark"] input[type="checkbox"] + label::before,
html[data-theme="dark"] input[type="radio"] + label::before,
html[data-theme="dark"] .pack-checkbox > span:not(.sr-only) {
    border-color: var(--fm-line-strong);
    background: #0d1d2b;
}

html[data-theme="dark"] input[type="submit"],
html[data-theme="dark"] input[type="reset"],
html[data-theme="dark"] input[type="button"],
html[data-theme="dark"] button,
html[data-theme="dark"] .button {
    border-color: var(--fm-line-strong);
    color: var(--fm-ink) !important;
    background: rgba(17, 34, 50, .96);
}

html[data-theme="dark"] input[type="submit"]:hover,
html[data-theme="dark"] input[type="reset"]:hover,
html[data-theme="dark"] input[type="button"]:hover,
html[data-theme="dark"] button:hover,
html[data-theme="dark"] .button:hover {
    border-color: rgba(82,200,188,.55);
    color: var(--fm-accent-dark) !important;
    background: #172d40;
}

html[data-theme="dark"] input.primary,
html[data-theme="dark"] button.primary,
html[data-theme="dark"] .button.primary {
    border-color: transparent;
    color: #061418 !important;
    background: linear-gradient(135deg, #5ed4c8, #35a99f);
}

html[data-theme="dark"] .delete-button,
html[data-theme="dark"] .button.danger,
html[data-theme="dark"] button.danger {
    color: var(--fm-danger) !important;
    background: var(--fm-danger-soft);
}

html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] table {
    border-color: var(--fm-line);
    background: var(--fm-surface);
}

html[data-theme="dark"] table th {
    color: var(--fm-ink);
    background: #132536;
}

html[data-theme="dark"] table tbody tr:nth-child(2n + 1) {
    background: rgba(255,255,255,.018);
}

html[data-theme="dark"] .tiles article {
    border-color: var(--fm-line);
    background: var(--fm-surface);
}

html[data-theme="dark"] .notification-card.is-unread {
    border-color: rgba(82,200,188,.38);
    background: linear-gradient(135deg, #102333, rgba(20,59,59,.84));
}

html[data-theme="dark"] .notification-type-flight_checkin .notification-icon {
    color: #8cbcff;
    background: #142b4a;
}

html[data-theme="dark"] .notification-type-pretrip_weather .notification-icon,
html[data-theme="dark"] .notification-type-daily_weather .notification-icon {
    color: #e7bc6d;
    background: #382d18;
}

html[data-theme="dark"] .notification-type-memory .notification-icon {
    color: #e7a2ca;
    background: #3b2334;
}

html[data-theme="dark"] .pack-item:hover,
html[data-theme="dark"] .trip-link-card.is-editing {
    background: rgba(82,200,188,.055);
}

html[data-theme="dark"] .pack-item.is-packed {
    background: rgba(20,55,45,.62);
}

html[data-theme="dark"] .currency-input-shell {
    border-color: var(--fm-line-strong);
    background: #0b1926;
}

html[data-theme="dark"] .currency-code {
    border-color: var(--fm-line);
    color: var(--fm-ink);
    background: #142536;
}

html[data-theme="dark"] .currency-equals {
    border-color: var(--fm-line-strong);
    color: var(--fm-ink);
    background: linear-gradient(145deg, #172b3e, #102132);
}

html[data-theme="dark"] .calendar-day-head {
    background: linear-gradient(135deg, rgba(20,59,59,.84), rgba(59,39,48,.72));
}

html[data-theme="dark"] .calendar-date-tile,
html[data-theme="dark"] .calendar-event {
    border-color: var(--fm-line);
    background: #102132;
}

html[data-theme="dark"] .calendar-event:hover {
    background: #143b3b;
}

html[data-theme="dark"] .calendar-free-day {
    border-color: var(--fm-line-strong);
    background: rgba(255,255,255,.018);
}

html[data-theme="dark"] #footer {
    border-top-color: var(--fm-line);
    background: rgba(8, 20, 32, .9);
}

html[data-theme="dark"] #loading-circle {
    border-color: var(--fm-line) !important;
    background: rgba(13,27,41,.94) !important;
}

@media (max-width: 900px) {
    #footer > .inner.footer-row {
        flex-wrap: wrap;
    }

    #footer .footer-links {
        justify-content: flex-start;
    }

    .calendar-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-map-link {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    #footer > .inner.footer-row {
        align-items: flex-start;
        flex-direction: column;
        gap: .6rem;
    }

    .footer-identity {
        flex-wrap: wrap;
        white-space: normal;
    }

    #footer .footer-links {
        width: 100%;
        gap: .35rem .8rem;
    }

    .currency-select-form,
    .calendar-overview {
        grid-template-columns: 1fr;
    }

    .currency-select-form button,
    .calendar-map-link {
        width: 100%;
    }

    .calendar-map-link {
        grid-column: auto;
    }

    .trip-calendar-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .header-action-theme .theme-toggle {
        min-width: 42px !important;
        width: 42px;
        padding: 0 !important;
    }

    .footer-identity img {
        display: none;
    }
}

/* Dark-Mode-Nachzug für ältere Einzelkomponenten */
html[data-theme="dark"] .accordion-title,
html[data-theme="dark"] .accordion-content,
html[data-theme="dark"] .worldmap-legend,
html[data-theme="dark"] .notif-bubble,
html[data-theme="dark"] body.page-login #main form,
html[data-theme="dark"] body.page-register #main form,
html[data-theme="dark"] .share-section,
html[data-theme="dark"] .trip-map-actions > *,
html[data-theme="dark"] .lightbox-content,
html[data-theme="dark"] .message-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .help-topic-btn {
    border-color: var(--fm-line) !important;
    color: var(--fm-ink-soft) !important;
    background: var(--fm-surface) !important;
}

html[data-theme="dark"] .accordion-item.is-open > .accordion-title,
html[data-theme="dark"] .help-topic-item.help-topic-active .help-topic-btn {
    border-color: rgba(82,200,188,.42) !important;
    color: var(--fm-ink) !important;
    background: var(--fm-accent-soft) !important;
}

html[data-theme="dark"] .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup-tip {
    color: var(--fm-ink-soft);
    background: #102132;
}

html[data-theme="dark"] .error-message,
html[data-theme="dark"] .alert,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .success-message,
html[data-theme="dark"] [role="alert"] {
    border-color: var(--fm-line-strong);
    background: var(--fm-surface);
}

html[data-theme="dark"] table tbody tr,
html[data-theme="dark"] table tbody tr:nth-child(2n + 1) {
    background: var(--fm-surface);
}

html[data-theme="dark"] .trip-map-actions > *:hover {
    background: #172d40 !important;
}

/* ============================================================
   Frontend 1.1.4: öffentliche Reise-Freigabe
   ============================================================ */
body.page-share-trip #main > .inner {
    max-width: 1500px;
}

body.page-share-trip .share-trip-hero {
    overflow: visible;
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .7rem;
    color: var(--fm-accent-dark);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.share-trip-facts {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1.25rem;
}

.share-trip-facts > span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 38px;
    padding: .48rem .72rem;
    border: 1px solid rgba(202,215,220,.88);
    border-radius: 999px;
    color: var(--fm-ink-soft);
    background: rgba(255,255,255,.76);
    font-size: .78rem;
    font-weight: 680;
    box-shadow: var(--fm-shadow-xs);
}

.share-trip-facts i {
    color: var(--fm-accent-dark);
}

.share-map-empty {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 260px;
    padding: 2rem;
    border: 1px dashed var(--fm-line-strong);
    border-radius: 20px;
    color: var(--fm-muted);
    background: rgba(255,255,255,.6);
    text-align: center;
}

.share-map-empty i {
    margin-bottom: .75rem;
    color: var(--fm-accent-dark);
    font-size: 2rem;
}

.share-map-empty strong {
    color: var(--fm-ink);
}

.share-map-empty span {
    margin-top: .25rem;
    font-size: .82rem;
}

.share-trip-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.25rem;
    margin: clamp(2.2rem, 5vw, 4rem) 0 1rem;
}

.share-trip-intro h2 {
    margin: 0;
}

.share-trip-intro p {
    max-width: 68ch;
    margin: .35rem 0 0;
    color: var(--fm-muted);
}

.share-destination-list {
    display: grid;
    gap: .9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.share-destination-card {
    scroll-margin-top: calc(var(--fm-header-height) + 1rem);
}

.share-destination-card > .accordion-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .9rem;
    min-height: 94px;
    margin: 0;
    padding: 1rem 3.6rem 1rem 1rem;
}

.share-destination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--fm-accent), var(--fm-accent-dark));
    box-shadow: 0 8px 20px rgba(22,139,130,.22);
    font-size: .86rem;
    font-weight: 820;
}

.share-destination-heading {
    display: grid;
    min-width: 0;
    gap: .35rem;
}

.share-destination-name {
    overflow-wrap: anywhere;
    color: var(--fm-ink);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 800;
    letter-spacing: -.025em;
}

.share-destination-card .dest-meta {
    color: var(--fm-muted);
    font-size: .76rem;
    font-weight: 600;
}

.share-destination-card .dest-meta > span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.share-destination-card .accordion-content {
    padding: clamp(1rem, 3vw, 1.45rem);
}

.share-destination-content-grid {
    display: grid;
    gap: 1rem;
}

.share-destination-card .section-box {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--fm-line);
    border-radius: 16px;
    background: rgba(255,255,255,.82);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 52px;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--fm-line);
    background: linear-gradient(180deg, #f8fbfb, #f2f7f7);
}

.section-title-row h4 {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    color: var(--fm-ink);
    font-size: .92rem;
}

.section-title-row h4 i {
    color: var(--fm-accent-dark);
}

.share-destination-card .section-content {
    padding: 1rem;
    background: transparent;
}

.share-richtext {
    overflow-wrap: anywhere;
    color: var(--fm-ink-soft);
}

.share-richtext > :last-child {
    margin-bottom: 0;
}

.share-richtext table {
    width: 100%;
}

.share-document-list {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.share-document-list .button {
    margin: 0;
}

.share-destination-location {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .85rem;
    padding: .9rem 1rem;
    border: 1px solid var(--fm-line);
    border-radius: 16px;
    background: linear-gradient(135deg, var(--fm-accent-soft), rgba(255,255,255,.92));
}

.share-destination-location > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    color: var(--fm-accent-dark);
    background: #fff;
    box-shadow: var(--fm-shadow-xs);
}

.share-destination-location > div {
    display: grid;
    min-width: 0;
}

.share-destination-location span {
    overflow: hidden;
    color: var(--fm-muted);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-destination-location .button {
    margin: 0;
}

.empty-state.compact {
    min-height: 0;
    padding: 1.2rem;
}

.empty-state.compact i {
    width: 42px;
    height: 42px;
    margin-bottom: .5rem;
    font-size: 1rem;
}

.trip-hero-map-shell.is-expanded {
    position: fixed;
    inset: calc(var(--fm-header-height) + .75rem) .75rem .75rem;
    z-index: 9000;
    min-height: 0;
    border-radius: 24px;
    box-shadow: 0 30px 100px rgba(4,19,31,.38);
}

.trip-hero-map-shell.is-expanded #map {
    min-height: 100%;
}

body.has-expanded-map {
    overflow: hidden;
}

.share-map-popup {
    display: grid;
    min-width: 150px;
    gap: .25rem;
}

.share-map-popup-image {
    width: 100%;
    max-height: 105px;
    margin-bottom: .35rem;
    border-radius: 8px;
    object-fit: cover;
}

.share-map-popup strong {
    color: #14263a;
}

.share-map-popup span {
    color: #68798a;
    font-size: .75rem;
}

.share-map-popup a {
    margin-top: .2rem;
    font-weight: 750;
}

.share-image-dialog {
    width: min(94vw, 1400px);
    max-width: none;
    max-height: 92vh;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 22px;
    background: #07131f;
    box-shadow: 0 30px 110px rgba(0,0,0,.55);
}

.share-image-dialog::backdrop {
    background: rgba(4,13,22,.82);
    backdrop-filter: blur(8px);
}

.share-image-dialog img {
    display: block;
    width: 100%;
    max-height: 88vh;
    border-radius: 22px;
    object-fit: contain;
}

.share-image-dialog-close {
    position: absolute;
    top: .7rem;
    right: .7rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 13px;
    color: #fff;
    background: rgba(5,18,29,.78);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

html[data-theme="dark"] .share-trip-facts > span,
html[data-theme="dark"] .share-destination-card .section-box,
html[data-theme="dark"] .share-map-empty {
    border-color: var(--fm-line);
    color: var(--fm-ink-soft);
    background: rgba(13,30,44,.82);
}

html[data-theme="dark"] .section-title-row {
    background: linear-gradient(180deg, rgba(21,45,61,.96), rgba(13,31,45,.96));
}

html[data-theme="dark"] .share-destination-location {
    background: linear-gradient(135deg, rgba(22,139,130,.15), rgba(11,27,40,.94));
}

html[data-theme="dark"] .share-destination-location > i {
    background: rgba(255,255,255,.08);
}

@media screen and (max-width: 736px) {
    .share-trip-intro {
        align-items: flex-start;
    }

    .share-destination-card > .accordion-title {
        grid-template-columns: auto minmax(0, 1fr);
        gap: .7rem;
        min-height: 82px;
        padding: .85rem 3rem .85rem .8rem;
    }

    .share-destination-card .dest-header-right {
        grid-column: 2;
        justify-self: start;
    }

    .share-destination-number {
        align-self: start;
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .share-destination-location {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .share-destination-location .button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .trip-hero-map-shell.is-expanded {
        inset: var(--fm-header-height) 0 0;
        border-radius: 0;
    }
}

@media screen and (max-width: 480px) {
    .share-trip-intro {
        display: grid;
    }

    .share-trip-facts {
        display: grid;
    }

    .share-trip-facts > span {
        width: 100%;
    }
}

/* Frontend 1.1.5: langlebiger Geräte-Login */
body.page-login .remember-login-field {
    margin-top: .15rem;
    padding: .9rem 1rem;
    border: 1px solid var(--fm-line);
    border-radius: 14px;
    background: rgba(248, 251, 251, .9);
}

body.page-login .remember-login-field > label {
    display: grid;
    gap: .15rem;
    max-width: 100%;
    margin: 0;
    padding-top: .02rem;
}

body.page-login .remember-login-field > label strong {
    color: var(--fm-ink);
    font-size: .98rem;
    line-height: 1.25;
}

body.page-login .remember-login-field > label span {
    color: var(--fm-ink-soft);
    font-size: .84rem;
    line-height: 1.45;
}

html[data-theme="dark"] body.page-login .remember-login-field {
    border-color: var(--fm-line);
    background: rgba(18, 34, 47, .72);
}

/* ===== Frontend 1.1.9: Reisebilder im Kopf ===== */
.hero-has-image {
    background:
        linear-gradient(118deg, rgba(10, 22, 35, .82) 0%, rgba(10, 22, 35, .66) 34%, rgba(10, 22, 35, .25) 70%, rgba(255,255,255,.06) 100%),
        radial-gradient(circle at 84% 16%, rgba(233, 102, 121, .18), transparent 23rem),
        radial-gradient(circle at 6% 100%, rgba(22, 139, 130, .16), transparent 24rem),
        var(--fm-hero-image) center center / cover no-repeat,
        rgba(255,255,255,.82) !important;
}

.hero-has-image::after {
    border-color: rgba(255,255,255,.13) !important;
    box-shadow:
        0 0 0 2.8rem rgba(255,255,255,.035),
        0 0 0 5.6rem rgba(255,255,255,.014) !important;
}

.trip-hero.hero-has-image .trip-hero-copy h1,
.trip-hero.hero-has-image .trip-hero-copy h2,
.trip-hero.hero-has-image .trip-hero-copy .page-eyebrow,
.page-hero.hero-has-image > h1,
.page-hero.hero-has-image > h2,
.page-hero.hero-has-image > p,
.page-hero.hero-has-image > .page-eyebrow {
    color: #f8fbff !important;
    text-shadow: 0 8px 28px rgba(4, 12, 20, .48);
}

.trip-hero.hero-has-image .trip-hero-copy h2,
.page-hero.hero-has-image > p {
    color: rgba(248, 251, 255, .91) !important;
}

.page-hero.hero-has-image > .page-eyebrow,
.trip-hero.hero-has-image .trip-hero-copy .page-eyebrow {
    width: fit-content;
    padding: .42rem .68rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(7, 17, 27, .28);
    backdrop-filter: blur(10px);
}

.trip-hero.hero-has-image .share-trip-facts span {
    border-color: rgba(255,255,255,.14);
    color: rgba(248,251,255,.95);
    background: rgba(7,17,27,.38);
    box-shadow: none;
    backdrop-filter: blur(9px);
}

html[data-theme="dark"] .hero-has-image {
    background:
        linear-gradient(118deg, rgba(4, 12, 20, .86) 0%, rgba(5, 16, 27, .74) 36%, rgba(6, 16, 26, .34) 72%, rgba(5,11,19,.12) 100%),
        radial-gradient(circle at 84% 16%, rgba(255,127,145,.16), transparent 23rem),
        radial-gradient(circle at 6% 100%, rgba(82,200,188,.15), transparent 24rem),
        var(--fm-hero-image) center center / cover no-repeat,
        rgba(13,27,41,.86) !important;
}

@media screen and (max-width: 736px) {
    .hero-has-image {
        background-position: center center !important;
    }
}

/* ===== Ziel bearbeiten: touchfreundliche Karte ===== */
.edit-map-shell {
    position: relative;
    width: 100%;
    height: clamp(300px, 42vw, 430px);
    margin: 1rem 0 1.5rem;
    overflow: hidden;
    border: 1px solid var(--fm-line);
    border-radius: 20px;
    background: #dfeae8;
    box-shadow: var(--fm-shadow-sm);
}

.edit-map-shell #map {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 20px !important;
}

.edit-map-actions {
    position: absolute;
    right: .65rem;
    bottom: .65rem;
    z-index: 800;
    pointer-events: none;
}

.edit-map-actions button {
    min-height: 40px;
    margin: 0;
    padding: .58rem .78rem;
    border: 1px solid rgba(21,38,58,.16);
    border-radius: 11px;
    color: var(--fm-ink) !important;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 22px rgba(17,38,57,.16);
    font-size: .76rem;
    font-weight: 760;
    line-height: 1;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.edit-map-shell.is-map-locked #map,
.edit-map-shell.is-map-locked .leaflet-container {
    cursor: default !important;
}

html[data-theme="dark"] .edit-map-actions button {
    border-color: rgba(255,255,255,.12);
    color: #f5f9fc !important;
    background: rgba(11,27,41,.92);
}

@media (pointer: fine) {
    .edit-map-interaction-toggle { display: none !important; }
}
