:root {
    --ink: #241b2d;
    --muted: #746a7c;
    --cream: #f8f3eb;
    --paper: rgba(255, 252, 247, .82);
    --purple: #7652a4;
    --purple-dark: #51366f;
    --pink: #d284b7;
    --teal: #2f8f8a;
    --line: rgba(54, 38, 65, .12);
    --danger: #b64f60;
    --shadow: 0 24px 70px rgba(53, 34, 65, .13);
    --radius: 30px
}

* {
    box-sizing: border-box
}

[hidden] {
    display: none !important
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "DM Sans", system-ui, sans-serif;
    background: #f4eee7;
    overflow-x: hidden
}

button,
input,
textarea {
    font: inherit
}

.ambient {
    position: fixed;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
    z-index: -1
}

.ambient-one {
    width: 48vw;
    height: 48vw;
    left: -18vw;
    top: -20vw;
    background: radial-gradient(circle, #dfc5e7 0, rgba(223, 197, 231, 0) 70%)
}

.ambient-two {
    width: 45vw;
    height: 45vw;
    right: -16vw;
    bottom: -20vw;
    background: radial-gradient(circle, #bbded5 0, rgba(187, 222, 213, 0) 70%)
}

.app-header {
    height: 86px;
    max-width: 1240px;
    margin: auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 10px;
    color: #fff;
    background: var(--ink);
    transform: rotate(-6deg)
}

.app-title {
    font-size: 1.08rem
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    background: rgba(255, 255, 255, .48);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 999px
}

.nav-btn {
    border: 0;
    background: transparent;
    padding: 9px 17px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer
}

.nav-btn.is-active {
    color: #fff;
    background: var(--ink);
    box-shadow: 0 5px 14px rgba(36, 27, 45, .2)
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: .8rem;
    max-width: 230px
}

.logout-btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .5);
    color: var(--ink);
    padding: 8px 11px;
    border-radius: 12px;
    cursor: pointer
}

.app-main {
    max-width: 1240px;
    margin: auto;
    padding: 24px 32px 70px
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(440px, 1.05fr) minmax(390px, .85fr);
    gap: clamp(40px, 7vw, 100px);
    align-items: center;
    min-height: calc(100vh - 180px)
}

.pet-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0
}

.stage-copy {
    position: relative;
    z-index: 3;
    max-width: 550px
}

.eyebrow,
.panel-kicker {
    margin: 0 0 10px;
    color: var(--teal);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em
}

.stage-copy h1 {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.5rem, 5vw, 4.9rem);
    line-height: .95;
    letter-spacing: -.06em;
    margin: 0;
    max-width: 650px
}

.stage-copy>p:last-child {
    margin: 17px 0 0;
    color: var(--muted);
    font-size: 1.02rem
}

.pet-frame {
    position: relative;
    width: min(100%, 620px);
    height: clamp(340px, 45vw, 560px);
    display: grid;
    place-items: center;
    margin-top: -15px
}

.pet-glow {
    position: absolute;
    width: 64%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(210, 132, 183, .5), rgba(118, 82, 164, .14) 48%, transparent 70%);
    filter: blur(8px);
    animation: glow 5s ease-in-out infinite
}

.orbit {
    position: absolute;
    border: 1px solid rgba(81, 54, 111, .15);
    border-radius: 50%;
    transform: rotate(-12deg)
}

.orbit-one {
    width: 86%;
    height: 62%
}

.orbit-two {
    width: 70%;
    height: 82%;
    transform: rotate(54deg)
}

.orbit:after {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--teal);
    top: 13%;
    left: 9%;
    box-shadow: 0 0 0 7px rgba(47, 143, 138, .1)
}

.pet-image {
    position: relative;
    z-index: 2;
    width: 88%;
    height: 88%;
    object-fit: contain;
    filter: drop-shadow(0 28px 20px rgba(45, 30, 55, .2));
    transition: opacity .75s cubic-bezier(.4, 0, .2, 1),
        transform .75s cubic-bezier(.4, 0, .2, 1)
}

