/* ============================================================
   Avison Studios Dashboard — Zeiterfassung, Prompt-Bibliothek, Ziele und Roadmap
   Reihenfolge der <link>-Tags nicht ändern.

   Ruhiges Kartensystem: keine dicken Rahmen, weiche Schatten,
   Bedeutung durch Tonflächen (Orange = läuft/dringend, Moss = Ziel/
   Erfolg, Rot = überfällig, Blau = Zahlen). Die Tokens stehen in basis.css.
   ============================================================ */

/* ============ Kunden-Bereich: mobil aufgeräumt ============ */
@media (max-width: 720px) {
    /* Doppelte Überschriften raus: die Karte hat schon einen Titel */
    #viewClients .view-head, #viewToolbox .view-head { display: none; }
    #viewClients .bento, #viewToolbox .tool-launcher { margin-top: 14px; }
    /* S/M/L und ⠿ sind am Handy wirkungslos (alles ist eine Spalte) */
    .widget-handle, .widget-controls { display: none; }
    .widget-grid, .panel-bento { gap: 12px; }
    .widget { padding: 12px 13px 14px; }
    .panel-name { font-size: 22px; }
}
@media (max-width: 620px) {
    /* Widgets wachsen mit dem Inhalt – die Seite scrollt, nicht die Box */
    .widget-body { max-height: none; }
    /* Pipeline untereinander statt quer scrollen */
    .pipeline { display: flex; flex-direction: column; gap: 10px; overflow-x: visible; }
}

/* ============================================================
   Zeiterfassung
   ============================================================ */

/* Start/Stopp sitzt in der Seitenleiste (basis.css .side-timer). Das Widget
   im Kundenbereich ist nur noch das Protokoll: wann, wie lange, wer, woran. */

/* Widget im Kundenbereich */
.zeit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.zeit-total strong { font-family: var(--font-title); font-size: 26px; font-weight: 400; line-height: 1; }
/* Laufende Uhr im Widget: Orange als Tonfläche */
.zeit-running {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-title);
    font-size: 16px;
    letter-spacing: 0.02em;
    background: var(--tone-orange);
    color: var(--tone-orange-ink);
    border-radius: var(--r-pill);
    padding: 4px 11px;
    font-variant-numeric: tabular-nums;
}
.zeit-live {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--tone-orange);
    color: var(--tone-orange-ink);
    font-size: 12px;
    font-weight: 600;
}
.zeit-live .timer-dot { background: var(--orange); }
.zeit-live-text { flex: 1; min-width: 0; }
.zeit-live .zeit-running { padding: 0; background: none; font-size: 15px; }
.zeit-day + .zeit-day { margin-top: 8px; }
.zeit-day-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.zeit-day-sum { font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.zeit-actions { display: flex; flex-wrap: wrap; gap: 6px; }
/* Monatssummen: Zahlen auf Blau-Fläche */
.zeit-months {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 6px 0 10px;
    padding: 10px 14px;
    border: none;
    background: var(--tone-blue);
    border-radius: var(--radius-sm);
}
.zeit-month { display: flex; flex-direction: column; line-height: 1.3; }
.zeit-month strong { font-family: var(--font-title); font-size: 18px; font-weight: 400; color: var(--tone-blue-ink); }
.zeit-cats { margin: 6px 0 10px; display: flex; flex-direction: column; gap: 5px; }
.zeit-cat { display: flex; align-items: center; gap: 8px; }
.zeit-cat-name { flex: 0 0 110px; font-size: 12px; color: var(--ink-2); }
.zeit-cat-track { flex: 1; height: 6px; margin-bottom: 0; }
.zeit-cat-val { flex: 0 0 62px; text-align: right; }
.zeit-list { display: flex; flex-direction: column; margin-bottom: 8px; }
.zeit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.zeit-row:last-child { border-bottom: none; }
.zeit-when { flex: 0 0 auto; font-family: var(--font-display); font-size: 12px; letter-spacing: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.zeit-what { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Kategorie-Pille: liegt im Widget (surface-2), darum Almond-Ton */
.zeit-tag {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--tone-almond);
    color: var(--ink-2);
    border: none;
    border-radius: var(--r-pill);
    padding: 2px 8px;
    margin-right: 6px;
    vertical-align: 1px;
}
.zeit-dur { flex: 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.zeit-who {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    background: var(--tone-almond);
    color: var(--ink-2);
    border: none;
}


/* ============================================================
   Prompt-Bibliothek (Toolbox)
   ============================================================ */
.pl-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.pl-search, input.pl-search {
    flex: 1;
    font: inherit;
    font-size: 14px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    background: var(--surface-2);
}
.pl-cats { margin-bottom: 12px; }
.pl-list { display: flex; flex-direction: column; gap: 10px; }
/* Zeile in der Karte; geöffnet hebt sie sich als kleine Karte ab */
.pl-card {
    border: none;
    border-radius: 12px;
    background: var(--surface-2);
    overflow: hidden;
    transition: background 0.15s, box-shadow 0.15s;
}
.pl-card.open { background: var(--surface); box-shadow: var(--shadow-card); }
.pl-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    flex-wrap: wrap;
}
.pl-head:hover { background: var(--tone-almond); }
.pl-cat {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--charcoal);
    color: var(--almond);
    border-radius: var(--r-pill);
    padding: 3px 9px;
    flex-shrink: 0;
}
.pl-title { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; }
/* Kunden-Chip: Kundenfarbe als Fläche mit Punkt in Vollfarbe */
.pl-client {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px 3px 8px;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--client-color, var(--charcoal)) 18%, var(--surface));
    color: var(--ink);
    flex-shrink: 0;
}
.pl-client::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--client-color, var(--charcoal)); flex-shrink: 0; }
.pl-varcount {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--tone-orange-ink);
    flex-shrink: 0;
}
.pl-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 12px 10px;
}
.pl-var { display: flex; flex-direction: column; gap: 3px; flex: 1 1 150px; }
.pl-var span {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink-2);
}
.pl-var input {
    font: inherit;
    font-size: 13.5px;
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
}
.pl-text {
    margin: 0 12px 10px;
    padding: 11px 13px;
    background: var(--surface-2);
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 260px;
    overflow-y: auto;
}
.pl-refs { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px 10px; }
.pl-ref-img {
    width: 78px;
    height: 78px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.pl-tags { padding: 0 12px; }
.pl-actions { display: flex; gap: 8px; padding: 0 12px 12px; flex-wrap: wrap; }
.pl-editor { display: flex; flex-direction: column; }
.pl-editor code {
    background: var(--surface-2);
    padding: 1px 5px;
    border-radius: 5px;
    font-size: 11.5px;
}
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    background: var(--surface-2);
    border: none;
    border-radius: var(--r-pill);
    padding: 4px 6px 4px 12px;
    margin: 0 6px 6px 0;
}
@media (max-width: 640px) {
    .pl-bar { flex-wrap: wrap; }
    .pl-search { flex: 1 1 100%; }
    .pl-var { flex: 1 1 100%; }
}

