/* TextBuddy UX-Feinschliff (TBUX, Stage 21.10.2026) – ergänzt scribigo-agent-chat.css */

/* 1: Start-Dialog – Auto-Upload, kein separater "Hochladen"-Button */
#sgStartDialog #sgStartDialogFileBtn.tbux-hidden,
#sgStartDialog #sgStartDialogFileBtn[hidden] {
    display: none !important;
}
#sgStartDialog .tbux-upload-auto-hint {
    margin: 8px 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--ast-global-color-3, #555);
    text-align: center;
}
#sgStartDialog .tbux-upload-auto-hint[hidden] {
    display: none !important;
}

/* 2: Schrittanzeige mit 5 Schritten (Start-Dialog + Bestätigungsdialog) */
.sg-dialog__steps.tbux-steps {
    flex-wrap: wrap;
    row-gap: 4px;
}
.sg-dialog__steps.tbux-steps li.is-done span {
    opacity: 0.7;
}
#sgCommandCardDialogBody > .tbux-confirm-steps {
    margin: 0 0 12px;
}

/* 3: Chat-Karte, solange die Bestätigung im Dialog offen ist */
#agentMessages .tbux-confirm-in-dialog [id^="costConfirmControls_"],
#agentMessages .tbux-confirm-in-dialog [id^="costCancelOnly_"] {
    display: none !important;
}
#agentMessages .tbux-confirm-note {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 8px;
    border: 1px dashed var(--ast-border-color, #d0d7de);
    border-radius: 3px;
    font-size: 0.8125rem;
    color: var(--ast-global-color-3, #555);
}
#agentMessages .tbux-confirm-note i {
    color: var(--ast-global-color-0);
}
#agentMessages .tbux-confirm-note__btn {
    margin-left: auto;
    padding: 3px 8px;
    border: 1px solid var(--ast-border-color, #d0d7de);
    border-radius: 3px;
    background: #fff;
    color: var(--ast-global-color-2, #333);
    font-size: 0.8125rem;
    line-height: 1.4;
    cursor: pointer;
    text-transform: none;
}
#agentMessages .tbux-confirm-note__btn:hover {
    background: var(--ast-global-color-5, #f6f8fa);
}

/* 5 + 10: Übersicht – primäre Ergebnis-Aktion + Download mit Wahl */
#previewDropZone .tbux-result-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 12px 0 16px;
}
#previewDropZone .tbux-result-actions[hidden] {
    display: none !important;
}
#previewDropZone .tbux-result-actions__view i {
    margin-left: 6px;
}
#previewDropZone .tbux-dl {
    position: relative;
}
#previewDropZone .tbux-result-actions {
    --tbux-primary-c: var(--tbux-primary, var(--ast-global-color-0, #f18a00));
}
#previewDropZone .tbux-dl__toggle,
#previewDropZone .tbux-dl__toggle.ast-outline-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff !important;
    border: 1px solid var(--tbux-primary-c) !important;
    color: var(--tbux-primary-c) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
#previewDropZone .tbux-dl__toggle i {
    color: var(--tbux-primary-c) !important;
}
#previewDropZone .tbux-dl__toggle:hover,
#previewDropZone .tbux-dl__toggle:focus-visible,
#previewDropZone .tbux-dl__toggle[aria-expanded="true"] {
    background: #fff4e6 !important;
    background: color-mix(in srgb, var(--tbux-primary-c) 10%, #fff) !important;
    border-color: var(--tbux-primary-c) !important;
    color: var(--tbux-primary-c) !important;
}
#previewDropZone .tbux-dl__toggle.is-loading {
    opacity: 0.6;
    pointer-events: none;
}
#previewDropZone .tbux-dl__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1001;
    min-width: 280px;
    max-width: 360px;
    padding: 4px;
    background: #fff !important;
    opacity: 1;
    border: 1px solid var(--ast-border-color, #d0d7de);
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
#previewDropZone .tbux-dl__menu[hidden] {
    display: none !important;
}
#previewDropZone .tbux-dl__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 3px;
    background: #fff !important;
    color: #1f2328 !important;
    box-shadow: none;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.35;
    cursor: pointer;
    text-transform: none;
}
#previewDropZone .tbux-dl__item strong {
    color: #1f2328;
}
#previewDropZone .tbux-dl__item span {
    font-size: 0.8125rem;
    color: #57606a;
}
#previewDropZone .tbux-dl__item em {
    font-style: normal;
    opacity: 0.8;
}
#previewDropZone .tbux-dl__item:hover,
#previewDropZone .tbux-dl__item:focus-visible {
    background: #fff4e6 !important;
    background: color-mix(in srgb, var(--tbux-primary-c) 10%, #fff) !important;
    color: #1f2328 !important;
}
#previewDropZone .tbux-dl__item--more {
    border-top: 1px solid var(--ast-border-color, #d0d7de);
    border-radius: 0 0 3px 3px;
    font-size: 0.8125rem;
}