/* Zwei uebereinanderliegende Bild-Ebenen fuer weiches Crossfade. */
.pet-stack {
    position: relative;
    z-index: 2;
    width: 88%;
    height: 88%;
    display: grid;
    place-items: center
}

.pet-stack .pet-image {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%
}

.pet-image-next {
    pointer-events: none
}

.pet-image.is-fading {
    opacity: 0
}

.pet-image.is-breathing {
    animation: breathe 4.4s ease-in-out infinite
}

.pet-overlay {
    display: none
}

.pet-status {
    position: absolute;
    z-index: 3;
    right: 1%;
    bottom: 8%;
    width: 190px;
    padding: 15px 17px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 18px;
    background: rgba(255, 252, 247, .7);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px rgba(53, 34, 65, .1)
}

.pet-status:empty {
    display: none
}

.level-line {
    font-family: "Space Grotesk";
    font-weight: 700;
    margin-bottom: 8px
}

.progress-bar {
    height: 7px;
    border-radius: 99px;
    background: rgba(36, 27, 45, .1);
    overflow: hidden
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--purple));
    transition: width .5s
}

.progress-label {
    margin-top: 7px;
    font-size: .67rem;
    color: var(--muted)
}

.content-col {
    min-width: 0
}

.panel {
    padding: clamp(25px, 4vw, 42px);
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px)
}

.section-title {
    font-family: "Space Grotesk";
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    line-height: 1.08;
    letter-spacing: -.035em;
    margin: 0 0 25px
}

.field {
    display: flex;
    flex-direction: column;
    gap: 9px;
    color: var(--ink);
    font-size: .84rem;
    font-weight: 600
}

.field small {
    font-weight: 400;
    color: var(--muted)
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .62);
    color: var(--ink);
    padding: 14px 16px;
    outline: none;
    transition: .2s
}

textarea {
    resize: vertical;
    min-height: 92px
}

input:focus,
textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(118, 82, 164, .12);
    background: #fff
}

::placeholder {
    color: #a29aa7
}

.form-error {
    margin: 0;
    color: var(--danger);
    font-size: .83rem;
    font-weight: 600
}

.primary-btn,
.secondary-btn,
.text-btn,
.icon-btn {
    border: 0;
    cursor: pointer
}

.primary-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 18px;
    border-radius: 16px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 25px rgba(36, 27, 45, .2);
    transition: .2s
}

.primary-btn:hover {
    transform: translateY(-2px);
    background: var(--purple-dark)
}

.primary-btn:disabled {
    opacity: .55;
    transform: none
}

.secondary-btn {
    padding: 13px 18px;
    border-radius: 14px;
    background: rgba(118, 82, 164, .1);
    color: var(--purple-dark);
    font-weight: 700
}

.text-btn {
    padding: 8px;
    background: none;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px
}

.danger-btn {
    color: var(--danger)
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(118, 82, 164, .1);
    color: var(--purple);
    font-size: 1.25rem
}

.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
}

.auth-tabs {
    display: flex;
    padding: 5px;
    margin-bottom: 19px;
    border-radius: 15px;
    background: rgba(36, 27, 45, .06)
}

.auth-tab {
    flex: 1;
    border: 0;
    border-radius: 11px;
    background: transparent;
    padding: 10px;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer
}

.auth-tab.is-active {
    background: #fff;
    color: var(--purple-dark);
    box-shadow: 0 5px 15px rgba(36, 27, 45, .08)
}

.auth-form,
.session-setup,
.session-reflect {
    display: flex;
    flex-direction: column;
    gap: 17px
}

.demo-hint,
.micro-copy {
    margin: 14px 0 0;
    text-align: center;
    font-size: .72rem;
    color: var(--muted)
}

.task-field textarea {
    font-family: "Space Grotesk";
    font-size: 1.08rem
}

.duration-field {
    border: 0;
    padding: 0;
    margin: 0
}

.duration-field legend {
    padding: 0;
    margin-bottom: 9px
}

.duration-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px
}