/* Hinweis, wenn Anmeldung und Server sich widersprechen (statt Endlos-Reload) */
.auth-stuck {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 200;
    width: min(520px, calc(100vw - 28px));
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 16px 18px;
    font-size: 14px;
}
.auth-stuck strong { display: block; margin-bottom: 6px; color: var(--tone-orange-ink); }
.auth-stuck p { margin: 6px 0 0; }
.auth-stuck-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.auth-stuck .btn { text-decoration: none; }

/* ============================================================
   ZIELE
   Karten wie im übrigen Dashboard, aber mit zwei Ebenen im selben Balken:
   gefüllter Fortschritt + senkrechte Marke „hier müsstest du zeitlich
   stehen". Der Abstand zwischen beiden ist die eigentliche Aussage.
   ============================================================ */
.card-goalfocus { background: var(--charcoal); color: var(--almond); padding: 20px 26px; }
.goal-focus { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.goal-focus-empty { margin: 0; color: var(--almond); font-size: 15px; max-width: 60ch; }
.goal-focus-dial { flex-shrink: 0; }
.goal-dial { width: 78px; height: 78px; }
.gd-track { fill: none; stroke: rgba(233,218,197,0.18); stroke-width: 9; }
/* rotate(-90deg): Startpunkt des Kreisbogens oben – Geometrie, kein Deko-Drehen */
.gd-fill {
    fill: none;
    stroke: var(--orange-soft);
    stroke-width: 9;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.gd-label {
    fill: var(--almond);
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 400;
    text-anchor: middle;
}
.goal-focus-main { flex: 1; min-width: 210px; }
.goal-focus-main .kicker { color: var(--orange-soft); margin-bottom: 2px; }
.goal-focus-main h3 {
    margin: 0;
    font-family: var(--font-title);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--almond);
}
.goal-focus-sub { margin: 2px 0 8px; font-size: 14px; color: rgba(233,218,197,0.6); }
.goal-focus-sub strong { color: var(--almond); }
.goal-focus-track { height: 6px; background: rgba(233,218,197,0.16); border-radius: 3px; overflow: hidden; }
.goal-focus-track span { display: block; height: 100%; background: var(--orange-soft); border-radius: 3px; }
.goal-focus-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.goal-stat {
    display: grid;
    gap: 2px;
    min-width: 78px;
    background: rgba(233,218,197,0.08);
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--almond);
    font-family: var(--font-display);
    transition: transform 0.15s, background 0.15s;
}
.goal-stat:hover { transform: translateY(-1px); background: rgba(233,218,197,0.14); }
.goal-stat b { font-family: var(--font-title); font-size: 26px; font-weight: 400; line-height: 1; }
.goal-stat span { font-family: var(--font-display); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(233,218,197,0.6); }
.goal-stat.ok b { color: #B9CF8F; }
.goal-stat.warn b { color: var(--orange-soft); }
.goal-stat.done b { color: var(--powder); }
.goal-stat.on { background: var(--orange); }
.goal-stat.on span, .goal-stat.on b { color: #FFF6EC; }

.goal-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.goal-tabs { display: inline-flex; gap: 4px; background: var(--surface-2); border-radius: var(--r-pill); padding: 3px; }
.goal-tab {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    background: none;
    border: none;
    border-radius: var(--r-pill);
    padding: 6px 14px;
    cursor: pointer;
    color: var(--ink-2);
    transition: background 0.15s, color 0.15s;
}
.goal-tab:hover { color: var(--ink); }
.goal-tab.active { background: var(--charcoal); color: var(--almond); }
.goal-hchips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 18px; align-items: center; }
/* Horizont-Filter als Pillen; aktiv = Orange als Tonfläche */
.goal-hchip {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: none;
    border: none;
    border-radius: var(--r-pill);
    color: var(--ink-2);
    cursor: pointer;
    padding: 5px 11px;
    transition: background 0.15s, color 0.15s;
}
.goal-hchip:hover { background: var(--surface-2); color: var(--ink); }
.goal-hchip.active { background: var(--tone-orange); color: var(--tone-orange-ink); }
.goal-hchip.clear { background: var(--surface-2); color: var(--ink-2); text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: auto; }
.goal-empty { padding: 20px 2px; }

.goal-group { margin-bottom: 30px; }
.goal-group:last-child { margin-bottom: 0; }
/* Gruppen-Überschrift (h3 in der Karte): eigene Regel schlägt .card h3 aus basis.css */
.goal-group-title, .card h3.goal-group-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; align-items: start; }

