/* Startseite: NEU-Karte für den Plan, darunter alle Anwendungen als Kacheln */

.home-page {
    --home-teal: #3c7f8b;
    --home-gold: #d68f00;
    --home-red: #bf2f13;
    --home-neutral: #9a9a9a;

    box-sizing: border-box;
    width: min(100%, 1040px);
    margin: 0 auto;
    padding: clamp(14px, 4vw, 36px) clamp(12px, 3vw, 28px) calc(96px + env(safe-area-inset-bottom));
    color: var(--theme-body-text);
}

html:has(.home-page),
body:has(.home-page) {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html:has(.home-page)::-webkit-scrollbar,
body:has(.home-page)::-webkit-scrollbar {
    display: none;
}

.home-page *,
.home-page *::before,
.home-page *::after {
    box-sizing: border-box;
}

/* ---- NEU-Karte ---- */

.home-feature {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(16px, 4vw, 40px);
    padding: clamp(20px, 4vw, 40px);
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(60, 127, 139, 0.22), transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        var(--theme-surface-1);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.22);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.home-feature:hover {
    color: inherit;
    border-color: var(--theme-border-strong);
    transform: translateY(-2px);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.28);
}

.home-feature:focus-visible {
    outline: 3px solid var(--theme-accent);
    outline-offset: 3px;
}

.home-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.home-feature-title {
    margin: 14px 0 10px;
    color: var(--theme-text-strong);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.1;
}

.home-feature-lead {
    max-width: 46ch;
    margin: 0 0 22px;
    color: var(--theme-text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

.home-feature-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
}

.home-feature:hover .home-feature-button .mdi {
    transform: translateX(3px);
}

.home-feature-button .mdi {
    transition: transform 160ms ease;
}

/* Kleine Plan-Vorschau */

.home-feature-art {
    position: relative;
    justify-self: center;
    width: min(100%, 300px);
}

.home-art-sheet {
    display: grid;
    gap: 7px;
    padding: 16px 16px 20px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
    transform: rotate(2deg);
}

.home-art-head {
    height: 14px;
    margin-bottom: 4px;
    border-radius: 4px;
    background: #eceef0;
}

.home-art-row {
    --home-section: var(--home-neutral);

    display: grid;
    grid-template-columns: 1fr 34%;
    gap: 8px;
    padding-left: 8px;
    border-left: 4px solid var(--home-section);
}

.home-art-row[data-section="1"] { --home-section: var(--home-teal); }
.home-art-row[data-section="2"] { --home-section: var(--home-gold); }
.home-art-row[data-section="3"] { --home-section: var(--home-red); }

.home-art-row i,
.home-art-row b {
    height: 9px;
    border-radius: 3px;
}

.home-art-row i {
    background: #d9dcdf;
}

.home-art-row b {
    border-bottom: 2px dotted #c4c8cc;
    border-radius: 0;
}

.home-art-row b.filled {
    border: 0;
    border-radius: 3px;
    background: #4a4f55;
}

.home-art-pdf {
    position: absolute;
    right: -10px;
    bottom: -18px;
    font-size: 64px;
    line-height: 1;
    color: #dc3545;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

/* ---- Alle Anwendungen ---- */

.home-section-title {
    margin: clamp(28px, 5vw, 44px) 0 14px;
    color: var(--theme-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.home-apps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.home-app {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 12px 14px;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-1);
    color: var(--theme-text-strong);
    text-decoration: none;
    transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.home-app:hover {
    color: var(--theme-text-strong);
    border-color: var(--theme-border-strong);
    background: var(--theme-surface-2);
    transform: translateY(-1px);
}

.home-app:focus-visible {
    outline: 3px solid var(--theme-accent);
    outline-offset: 2px;
}

.home-app-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--theme-accent-soft);
    color: var(--theme-accent-strong);
    font-size: 22px;
}

.home-app-icon .zoll-icon {
    width: 26px;
    height: 26px;
}

.home-app-label {
    font-weight: 600;
    line-height: 1.25;
}

/* ---- Weitere Web-Apps (andere Seiten, xmm.at) ---- */

.home-webapps {
    --home-ext: #a78bfa;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.home-webapp {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 40px 12px 14px;
    border: 1px solid color-mix(in srgb, var(--home-ext) 38%, transparent);
    border-radius: 16px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--home-ext) 16%, transparent), transparent 65%),
        var(--theme-surface-1);
    color: var(--theme-text-strong);
    text-decoration: none;
    transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.home-webapp:hover {
    color: var(--theme-text-strong);
    border-color: color-mix(in srgb, var(--home-ext) 70%, transparent);
    box-shadow: 0 10px 26px color-mix(in srgb, var(--home-ext) 18%, transparent);
    transform: translateY(-1px);
}

.home-webapp:focus-visible {
    outline: 3px solid var(--home-ext);
    outline-offset: 2px;
}

.home-webapp-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--home-ext) 20%, transparent);
    color: var(--home-ext);
    font-size: 24px;
}

.home-webapp-icon .zoll-icon {
    width: 28px;
    height: 28px;
}

.home-webapp-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.home-webapp-label {
    font-weight: 700;
    line-height: 1.2;
}

.home-webapp-host {
    overflow: hidden;
    color: var(--theme-text-muted);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pfeil oben rechts: zeigt, dass es eine andere Seite ist */
.home-webapp-arrow {
    position: absolute;
    top: 10px;
    right: 12px;
    color: color-mix(in srgb, var(--home-ext) 80%, var(--theme-text-muted));
    font-size: 18px;
    line-height: 1;
    transition: transform 140ms ease;
}

.home-webapp:hover .home-webapp-arrow {
    transform: translate(2px, -2px);
}

/* ---- Handy ---- */

@media (max-width: 720px) {
    .home-feature {
        grid-template-columns: 1fr;
    }

    .home-feature-art {
        order: -1;
        width: min(70%, 240px);
    }

    .home-feature-button {
        width: 100%;
        justify-content: center;
    }

    .home-apps {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