.preset-btn,
.rating-btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .55);
    color: var(--ink);
    border-radius: 13px;
    padding: 11px 5px;
    font-weight: 700;
    cursor: pointer
}

.preset-btn.is-active,
.rating-btn.is-active {
    border-color: var(--purple);
    background: var(--purple);
    color: #fff
}

.custom-duration {
    margin-top: 8px;
    color: var(--muted);
    font-size: .78rem
}

.custom-duration summary {
    cursor: pointer;
    width: max-content
}

.custom-duration input {
    margin-top: 8px
}

.start-btn {
    margin-top: 2px
}

.session-running,
.session-result {
    display: flex;
    min-height: 375px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 18px
}

.countdown {
    font-family: "Space Grotesk";
    font-size: clamp(4.3rem, 9vw, 7rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.08em;
    color: var(--purple-dark);
    font-variant-numeric: tabular-nums
}

.running-note {
    max-width: 360px;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600
}

.running-hint {
    margin: 0;
    color: var(--muted);
    font-size: .84rem
}

.success-spark {
    font-size: 3rem;
    color: var(--teal)
}

.result-message {
    font-family: "Space Grotesk";
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 0
}

.levelup-message {
    color: var(--teal);
    font-weight: 700
}

.grow-btn {
    max-width: 310px
}

.rating-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px
}

.rating-btn {
    aspect-ratio: 1;
    padding: 0
}

.stats-header {
    display: flex;
    align-items: start;
    justify-content: space-between
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px
}

.summary-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(118, 82, 164, .07)
}

.summary-value {
    font-family: "Space Grotesk";
    font-size: 1.45rem;
    font-weight: 700
}

.summary-label {
    font-size: .7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em
}

.stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 390px;
    overflow: auto
}

.session-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .42)
}

.session-item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px
}

.status-badge,
.session-date,
.session-meta {
    font-size: .7rem;
    color: var(--muted)
}

.status-badge {
    font-weight: 700;
    color: var(--teal)
}

.status-badge.is-aborted {
    color: var(--danger)
}

.session-meta {
    margin: 7px 0
}

.session-note {
    font-size: .8rem
}

.note-label {
    font-weight: 700
}

.stats-empty {
    color: var(--muted);
    text-align: center;
    padding: 40px 0
}

.pet-detail-panel>p {
    color: var(--muted);
    line-height: 1.6
}

.pet-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 25px 0
}

.pet-facts>div {
    padding: 18px;
    border-radius: 18px;
    background: rgba(118, 82, 164, .08)
}

.pet-facts strong,
.pet-facts span {
    display: block
}

.pet-facts strong {
    font-family: "Space Grotesk";
    font-size: 1.15rem
}

.pet-facts span {
    color: var(--muted);
    font-size: .72rem;
    margin-top: 5px
}

.pet-note {
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: .84rem
}

@keyframes breathe {

    0%,
    100% {
        transform: translateY(0) scale(1)
    }

    50% {
        transform: translateY(-7px) scale(1.012)
    }
}

@keyframes glow {

    0%,
    100% {
        transform: scale(.94);
        opacity: .75
    }

    50% {
        transform: scale(1.05);
        opacity: 1
    }
}

.pet-image[data-state="wuetend"] {
    animation: shake .45s ease
}

.pet-image[data-state="wachsen"] {
    animation: pop .7s cubic-bezier(.2, 1.6, .4, 1)
}

@keyframes shake {
    25% {
        transform: translateX(-6px) rotate(-2deg)
    }

    75% {
        transform: translateX(6px) rotate(2deg)
    }
}

@keyframes pop {
    50% {
        transform: scale(1.1) translateY(-9px)
    }
}