/* Ziel-Karte: weich, Kundenfarbe (--goal-color) als leichte Fläche statt Kante */
.goal-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: color-mix(in srgb, var(--goal-color, var(--orange)) 8%, var(--surface));
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 18px 20px 16px;
    min-width: 0;
    transition: box-shadow 0.15s;
}
.goal-card:hover { box-shadow: var(--shadow-hover); }
.goal-card.flash { animation: goal-flash 1.6s ease-out; }
@keyframes goal-flash {
    0%, 55% { box-shadow: 0 0 0 3px var(--orange), var(--shadow-card); }
    100% { box-shadow: var(--shadow-card); }
}
.goal-card.gs-erreicht { opacity: 0.78; }
.goal-card.gs-verworfen { opacity: 0.55; }
.goal-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.goal-card-ident { min-width: 0; flex: 1; }
.goal-period { font-family: var(--font-display); font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); margin: 0 0 3px; }
.goal-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    overflow-wrap: anywhere;
}
.goal-title:hover { color: var(--orange); }
.goal-card-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Kunden-Chip: Kundenfarbe als Fläche, Text in Tinte */
.goal-client {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    background: color-mix(in srgb, var(--client-color, var(--charcoal)) 18%, var(--surface));
    color: var(--ink);
    border: none;
    border-radius: var(--r-pill);
    padding: 3px 10px 3px 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.goal-client:hover { background: color-mix(in srgb, var(--client-color, var(--charcoal)) 30%, var(--surface)); }
.goal-client img { width: 15px; height: 15px; border-radius: 50%; object-fit: cover; background: var(--white); }
.goal-status {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--r-pill);
    padding: 3px 9px;
    background: rgba(var(--ink-rgb), 0.06);
    color: var(--ink-2);
}
.goal-status.gs-aktiv { background: var(--tone-orange); color: var(--tone-orange-ink); }
.goal-status.gs-erreicht { background: var(--tone-moss); color: var(--tone-moss-ink); }
.goal-status.gs-pausiert { background: var(--tone-blue); color: var(--tone-blue-ink); }
.goal-desc { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }

/* Fortschritt: 6px-Balken, Spur grau, Füllung Moss, Zeitmarke als dünner Strich */
.goal-track {
    position: relative;
    height: 6px;
    background: rgba(35, 36, 37, 0.10);
    border-radius: 3px;
}
.goal-fill {
    display: block;
    height: 100%;
    background: var(--moss);
    border-radius: 3px;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.goal-now {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: var(--ink);
    border-radius: 1px;
    transform: translateX(-1px);
}
.goal-progress-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.goal-progress-meta strong { font-family: var(--font-title); font-size: 18px; font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
/* Tempo-Ampel als Tonflächen */
.goal-pace {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--r-pill);
    padding: 3px 9px;
    white-space: nowrap;
}
.pace-ontrack { background: var(--tone-moss); color: var(--tone-moss-ink); }
.pace-ahead   { background: var(--tone-moss); color: var(--tone-moss-ink); }
.pace-behind  { background: var(--tone-orange); color: var(--tone-orange-ink); }
.pace-late    { background: var(--tone-red); color: var(--tone-red-ink); }
.pace-done    { background: var(--tone-moss); color: var(--tone-moss-ink); }
.pace-hold, .pace-none, .pace-off { background: rgba(var(--ink-rgb), 0.06); color: var(--ink-2); }
.goal-left { margin-left: auto; font-size: 12px; color: var(--ink-2); }
.goal-left.soon { color: var(--tone-orange-ink); font-weight: 600; }
.goal-left.over { color: var(--danger); font-weight: 600; }

.goal-krs { display: grid; gap: 9px; }
.goal-kr { display: grid; gap: 4px; }
.goal-kr-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.goal-kr-label { flex: 1; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.goal-kr-label:hover { color: var(--orange); }
.goal-kr-nums { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
/* input.goal-kr-input: gleiche Spezifität wie das Basis-Input, spätere Regel gewinnt */
.goal-kr-input, input.goal-kr-input {
    width: 66px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(var(--ink-rgb), 0.05);
}
.goal-kr-input:focus, input.goal-kr-input:focus { outline: none; background: var(--surface); border-color: var(--powder); box-shadow: 0 0 0 3px rgba(173,189,214,0.35); }
.kr-del { opacity: 0; font-size: 15px; }
.goal-kr:hover .kr-del { opacity: 1; }
.goal-kr-track { height: 6px; background: rgba(35, 36, 37, 0.10); border-radius: 3px; overflow: hidden; }
.goal-kr-track span { display: block; height: 100%; background: var(--moss); border-radius: 3px; }

/* Meilensteine als Zeilen. Die Karte ist in der Kundenfarbe getönt, darum
   eine neutrale Abdunklung statt surface-2, die auf jeder Tönung passt. */
.goal-subs { border-top: 1px solid var(--line); padding-top: 10px; }
.goal-sub-label {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin: 0 0 6px;
}
.goal-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin-bottom: 4px;
    font-size: 14px;
    background: rgba(var(--ink-rgb), 0.045);
    border-radius: 8px;
}
.goal-sub:last-child { margin-bottom: 0; }
.goal-sub.done .goal-sub-title { text-decoration: line-through; color: var(--ink-2); }
.goal-sub-check {
    width: 18px; height: 18px;
    flex-shrink: 0;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    display: grid;
    place-content: center;
    font-size: 12px;
    color: var(--surface);
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}
.goal-sub-check:hover { border-color: var(--moss); }
.goal-sub.done .goal-sub-check { background: var(--moss); border-color: var(--moss); color: #fff; }
.goal-sub-title { flex: 1; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.goal-sub-title:hover { color: var(--orange); }
.goal-sub-meta { flex-shrink: 0; }

.goal-links { display: flex; gap: 7px; flex-wrap: wrap; }
.goal-links:empty { display: none; }
.goal-link-chip {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    background: rgba(var(--ink-rgb), 0.06);
    color: var(--ink);
    border: none;
    border-radius: var(--r-pill);
    padding: 4px 11px;
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.goal-link-chip:hover { background: var(--tone-orange); color: var(--tone-orange-ink); }
.goal-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.goal-card-actions .btn { font-size: 12px; padding: 5px 11px; }

/* ---- Ziel-Dialog: Ergebnis-Zeilen ---- */
.gl-kr-row { display: grid; grid-template-columns: 1fr 66px 66px 66px 88px 28px; gap: 6px; margin-bottom: 6px; align-items: center; }
.gl-kr-row input { padding: 7px 9px; font-size: 13px; }
.gl-kr-num { text-align: right; }
@media (max-width: 620px) {
    .gl-kr-row { grid-template-columns: 1fr 1fr 1fr 28px; }
    .gl-kr-row input:first-child { grid-column: 1 / -1; }
}
.gl-progress-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.gl-progress-row input[type=range] { flex: 1; accent-color: var(--orange); }
.gl-progress-row span { font-weight: 600; min-width: 46px; }

/* ---- Roadmap (Zeitstrahl über 12 Monate) ---- */
.roadmap {
    --rm-label: 210px;
    position: relative;
    display: grid;
    grid-template-columns: var(--rm-label) repeat(12, minmax(52px, 1fr));
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow-x: auto;
    padding-bottom: 6px;
}
.rm-head { display: contents; }
.rm-label-col {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface-2);
    position: sticky;
    left: 0;
    z-index: 3;
}
.rm-label-col .btn { padding: 2px 9px; font-size: 14px; }
.rm-month {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    padding: 11px 2px 8px;
    border-bottom: 1px solid var(--line-strong);
    border-left: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--ink-2);
}
.rm-month.now { background: var(--tone-orange); color: var(--tone-orange-ink); }
.rm-row { display: contents; }
.rm-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    background: var(--surface);
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 0;
}
.rm-row.sub .rm-label { padding-left: 26px; }
.rm-label:hover { background: var(--surface-2); }
.rm-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rm-name { flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-pct { flex-shrink: 0; }
.rm-lane {
    grid-column: 2 / -1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 6px 0;
    background: repeating-linear-gradient(to right,
        var(--line-strong) 0, var(--line-strong) 1px,
        transparent 1px, transparent calc(100% / 12));
}
/* Balken: Fläche statt Rahmen; die Füllung ist die Kundenfarbe als Ton */
.rm-bar {
    position: relative;
    grid-row: 1;
    height: 26px;
    border: none;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    overflow: hidden;
    cursor: pointer;
    margin: 0 2px;
    display: flex;
    align-items: center;
    min-width: 0;
    transition: filter 0.15s;
}
.rm-bar:hover { filter: brightness(0.96); }
.rm-bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--bar-color); opacity: 0.5; }
.rm-bar-text {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 600;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}
.rm-bar.pace-late { background: var(--tone-red); }
.rm-bar.pace-late .rm-bar-text { color: var(--tone-red-ink); }
.rm-bar.pace-done { opacity: 0.7; }
.rm-cut { position: absolute; top: 2px; font-size: 13px; z-index: 2; }
.rm-cut.left { left: 3px; }
.rm-cut.right { right: 3px; }
/* Meilenstein-Raute: rotate(45deg) macht aus dem Quadrat die Raute – Form, kein Deko-Drehen */
.rm-milestone {
    grid-row: 1;
    width: 12px;
    height: 12px;
    background: var(--charcoal);
    transform: rotate(45deg);
    justify-self: end;
    margin-right: 6px;
    cursor: pointer;
    z-index: 2;
    border: none;
    border-radius: 2px;
    box-shadow: 0 0 0 2px var(--surface);
}
.rm-milestone.done { background: var(--moss); }
.rm-today {
    position: absolute;
    top: 34px;
    bottom: 0;
    width: 2px;
    background: var(--orange);
    z-index: 1;
    pointer-events: none;
}
.rm-legend { margin: 10px 2px 0; }

/* ---- Ziele im Kunden-Widget ---- */
.goalw-list { display: grid; gap: 12px; }
.goalw-row { cursor: pointer; }
.goalw-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.goalw-title { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goalw-meta { margin-top: 3px; }
.goalw-row .goal-track { --goal-color: var(--client-color); }
.goalw-mini { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.goalw-mini .goal-dial { width: 58px; height: 58px; }
.goalw-mini .gd-track { stroke: rgba(35, 36, 37, 0.10); }
.goalw-mini .gd-fill { stroke: var(--client-color, var(--moss)); }
.goalw-mini .gd-label { fill: var(--ink); font-size: 20px; }

/* ---- Notizen im Kunden-Widget ---- */
.docw-list { display: grid; gap: 5px; }
.docw-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-radius: 9px;
    padding: 6px 8px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--ink);
}
.docw-row:hover { background: var(--tone-almond); }
.docw-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docw-when { flex-shrink: 0; }
.docw-mini { display: flex; align-items: baseline; gap: 7px; cursor: pointer; }
.docw-mini b { font-family: var(--font-title); font-size: 30px; font-weight: 400; line-height: 1; }

/* ---- Ziel-Chip in der To-do-Zeile & im Dialog ---- */
.sub-chip.goal { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-chip .chip-x { font-size: 15px; margin-left: 2px; }
.todo-dlg-grid { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }
.td-docs { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 6px; }
.td-doc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    background: var(--surface-2);
    color: var(--ink);
    border: none;
    border-radius: var(--r-pill);
    padding: 5px 12px;
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.td-doc:hover { background: var(--tone-orange); color: var(--tone-orange-ink); }
/* Hinzufügen-Zone darf gestrichelt bleiben */
.td-doc.add { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-2); }
.td-doc.add:hover { background: var(--surface-2); color: var(--ink); }

/* ============================================================
   NOTIZEN (Notion-Prinzip)
   Links der Seitenbaum, rechts die Seite aus Blöcken. Jeder Block ist
   ein eigenes contenteditable – dadurch funktionieren Enter, „/", „@",
   Umsortieren und Einrücken so, wie man es aus Notion kennt.
   ============================================================ */
.docs-shell {
    display: grid;
    grid-template-columns: 272px 1fr;
    align-items: start;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    background: var(--surface);
    overflow: hidden;
    min-height: calc(100vh - 190px);
    margin-top: 14px;
}
.docs-side {
    background: var(--surface-2);
    border-right: 1px solid var(--line);
    padding: 16px 12px 22px;
    height: calc(100vh - 190px);
    overflow-y: auto;
    position: sticky;
    top: 76px;
}
.docs-side-top { display: flex; gap: 7px; margin-bottom: 14px; }
/* Suche erbt das Eingabefeld aus basis.css; hier nur Fläche und Maße
   (input.docs-search: gleiche Spezifität wie das Basis-Input, spätere Regel gewinnt) */
.docs-search, input.docs-search {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    padding: 7px 11px;
    font-size: 14px;
}
.docs-side-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin: 14px 0 5px 6px;
}
.docs-side-label:first-child { margin-top: 0; }
.docs-side-empty { margin: 4px 6px; }
.docs-side-toggle { display: none; }
.docs-tree-end { height: 26px; border-radius: 8px; }
.docs-tree-end.drop-after { background: rgba(190,94,33,0.14); box-shadow: inset 0 2px 0 var(--orange); }