/* 6: Befunde-Leerzustand mit Verweis auf Korrektur und Stil */
.review-inbox-empty-state .tbux-corrections-hint {
    margin-top: 6px;
}
.review-inbox-empty-state .tbux-corrections-cta {
    margin-top: 8px;
}

/* 7: Aktive Änderung – Text-Buttons Annehmen / Ablehnen */
#floatingToolbar .tbux-ft-label {
    display: none;
}
#floatingToolbar.tbux-change-active .floating-toolbar-btn[data-action="acceptChange"],
#floatingToolbar.tbux-change-active .floating-toolbar-btn[data-action="rejectChange"] {
    width: auto;
    padding: 0 8px;
    gap: 5px;
}
#floatingToolbar.tbux-change-active .floating-toolbar-btn[data-action="acceptChange"] .tbux-ft-label,
#floatingToolbar.tbux-change-active .floating-toolbar-btn[data-action="rejectChange"] .tbux-ft-label {
    display: inline;
    font-size: 0.8125rem;
    line-height: 1;
    white-space: nowrap;
}
#floatingToolbar.tbux-change-active .floating-toolbar-btn[data-action="acceptChange"] {
    color: #15803d;
}
#floatingToolbar.tbux-change-active .floating-toolbar-btn[data-action="rejectChange"] {
    color: #b91c1c;
}
/* 8: Deaktivierter Trigger "Änderungen" fängt den Klick selbst ab (Tooltip statt
      Durchklicken auf den Container darunter). Klick bleibt per JS wirkungslos. */
#toolbarDropdownChanges.is-disabled {
    pointer-events: auto;
}

/* DLB: Löschdatum neben "Version x" (Auftragskarte Überblick), nur ohne Document-Flat.
   Eigenes Inline-Badge ohne "·"-Trenner: bricht als Ganzes um, keine Zeile beginnt mit "·". */
#sgOverviewOrderRule .tbux-retention {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}
#sgOverviewOrderRule .tbux-retention[hidden] {
    display: none !important;
}
#sgOverviewOrderRule .tbux-retention__sep {
    display: none !important;
}
#sgOverviewOrderRule .tbux-retention__btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0 7px;
    border: 1px solid var(--ast-border-color, #d0d7de);
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.6;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
#sgOverviewOrderRule .tbux-retention__btn i {
    font-size: 0.6875rem;
    opacity: 0.75;
}
#sgOverviewOrderRule .tbux-retention__btn:hover,
#sgOverviewOrderRule .tbux-retention__btn:focus-visible {
    color: var(--ast-global-color-0);
    border-color: currentColor;
    background: transparent;
}
#sgOverviewOrderRule .tbux-retention__btn:focus-visible {
    outline: 2px solid var(--ast-global-color-0);
    outline-offset: 2px;
}
#sgOverviewOrderRule .tbux-retention.is-soon .tbux-retention__btn {
    color: #b35c00;
    border-color: #f0c38a;
}
.scribigo-generic-modal .tbux-retention__avail {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--ast-global-color-3, #555);
}