@media(max-width:900px) {
    .app-header {
        height: auto;
        min-height: 74px;
        padding: 16px 20px;
        flex-wrap: wrap
    }

    .auth-status span {
        display: none
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center
    }

    .nav-btn {
        flex: 1
    }

    .app-main {
        padding: 15px 20px 50px
    }

    .app-layout {
        grid-template-columns: 1fr;
        gap: 8px;
        min-height: 0
    }

    .pet-stage {
        align-items: center;
        text-align: center
    }

    .stage-copy h1 {
        font-size: clamp(2.5rem, 12vw, 4rem)
    }

    .pet-frame {
        height: min(115vw, 510px);
        margin-top: -25px
    }

    .pet-status {
        right: 3%;
        bottom: 5%;
        text-align: left
    }

    .panel {
        margin-top: -14px;
        position: relative;
        z-index: 4
    }

    .content-col {
        width: 100%
    }
}

@media(max-width:520px) {
    .app-title {
        font-size: .98rem
    }

    .app-header {
        gap: 10px
    }

    .main-nav {
        overflow: auto
    }

    .nav-btn {
        padding: 8px 10px;
        font-size: .78rem
    }

    .app-main {
        padding-inline: 14px
    }

    .stage-copy>p:last-child {
        font-size: .9rem
    }

    .pet-frame {
        height: 390px
    }

    .pet-image {
        width: 105%;
        height: 105%
    }

    .pet-status {
        width: 165px;
        padding: 11px 13px
    }

    .panel {
        padding: 24px 19px;
        border-radius: 24px
    }

    .duration-presets {
        grid-template-columns: repeat(3, 1fr)
    }

    .duration-presets .preset-btn:last-child {
        grid-column: span 2
    }

    .countdown {
        font-size: 4.7rem
    }

    .stats-summary {
        grid-template-columns: 1fr 1fr
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto
    }

    .pet-glow,
    .pet-image {
        animation: none !important;
        transition: none !important
    }
}

.duration-presets {
    grid-template-columns: repeat(4, 1fr)
}

@media(max-width:520px) {
    .duration-presets {
        grid-template-columns: repeat(2, 1fr)
    }

    .duration-presets .preset-btn:last-child {
        grid-column: auto
    }

    .pet-image {
        width: 100%;
        height: 100%
    }
}

/* --- To-Dos --- */
:root {
    /* 1 = wichtigste (rot) ... 5 = unwichtigste (grün) */
    --prio-1: #d24f5f;
    --prio-2: #e08640;
    --prio-3: #e0b03a;
    --prio-4: #8bb64f;
    --prio-5: #3f9d6b
}

/* Vollbreiten-Layout: wenn To-Dos oder Statistik aktiv sind, Tier-Stage weg. */
body.view-todos .app-layout,
body.view-stats .app-layout {
    display: none
}

/* --- Statistik (Vollbreite, ohne Tier) --- */
.stats-fullpage {
    max-width: 1000px;
    margin: 0 auto
}

.stats-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px
}

.stats-head .section-title {
    margin: 0
}

.stats-chart-wrap {
    padding: 18px;
    margin: 4px 0 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .55)
}

.stats-chart-title {
    margin: 0 0 12px;
    font-family: "Space Grotesk";
    font-weight: 700;
    font-size: 1rem;
    color: var(--purple-dark)
}

.stats-chart {
    width: 100%;
    height: 280px;
    display: block
}

.todos-fullpage {
    max-width: 900px;
    margin: 0 auto
}

.todos-head {
    margin-bottom: 16px
}

.todos-head .section-title {
    margin: 0
}

/* "To-Do hinzufügen"-Knopf ueber der Liste. */
.todo-add-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 16px;
    margin-bottom: 10px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: transparent;
    color: var(--purple-dark);
    font-weight: 700;
    cursor: pointer;
    transition: .15s
}

.todo-add-btn:hover {
    background: rgba(118, 82, 164, .06);
    border-color: var(--purple)
}

.todo-add-btn .add-plus {
    font-size: 1.2rem;
    line-height: 1
}

/* Projekt "Neu"-Button in der Kopfzeile. */
.todos-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px
}

.project-new-btn {
    flex: none;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

/* Horizontales Filter-Panel mit Kaestchen. */
.project-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .5)
}

.filter-label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em
}

.project-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.project-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .6);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer
}

.project-filter input {
    width: auto;
    flex: none;
    accent-color: var(--purple)
}