.doc-row {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px 6px 5px calc(4px + var(--depth, 0) * 15px);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    transition: background 0.15s;
}
/* Hover: die Leiste ist selbst surface-2, darum eine leichte Abdunklung */
.doc-row:hover { background: rgba(var(--ink-rgb), 0.05); }
.doc-row.active { background: var(--tone-almond); color: var(--ink); }
.doc-row.active .icon-btn { color: var(--ink-2); }
.doc-row.archived { opacity: 0.6; }
.doc-row-caret {
    width: 16px;
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
}
.doc-row-caret.empty { cursor: default; }
.doc-row-icon { flex-shrink: 0; font-size: 15px; line-height: 1; }
.doc-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row-actions { display: none; flex-shrink: 0; }
.doc-row:hover .doc-row-actions, .doc-row.active .doc-row-actions { display: flex; }
.doc-row-actions .icon-btn { padding: 1px 5px; font-size: 14px; }
/* Drop-Marker beim Umsortieren (Innenschatten = Markierung, kein Rahmen) */
.doc-row.drop-into { background: rgba(190,94,33,0.18); box-shadow: inset 0 0 0 2px var(--orange); }
.doc-row.drop-before { box-shadow: inset 0 2px 0 var(--orange); }
.doc-row.drop-after { box-shadow: inset 0 -2px 0 var(--orange); }

.docs-main {
    padding: 30px clamp(20px, 4vw, 64px) 90px;
    min-width: 0;
    min-height: calc(100vh - 190px);
}
