/* Notiz-Knopf, Seitentafel, Aufnahme und Notizliste. */

.visuell-versteckt {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.notiz-knopf {
    position: fixed;
    right: 1.75rem;
    bottom: 1.75rem;
    z-index: 30;
    display: grid;
    place-items: center;
    width: 3.4rem;
    height: 3.4rem;
    padding: 0;
    color: #fff;
    background: var(--verlauf-primaer);
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--schatten-akzent), 0 8px 28px rgb(16 18 26 / 18%);
    cursor: pointer;
    transition: transform .18s, box-shadow .18s;
}

.notiz-knopf:hover { transform: translateY(-2px); box-shadow: var(--schatten-akzent), 0 12px 32px rgb(16 18 26 / 24%); }
.notiz-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; }
.notiz-knopf svg { width: 1.5rem; height: 1.5rem; }

.notiz-zahl {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    min-width: 1.35rem;
    padding: 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.35rem;
    color: var(--akzent);
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius-pille);
    box-shadow: var(--schatten-fein);
    font-variant-numeric: tabular-nums;
}

.notiz-schleier {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgb(8 9 12 / 45%);
    backdrop-filter: blur(2px);
}

.notiz-tafel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: min(25rem, 100vw);
    padding: 1.35rem 1.35rem 1.35rem;
    background: var(--flaeche);
    border-left: 1px solid var(--rand);
    box-shadow: -12px 0 40px rgb(8 9 12 / 18%);
}

.notiz-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notiz-kopf h2 { margin: 0; font-size: 1.1rem; font-weight: 600; letter-spacing: -0.015em; }

.notiz-schliessen {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--gedimmt);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-klein);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.notiz-schliessen:hover { background: var(--bg-tief); color: var(--text); }
.notiz-schliessen:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.notiz-filter { display: flex; gap: 0.3rem; margin: 1rem 0 0; padding: 0.25rem; background: var(--bg-tief); border-radius: var(--radius-klein); }

.notiz-reiter {
    flex: 1;
    padding: 0.35rem 0.75rem;
    font: inherit;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--gedimmt);
    background: none;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.notiz-reiter:hover { color: var(--text); }
.notiz-reiter:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.notiz-reiter.ist-aktiv { background: var(--flaeche); color: var(--text); font-weight: 600; box-shadow: var(--schatten-fein); }

.notiz-formular { margin: 0.9rem 0 0; }
.notiz-feld { display: block; }

.notiz-feld textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--rand);
    border-radius: var(--radius-klein);
    resize: vertical;
}

.notiz-feld textarea::placeholder { color: var(--gedimmt); }
.notiz-feld textarea:focus-visible {
    outline: none;
    border-color: var(--akzent);
    background: var(--flaeche);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 20%, transparent);
}

.notiz-werkzeuge { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.65rem; }
.notiz-werkzeuge .knopf { padding: 0.42rem 0.9rem; font-size: 0.85rem; }
.notiz-werkzeuge [data-notiz-speichern] { margin-left: auto; }

.notiz-mikro {
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    color: var(--gedimmt);
    background: var(--bg-tief);
    border: 1px solid var(--rand);
    border-radius: var(--radius-klein);
    cursor: pointer;
    flex: none;
    transition: border-color .15s, color .15s;
}

.notiz-mikro svg { width: 1.15rem; height: 1.15rem; }
.notiz-mikro:hover { border-color: var(--akzent); color: var(--akzent); }
.notiz-mikro:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.notiz-mikro.ist-aktiv {
    color: var(--schlecht);
    background: var(--schlecht-weich);
    border-color: var(--schlecht);
    animation: notiz-puls 1.4s ease-in-out infinite;
}

@keyframes notiz-puls {
    50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--schlecht) 18%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
    .notiz-mikro.ist-aktiv { animation: none; }
    .notiz-knopf { transition: none; }
}

.notiz-hinweis { font-size: 0.78rem; color: var(--gedimmt); }
.notiz-hinweis.ist-fehler { color: var(--schlecht); }

.notiz-leer { margin: 1.35rem 0 0; font-size: 0.88rem; color: var(--gedimmt); text-align: center; }

.notiz-liste {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
    overflow-y: auto;
    /* Wächst mit der Tafel, statt sie zu überlaufen. */
    flex: 1;
    min-height: 0;
    align-content: start;
}

.notiz-eintrag {
    padding: 0.8rem 1rem;
    background: var(--bg);
    border: 1px solid var(--rand);
    border-radius: var(--radius-klein);
    transition: border-color .15s;
}

.notiz-eintrag:hover { border-color: var(--rand-stark); }
.notiz-eintrag.ist-bearbeitet { border-color: var(--akzent); background: var(--akzent-weich); }

.notiz-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.89rem; line-height: 1.6; }

.notiz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.5rem;
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--gedimmt);
}

.notiz-herkunft { color: var(--gedimmt); }
.notiz-herkunft:hover { color: var(--akzent); }

.notiz-aktionen { display: flex; gap: 0.85rem; margin-top: 0.45rem; font-size: 0.8rem; }
.notiz-loeschen:hover { color: var(--schlecht); }

@media (max-width: 32rem) {
    .notiz-tafel { width: 100vw; border-left: 0; }
    .notiz-knopf { right: 1.15rem; bottom: 1.15rem; }
}