/* Projektgruppen untereinander. */
.todo-projects {
    display: flex;
    flex-direction: column;
    gap: 26px
}

.project-group {
    display: flex;
    flex-direction: column
}

.project-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--line)
}

.project-title {
    margin: 0;
    font-family: "Space Grotesk";
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--ink)
}

.project-actions {
    display: flex;
    gap: 6px;
    margin-left: auto
}

.project-empty {
    color: var(--muted);
    font-size: .85rem;
    padding: 6px 2px 2px
}

.project-add-btn {
    margin-top: 8px
}

/* Liste. */
.todos-table {
    display: flex;
    flex-direction: column
}

.todos-rows {
    display: flex;
    flex-direction: column
}

/* Eine Aufgabe (Zeile + optionaler Notiz-Bereich). */
.todo-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .55);
    margin-bottom: 8px;
    overflow: hidden
}

.todo-item.is-child {
    margin-left: 30px
}

.todo-row {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr 74px 150px auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 10px 18px;
    cursor: pointer
}

/* Prioritaets-Farbstreifen links. */
.todo-row:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px
}

.todo-row.prio-1:before {
    background: var(--prio-1)
}

.todo-row.prio-2:before {
    background: var(--prio-2)
}

.todo-row.prio-3:before {
    background: var(--prio-3)
}

.todo-row.prio-4:before {
    background: var(--prio-4)
}

.todo-row.prio-5:before {
    background: var(--prio-5)
}

.todo-row.is-done .todo-title-input {
    text-decoration: line-through;
    color: var(--muted)
}

/* Checkbox/Haken. */
.todo-check {
    width: 26px;
    height: 26px;
    flex: none;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .7);
    color: #fff;
    font-size: .9rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: .15s
}

.todo-check[aria-pressed="true"] {
    background: var(--teal);
    border-color: var(--teal)
}

.todo-check:hover {
    border-color: var(--purple)
}

.todo-check:disabled {
    opacity: .4;
    cursor: default
}

/* Inline-Titel. */
.todo-title-input {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    padding: 7px 9px;
    font-weight: 600;
    outline: none;
    min-width: 0
}

.todo-title-input:hover {
    background: rgba(255, 255, 255, .5)
}

.todo-title-input:focus {
    border-color: var(--purple);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(118, 82, 164, .1)
}

/* Inline-Prioritaet (farbig). */
.todo-prio-select {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 6px 6px;
    font-weight: 800;
    font-size: .74rem;
    cursor: pointer;
    color: #fff;
    outline: none
}

.todo-prio-select.prio-1 {
    background: var(--prio-1)
}

.todo-prio-select.prio-2 {
    background: var(--prio-2)
}

.todo-prio-select.prio-3 {
    background: var(--prio-3)
}

.todo-prio-select.prio-4 {
    background: var(--prio-4)
}

.todo-prio-select.prio-5 {
    background: var(--prio-5)
}

.todo-prio-select option {
    color: var(--ink)
}

/* Inline-Frist. */
.todo-due-input {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, .55);
    color: var(--muted);
    font-size: .8rem;
    outline: none
}

.todo-due-input:focus {
    border-color: var(--purple);
    background: #fff
}

.col-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px
}

.todo-icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, .6);
    color: var(--purple);
    font-size: .9rem;
    cursor: pointer;
    display: grid;
    place-items: center
}

.todo-icon-btn.danger {
    color: var(--danger)
}

.todo-icon-btn.has-note {
    background: rgba(118, 82, 164, .16);
    border-color: var(--purple)
}

.todo-icon-btn:hover {
    background: #fff
}

/* Aufklappbarer Notiz-Bereich. */
.todo-detail {
    padding: 0 16px 14px 23px;
}

.todo-note-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, .7);
    padding: 10px 12px;
    font-size: .88rem;
    resize: vertical;
    min-height: 64px;
    outline: none
}

.todo-note-input:focus {
    border-color: var(--purple);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(118, 82, 164, .1)
}

.todos-empty {
    color: var(--muted);
    text-align: center;
    padding: 32px 0
}

.todos-done-wrap {
    margin-top: 22px
}

.todos-done-wrap>summary {
    cursor: pointer;
    list-style: none;
    margin-bottom: 12px;
    font-family: "Space Grotesk";
    font-weight: 700;
    color: var(--purple-dark)
}

.todos-done-wrap>summary::-webkit-details-marker {
    display: none
}

.todos-done-wrap>summary:before {
    content: "▸ ";
    color: var(--muted)
}

.todos-done-wrap[open]>summary:before {
    content: "▾ "
}

/* --- Startseiten-Auswahl der To-Dos --- */
.todo-picker {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .42);
    overflow: hidden
}

.todo-picker>summary {
    cursor: pointer;
    list-style: none;
    padding: 13px 16px;
    font-weight: 700;
    color: var(--purple-dark);
    display: flex;
    align-items: center;
    gap: 8px
}

.todo-picker>summary::-webkit-details-marker {
    display: none
}

.todo-picker>summary:before {
    content: "▸";
    color: var(--muted)
}

.todo-picker[open]>summary:before {
    content: "▾"
}

.todo-picker-count {
    margin-left: auto;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
    background: var(--purple);
    border-radius: 999px;
    padding: 2px 9px
}

.todo-picker-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 14px 14px
}

.todo-picker-empty {
    padding: 4px 16px 16px;
    color: var(--muted);
    font-size: .8rem
}

.todo-pick {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .55);
    cursor: pointer
}

.todo-pick.is-child {
    margin-left: 22px
}

.todo-pick input {
    width: auto;
    flex: none
}

.todo-pick .pick-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none
}

.todo-pick.prio-1 .pick-dot {
    background: var(--prio-1)
}

.todo-pick.prio-2 .pick-dot {
    background: var(--prio-2)
}

.todo-pick.prio-3 .pick-dot {
    background: var(--prio-3)
}

.todo-pick.prio-4 .pick-dot {
    background: var(--prio-4)
}

.todo-pick.prio-5 .pick-dot {
    background: var(--prio-5)
}

.todo-pick .pick-title {
    font-weight: 600;
    font-size: .88rem;
    word-break: break-word
}

/* --- Session-Ende: To-Dos abhaken --- */
.session-todos {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 430px;
    margin: 0 auto
}

.session-todo-check {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .55);
    text-align: left
}

.session-todo-check.is-checked {
    border-color: var(--teal);
    background: rgba(47, 143, 138, .1)
}

.big-check {
    width: 46px;
    height: 46px;
    flex: none;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: .15s
}

.session-todo-check.is-checked .big-check {
    background: var(--teal);
    border-color: var(--teal)
}

.session-todo-label {
    font-weight: 700
}

@media(max-width:760px) {
    .todo-row {
        grid-template-columns: 30px 1fr auto;
        grid-auto-rows: min-content;
        column-gap: 8px;
        row-gap: 4px
    }

    .todo-prio-select {
        grid-column: 2;
        justify-self: start
    }

    .todo-due-input {
        grid-column: 2;
        justify-self: start
    }

    .col-actions {
        grid-column: 3;
        grid-row: 1
    }

    .todo-item.is-child {
        margin-left: 16px
    }
}

/* --- Dialog-Overlay (Projekt anlegen/umbenennen/löschen) --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(36, 27, 45, .42);
    backdrop-filter: blur(4px);
    animation: modalFade .18s ease
}

.modal-card {
    width: min(100%, 420px);
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 22px;
    background: var(--cream);
    box-shadow: 0 30px 80px rgba(53, 34, 65, .28);
    animation: modalPop .2s cubic-bezier(.2, 1.4, .4, 1)
}

.modal-title {
    margin: 0 0 6px;
    font-family: "Space Grotesk";
    font-size: 1.3rem;
    letter-spacing: -.02em;
    color: var(--ink)
}

.modal-text {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.5
}

.modal-input {
    width: 100%;
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 13px 15px;
    font-size: 1rem;
    outline: none
}

.modal-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(118, 82, 164, .14)
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px
}

.modal-actions .secondary-btn,
.modal-actions .primary-btn {
    width: auto;
    padding: 11px 20px
}

.modal-confirm.is-danger {
    background: var(--danger)
}

.modal-confirm.is-danger:hover {
    background: #9a4150
}

body.modal-open {
    overflow: hidden
}

@keyframes modalFade {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@media(prefers-reduced-motion:reduce) {

    .modal-overlay,
    .modal-card {
        animation: none
    }
}

/* --- Laufende Session: Notiz + ausgewählte To-Dos --- */
.running-todos-wrap {
    margin: 4px 0 2px;
    text-align: center
}

.running-todos-label {
    margin: 0 0 8px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted)
}

.running-todos {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 360px
}

.running-todo {
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .55);
    font-weight: 600;
    font-size: .92rem
}

/* --- Buddy-Galerie (Alterstufen-Slider) --- */
.buddy-gallery {
    margin: 22px 0 8px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .45)
}

.buddy-slider-row {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.buddy-slider-caption {
    display: flex;
    align-items: baseline;
    gap: 10px
}

.buddy-slider-caption strong {
    font-family: "Space Grotesk";
    font-size: 1.1rem
}

.buddy-slider-caption span {
    color: var(--muted);
    font-size: .82rem
}

.buddy-slider {
    width: 100%;
    accent-color: var(--purple);
    cursor: pointer
}

.buddy-slider:disabled {
    opacity: .5;
    cursor: default
}

.buddy-slider-ends {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em
}

/* --- App-Footer (Unterstützung + Impressum) --- */
.app-footer {
    max-width: 1240px;
    margin: 40px auto 0;
    padding: 22px 32px 32px;
    border-top: 1px solid var(--line)
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap
}

.footer-brand {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: .9rem;
    color: var(--muted)
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap
}

.footer-support {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: 999px;
    background: rgba(118, 82, 164, .1);
    color: var(--purple-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: .85rem;
    transition: background .18s, transform .18s
}

.footer-support:hover {
    background: rgba(118, 82, 164, .18);
    transform: translateY(-1px)
}

.footer-link-btn {
    border: 0;
    background: none;
    padding: 8px 4px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color .18s
}

.footer-link-btn:hover {
    color: var(--purple-dark)
}

@media (max-width: 540px) {
    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px
    }
}

/* --- Impressum-Dialog --- */
.imprint-body {
    margin-top: 12px;
    color: var(--ink);
    font-size: .92rem;
    line-height: 1.6
}

.imprint-body p {
    margin: 0 0 12px
}

.imprint-body p:last-child {
    margin-bottom: 0
}

.imprint-body a {
    color: var(--purple);
    font-weight: 600;
    text-decoration: none
}

.imprint-body a:hover {
    text-decoration: underline;
    text-underline-offset: 3px
}

/* --- Datenschutz-Dialog (langer, scrollbarer Inhalt) --- */
.privacy-card {
    width: min(100%, 560px);
    max-height: min(86vh, 720px);
    display: flex;
    flex-direction: column
}

.legal-body {
    margin-top: 12px;
    overflow-y: auto;
    padding-right: 6px;
    color: var(--ink);
    font-size: .9rem;
    line-height: 1.6
}

.legal-body h4 {
    margin: 18px 0 6px;
    font-family: "Space Grotesk", sans-serif;
    font-size: .98rem;
    color: var(--purple-dark)
}

.legal-body h4:first-of-type {
    margin-top: 8px
}

.legal-body p {
    margin: 0 0 10px
}

.legal-body ul {
    margin: 0 0 10px;
    padding-left: 20px
}

.legal-body li {
    margin-bottom: 6px
}

.legal-body a {
    color: var(--purple);
    font-weight: 600;
    text-decoration: none
}

.legal-body a:hover {
    text-decoration: underline;
    text-underline-offset: 3px
}

.legal-updated {
    color: var(--muted);
    font-size: .8rem
}

.legal-note {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .8rem
}
