.demo-ai-inline-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef5ff;
    color: #1d67ba;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.demo-ai-inline-hint.demo-ai-inline-hint-version {
    background: #132138;
    color: #f8fbff;
}

.richtexteditor rte-toolbar-button.rte_command_aiassist,
.richtexteditor rte-toolbar-arrowbutton.rte_command_aiassist,
.richtexteditor rte-toolbar-dropdown.rte_command_aiassist,
.richtexteditor rte-control-toolbar rte-toolbar-button.rte_command_aiassist,
.richtexteditor rte-control-toolbar rte-toolbar-arrowbutton.rte_command_aiassist,
.richtexteditor rte-control-toolbar rte-toolbar-dropdown.rte_command_aiassist {
    position: relative;
    color: #5f6368;
}

.richtexteditor rte-toolbar-button.rte_command_aiassist,
.richtexteditor rte-control-toolbar rte-toolbar-button.rte_command_aiassist {
    width: 28px;
    height: 26px;
}

.richtexteditor rte-toolbar-dropdown.rte_command_aiassist,
.richtexteditor rte-toolbar-arrowbutton.rte_command_aiassist,
.richtexteditor rte-control-toolbar rte-toolbar-dropdown.rte_command_aiassist,
.richtexteditor rte-control-toolbar rte-toolbar-arrowbutton.rte_command_aiassist {
    min-width: 28px;
}

.richtexteditor rte-toolbar-button.rte_command_aiassist svg,
.richtexteditor rte-toolbar-arrowbutton.rte_command_aiassist svg,
.richtexteditor rte-toolbar-dropdown.rte_command_aiassist svg,
.richtexteditor rte-control-toolbar rte-toolbar-button.rte_command_aiassist svg,
.richtexteditor rte-control-toolbar rte-toolbar-arrowbutton.rte_command_aiassist svg,
.richtexteditor rte-control-toolbar rte-toolbar-dropdown.rte_command_aiassist svg {
    width: 22px;
    height: 22px;
    color: inherit;
}

.richtexteditor rte-toolbar-button.rte_command_aiassist::after,
.richtexteditor rte-toolbar-arrowbutton.rte_command_aiassist::after,
.richtexteditor rte-toolbar-dropdown.rte_command_aiassist::after,
.richtexteditor rte-control-toolbar rte-toolbar-button.rte_command_aiassist::after,
.richtexteditor rte-control-toolbar rte-toolbar-arrowbutton.rte_command_aiassist::after,
.richtexteditor rte-control-toolbar rte-toolbar-dropdown.rte_command_aiassist::after {
    content: none;
}

.richtexteditor rte-toolbar-button.rte_command_aiassist:hover,
.richtexteditor rte-toolbar-arrowbutton.rte_command_aiassist:hover,
.richtexteditor rte-toolbar-dropdown.rte_command_aiassist:hover,
.richtexteditor rte-control-toolbar rte-toolbar-button.rte_command_aiassist:hover,
.richtexteditor rte-control-toolbar rte-toolbar-arrowbutton.rte_command_aiassist:hover,
.richtexteditor rte-control-toolbar rte-toolbar-dropdown.rte_command_aiassist:hover,
.richtexteditor rte-toolbar-button.rte_command_aiassist:focus-visible,
.richtexteditor rte-toolbar-arrowbutton.rte_command_aiassist:focus-visible,
.richtexteditor rte-toolbar-dropdown.rte_command_aiassist:focus-visible,
.richtexteditor rte-control-toolbar rte-toolbar-button.rte_command_aiassist:focus-visible,
.richtexteditor rte-control-toolbar rte-toolbar-arrowbutton.rte_command_aiassist:focus-visible,
.richtexteditor rte-control-toolbar rte-toolbar-dropdown.rte_command_aiassist:focus-visible {
    color: #0f172a;
}

.richtexteditor rte-toolbar-button.rte_command_aiassist.rte-command-active,
.richtexteditor rte-toolbar-arrowbutton.rte_command_aiassist.rte-command-active,
.richtexteditor rte-toolbar-dropdown.rte_command_aiassist.rte-command-active,
.richtexteditor rte-control-toolbar rte-toolbar-button.rte_command_aiassist.rte-command-active,
.richtexteditor rte-control-toolbar rte-toolbar-arrowbutton.rte_command_aiassist.rte-command-active,
.richtexteditor rte-control-toolbar rte-toolbar-dropdown.rte_command_aiassist.rte-command-active {
    color: #0f172a;
}

.richtexteditor.rte-ai-chat-host,
.richtexteditor.rte-ai-review-host {
    position: relative;
    min-height: 520px;
}

.richtexteditor .rte-ai-chat-panel {
    position: absolute;
    top: 48px;
    right: 12px;
    bottom: 12px;
    width: min(420px, calc(100% - 24px));
    z-index: 6;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(180px, 1fr) auto auto;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(28, 42, 59, 0.12);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
}

.richtexteditor .rte-ai-review-panel {
    position: absolute;
    top: 48px;
    right: 12px;
    bottom: 12px;
    width: min(360px, calc(100% - 24px));
    z-index: 6;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(28, 42, 59, 0.12);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
}

.richtexteditor .rte-ai-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.richtexteditor .rte-ai-chat-header-copy {
    min-width: 0;
}

.richtexteditor .rte-ai-chat-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-title-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #1559d6;
    background: linear-gradient(180deg, #f8fbff 0%, #e8f3ff 100%);
    box-shadow: inset 0 0 0 1px rgba(21, 89, 214, 0.14);
}

.richtexteditor .rte-ai-chat-title-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.richtexteditor .rte-ai-chat-title {
    font-size: 14px;
    font-weight: 800;
    color: #1c2a3b;
}

.richtexteditor .rte-ai-chat-subtitle {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.5;
    color: #64758a;
}

.richtexteditor .rte-ai-chat-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.richtexteditor .rte-ai-hero,
.rte-panel-aiassist .rte-ai-hero {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 255, 0.97) 100%);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.richtexteditor .rte-ai-hero.is-chat {
    margin-top: -2px;
}

.rte-panel-aiassist .rte-ai-hero.is-dialog {
    margin-bottom: 2px;
}

.richtexteditor .rte-ai-hero-media,
.rte-panel-aiassist .rte-ai-hero-media {
    position: relative;
    height: 88px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.16);
}

.richtexteditor .rte-ai-hero-image,
.rte-panel-aiassist .rte-ai-hero-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.richtexteditor .rte-ai-hero-body,
.rte-panel-aiassist .rte-ai-hero-body {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.richtexteditor .rte-ai-hero-kicker,
.rte-panel-aiassist .rte-ai-hero-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b7f94;
}

.richtexteditor .rte-ai-hero-title,
.rte-panel-aiassist .rte-ai-hero-title {
    font-size: 15px;
    line-height: 1.28;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-hero-copy,
.rte-panel-aiassist .rte-ai-hero-copy {
    font-size: 12px;
    line-height: 1.55;
    color: #5d7187;
}

.richtexteditor .rte-ai-panel-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(28, 42, 59, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.richtexteditor .rte-ai-panel-close-button:hover {
    background: #f1f5f9;
    border-color: rgba(28, 42, 59, 0.22);
    color: #0f172a;
}

.richtexteditor .rte-ai-panel-close-button:focus-visible {
    outline: none;
    border-color: rgba(21, 89, 214, 0.42);
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.18);
}

.richtexteditor .rte-ai-panel-close-button:active {
    transform: scale(0.95);
}

.richtexteditor .rte-ai-panel-close-button svg {
    display: block;
    pointer-events: none;
}

.richtexteditor .rte-ai-chat-header-button,
.richtexteditor .rte-ai-chat-scope-button,
.richtexteditor .rte-ai-chat-quick-button,
.richtexteditor .rte-ai-chat-action-button,
.richtexteditor .rte-ai-chat-send-button {
    border: 0;
    border-radius: 8px;
    padding: 7px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.richtexteditor .rte-ai-chat-header-button:hover:not([disabled]),
.richtexteditor .rte-ai-chat-scope-button:hover:not([disabled]),
.richtexteditor .rte-ai-chat-quick-button:hover:not([disabled]),
.richtexteditor .rte-ai-chat-action-button:hover:not([disabled]) {
    background: #e3eaf2;
}

.richtexteditor .rte-ai-chat-header-button,
.richtexteditor .rte-ai-chat-scope-button,
.richtexteditor .rte-ai-chat-quick-button,
.richtexteditor .rte-ai-chat-action-button {
    color: #39526d;
    background: #eef3f8;
}

.richtexteditor .rte-ai-chat-send-button {
    color: #f7fbff;
    background: linear-gradient(180deg, #2873e8 0%, #1559d6 100%);
    box-shadow: 0 4px 10px rgba(21, 89, 214, 0.2);
}

.richtexteditor .rte-ai-chat-send-button:hover:not([disabled]) {
    background: linear-gradient(180deg, #3b80ee 0%, #1a63e0 100%);
    box-shadow: 0 6px 14px rgba(21, 89, 214, 0.26);
}

.richtexteditor .rte-ai-chat-send-button[disabled],
.richtexteditor .rte-ai-chat-header-button[disabled],
.richtexteditor .rte-ai-chat-scope-button[disabled],
.richtexteditor .rte-ai-chat-quick-button[disabled],
.richtexteditor .rte-ai-chat-action-button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.richtexteditor .rte-ai-chat-context-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-scope-button.is-active {
    color: #1559d6;
    background: #e7f1ff;
    box-shadow: inset 0 0 0 1px rgba(21, 89, 214, 0.16);
}

.richtexteditor .rte-ai-chat-context-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f4f8ff;
    color: #5a6f84;
    font-size: 11px;
    font-weight: 700;
}

.richtexteditor .rte-ai-chat-context-preview {
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fbff;
    border: 1px solid rgba(29, 103, 186, 0.1);
    color: #506273;
    font-size: 12px;
    line-height: 1.5;
    max-height: 70px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
    mask-image: linear-gradient(180deg, #000 55%, transparent);
}

.richtexteditor .rte-ai-chat-quick-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
}
.richtexteditor .rte-ai-chat-quick-row > .rte-ai-chat-quick-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.richtexteditor .rte-ai-chat-feed {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 10px;
    padding-right: 2px;
}

.richtexteditor .rte-ai-chat-empty {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px dashed rgba(28, 42, 59, 0.14);
    color: #64758a;
    font-size: 12px;
    line-height: 1.55;
}

.richtexteditor .rte-ai-chat-message {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(28, 42, 59, 0.08);
    background: #f9fbff;
}

.richtexteditor .rte-ai-chat-message.is-user {
    background: #eef5ff;
    border-color: rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-chat-message.is-assistant {
    background: #ffffff;
}

.richtexteditor .rte-ai-chat-message.is-error {
    background: #fff5f5;
    border-color: rgba(196, 59, 59, 0.12);
}

.richtexteditor .rte-ai-chat-message-meta {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7a8898;
}

.richtexteditor .rte-ai-chat-message-text {
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.6;
    color: #31465c;
}

.richtexteditor .rte-ai-chat-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-composer {
    display: grid;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-input {
    width: 100%;
    min-height: 88px;
    padding: 11px 12px;
    border: 1px solid rgba(28, 42, 59, 0.12);
    border-radius: 14px;
    background: #fcfdff;
    font: inherit;
    font-size: 13px;
    color: #1c2a3b;
    box-sizing: border-box;
    resize: vertical;
}

.richtexteditor .rte-ai-chat-composer-actions {
    display: flex;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-composer-actions button {
    flex: 1 1 0;
    min-width: 0;
}

.richtexteditor .rte-ai-chat-status {
    min-height: 18px;
    font-size: 11px;
    line-height: 1.5;
    color: #64758a;
}

.richtexteditor .rte-ai-review-header,
.richtexteditor .rte-ai-review-item-meta,
.richtexteditor .rte-ai-review-item-actions,
.richtexteditor .rte-ai-review-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-review-header {
    justify-content: space-between;
}

.richtexteditor .rte-ai-review-header-copy {
    min-width: 0;
}

.richtexteditor .rte-ai-review-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.richtexteditor .rte-ai-review-title-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #1559d6;
    background: linear-gradient(180deg, #f8fbff 0%, #e8f3ff 100%);
    box-shadow: inset 0 0 0 1px rgba(21, 89, 214, 0.14);
}

.richtexteditor .rte-ai-review-title-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.richtexteditor .rte-ai-review-title {
    font-size: 14px;
    font-weight: 800;
    color: #1c2a3b;
}

.richtexteditor .rte-ai-review-sync-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-sync-badge.is-local {
    color: #5b6877;
    background: rgba(148, 163, 184, 0.18);
}

.richtexteditor .rte-ai-review-sync-badge.is-shared,
.richtexteditor .rte-ai-review-sync-badge.is-live {
    color: #166534;
    background: rgba(34, 197, 94, 0.14);
}

.richtexteditor .rte-ai-review-sync-badge.is-syncing {
    color: #1559d6;
    background: rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-review-sync-badge.is-error {
    color: #b45309;
    background: rgba(245, 158, 11, 0.18);
}

.richtexteditor .rte-ai-review-subtitle,
.richtexteditor .rte-ai-review-item-stamp {
    font-size: 11px;
    line-height: 1.5;
    color: #64758a;
}

.richtexteditor .rte-ai-review-subtitle {
    margin-top: 3px;
}

.richtexteditor .rte-ai-review-item-stamp.is-remote {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f5d73;
    background: rgba(14, 116, 144, 0.12);
}

.richtexteditor .rte-ai-review-item-stamp.is-type,
.richtexteditor .rte-ai-review-item-stamp.is-language {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-item-stamp.is-type {
    color: #1d4d8f;
    background: rgba(37, 99, 235, 0.12);
}

.richtexteditor .rte-ai-review-item-stamp.is-current {
    color: #1559d6;
    background: rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-review-item-stamp.is-opened {
    color: #1f6d46;
    background: rgba(34, 142, 86, 0.14);
}

.richtexteditor .rte-ai-review-item-stamp.is-language {
    color: #7c3f00;
    background: rgba(245, 158, 11, 0.14);
}

.richtexteditor .rte-ai-review-header-actions {
    display: flex;
    gap: 6px;
}

.richtexteditor .rte-ai-review-header-button,
.richtexteditor .rte-ai-review-control-button,
.richtexteditor .rte-ai-review-action-button {
    border: 0;
    border-radius: 8px;
    padding: 7px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.richtexteditor .rte-ai-review-header-button,
.richtexteditor .rte-ai-review-control-button,
.richtexteditor .rte-ai-review-action-button {
    color: #39526d;
    background: #eef3f8;
}

.richtexteditor .rte-ai-review-header-button:hover:not([disabled]),
.richtexteditor .rte-ai-review-control-button:hover:not([disabled]),
.richtexteditor .rte-ai-review-action-button:hover:not([disabled]) {
    background: #e3eaf2;
}

.richtexteditor .rte-ai-review-header-button:focus-visible,
.richtexteditor .rte-ai-review-control-button:focus-visible,
.richtexteditor .rte-ai-review-action-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.16);
}

.richtexteditor .rte-ai-review-filter-select {
    min-width: 124px;
    padding: 7px 10px;
    border: 1px solid rgba(28, 42, 59, 0.12);
    border-radius: 8px;
    background: #fcfdff;
    color: #39526d;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
}

.richtexteditor .rte-ai-review-action-button.is-primary {
    color: #f7fbff;
    background: linear-gradient(180deg, #2873e8 0%, #1559d6 100%);
    box-shadow: 0 4px 10px rgba(21, 89, 214, 0.2);
}

.richtexteditor .rte-ai-review-control-button.is-primary {
    color: #f7fbff;
    background: linear-gradient(180deg, #2873e8 0%, #1559d6 100%);
    box-shadow: 0 4px 10px rgba(21, 89, 214, 0.2);
}

.richtexteditor .rte-ai-review-control-button.is-primary:hover:not([disabled]),
.richtexteditor .rte-ai-review-action-button.is-primary:hover:not([disabled]) {
    background: linear-gradient(180deg, #3b80ee 0%, #1a63e0 100%);
    box-shadow: 0 6px 14px rgba(21, 89, 214, 0.26);
}

.richtexteditor .rte-ai-review-control-button.is-primary:focus-visible,
.richtexteditor .rte-ai-review-action-button.is-primary:focus-visible {
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.16), 0 6px 14px rgba(21, 89, 214, 0.26);
}

.richtexteditor .rte-ai-review-header-button[disabled],
.richtexteditor .rte-ai-review-control-button[disabled],
.richtexteditor .rte-ai-review-action-button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.richtexteditor .rte-ai-review-header-button[aria-busy="true"] {
    position: relative;
    padding-left: 28px;
}

.richtexteditor .rte-ai-review-header-button[aria-busy="true"]::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 50%;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    border-radius: 50%;
    border: 2px solid rgba(21, 89, 214, 0.25);
    border-top-color: #1559d6;
    animation: rte-ai-review-spin 0.85s linear infinite;
}

.richtexteditor .rte-ai-review-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.richtexteditor .rte-ai-review-summary-detail {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.55;
}

@keyframes rte-ai-review-spin {
    to {
        transform: rotate(360deg);
    }
}

.richtexteditor .rte-ai-review-summary-pill,
.richtexteditor .rte-ai-review-item-status,
.richtexteditor .rte-ai-review-item-reason {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.richtexteditor .rte-ai-review-summary-pill.is-pending,
.richtexteditor .rte-ai-review-item-status.is-pending {
    background: rgba(21, 89, 214, 0.1);
    color: #1559d6;
}

.richtexteditor .rte-ai-review-summary-pill.is-accepted,
.richtexteditor .rte-ai-review-item-status.is-accepted {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.richtexteditor .rte-ai-review-summary-pill.is-rejected,
.richtexteditor .rte-ai-review-item-status.is-rejected {
    background: rgba(148, 163, 184, 0.18);
    color: #475569;
}

.richtexteditor .rte-ai-review-summary-pill.is-stale,
.richtexteditor .rte-ai-review-item-status.is-stale {
    background: rgba(217, 119, 6, 0.14);
    color: #9a5b10;
}

.richtexteditor .rte-ai-review-summary-pill.is-remote {
    background: rgba(14, 116, 144, 0.14);
    color: #0f5d73;
}

.richtexteditor .rte-ai-review-summary-pill.is-current {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.richtexteditor .rte-ai-review-summary-pill.is-filtered {
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
}

.richtexteditor .rte-ai-review-summary-detail.is-redo {
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.16);
    color: #0f5f58;
}

.richtexteditor .rte-ai-review-summary-history {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    display: grid;
    gap: 6px;
}

.richtexteditor .rte-ai-review-summary-history.is-redo {
    background: rgba(240, 253, 250, 0.9);
    border: 1px solid rgba(15, 118, 110, 0.12);
}

.richtexteditor .rte-ai-review-summary-history-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-summary-history.is-redo .rte-ai-review-summary-history-title {
    color: #0f766e;
}

.richtexteditor .rte-ai-review-summary-history-item {
    display: grid;
    gap: 2px;
}

.richtexteditor .rte-ai-review-summary-history-label {
    font-size: 12px;
    font-weight: 700;
    color: #134e4a;
}

.richtexteditor .rte-ai-review-summary-history-detail {
    font-size: 12px;
    color: #0f5f58;
}

.richtexteditor .rte-ai-review-item-reason {
    background: rgba(191, 141, 59, 0.12);
    color: #7e5d17;
}

.richtexteditor .rte-ai-review-activity-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(14, 116, 144, 0.16);
    background: linear-gradient(180deg, rgba(240, 249, 255, 0.96) 0%, rgba(233, 246, 252, 0.96) 100%);
}

.richtexteditor .rte-ai-review-activity-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.richtexteditor .rte-ai-review-activity-title {
    font-size: 12px;
    font-weight: 800;
    color: #11485a;
}

.richtexteditor .rte-ai-review-activity-detail {
    font-size: 11px;
    line-height: 1.5;
    color: #4f6475;
}

.richtexteditor .rte-ai-review-activity-button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 12px;
    padding: 8px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #1559d6;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-review-controls {
    flex-wrap: wrap;
}

.richtexteditor .rte-ai-review-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.richtexteditor .rte-ai-review-type-chip {
    border: 0;
    border-radius: 999px;
    padding: 6px 10px;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    color: #425469;
    background: rgba(226, 232, 240, 0.78);
    transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.richtexteditor .rte-ai-review-type-chip:hover {
    background: rgba(203, 213, 225, 0.92);
}

.richtexteditor .rte-ai-review-type-chip.is-active {
    color: #f8fbff;
    background: linear-gradient(180deg, #2873e8 0%, #1559d6 100%);
    box-shadow: 0 6px 14px rgba(21, 89, 214, 0.22);
}

.richtexteditor .rte-ai-review-shortcuts {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a8898;
}

.richtexteditor .rte-ai-review-shortcuts.is-action-focused {
    padding: 6px 8px;
    border-radius: 999px;
    color: #36587b;
    background: rgba(21, 89, 214, 0.08);
}

.richtexteditor .rte-ai-review-shortcuts.is-card-focused {
    padding: 6px 8px;
    border-radius: 999px;
    color: #596f86;
    background: rgba(148, 163, 184, 0.14);
}

.richtexteditor .rte-ai-review-shortcuts.is-panel-focused {
    padding: 6px 8px;
    border-radius: 999px;
    color: #546476;
    background: rgba(226, 232, 240, 0.7);
}

.richtexteditor .rte-ai-review-shortcuts.is-control-focused {
    padding: 6px 8px;
    border-radius: 999px;
    color: #4c5f77;
    background: rgba(191, 219, 254, 0.32);
}

.richtexteditor .rte-ai-review-feed {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 10px;
    padding-right: 2px;
}

.richtexteditor .rte-ai-review-empty {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px dashed rgba(28, 42, 59, 0.14);
    color: #64758a;
    font-size: 12px;
    line-height: 1.55;
}

.richtexteditor .rte-ai-review-empty-title {
    font-size: 13px;
    font-weight: 800;
    color: #18344f;
}

.richtexteditor .rte-ai-review-empty-detail {
    margin-top: 4px;
}

.richtexteditor .rte-ai-review-empty-undo-history {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(245, 249, 253, 0.9);
    border: 1px solid rgba(28, 42, 59, 0.08);
    display: grid;
    gap: 6px;
}

.richtexteditor .rte-ai-review-empty-undo-history-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #4f6f8f;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-empty-undo-history-item {
    display: grid;
    gap: 2px;
}

.richtexteditor .rte-ai-review-empty-undo-history-label {
    font-size: 12px;
    font-weight: 700;
    color: #18344f;
}

.richtexteditor .rte-ai-review-empty-undo-history-detail {
    font-size: 12px;
    color: #45627f;
}

.richtexteditor .rte-ai-review-empty-hint {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #36587b;
}

.richtexteditor .rte-ai-review-empty-previews {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.richtexteditor .rte-ai-review-empty-preview {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(232, 240, 250, 0.72);
    border: 1px solid rgba(28, 42, 59, 0.08);
}

.richtexteditor .rte-ai-review-empty-preview.is-actionable {
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.richtexteditor .rte-ai-review-empty-preview.is-actionable:hover {
    background: rgba(224, 236, 251, 0.92);
    border-color: rgba(21, 89, 214, 0.22);
    transform: translateY(-1px);
}

.richtexteditor .rte-ai-review-empty-preview.is-actionable:focus-visible {
    outline: 0;
    border-color: rgba(21, 89, 214, 0.32);
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.14);
}

.richtexteditor .rte-ai-review-empty-preview.is-primary-target {
    background: rgba(221, 233, 252, 0.96);
    border-color: rgba(21, 89, 214, 0.24);
    box-shadow: 0 6px 14px rgba(21, 89, 214, 0.14);
}

.richtexteditor .rte-ai-review-empty-preview-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6d7f92;
}

.richtexteditor .rte-ai-review-empty-preview-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-review-empty-preview-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(21, 89, 214, 0.1);
    color: #1d4d8f;
    font-size: 10px;
    font-weight: 700;
}

.richtexteditor .rte-ai-review-empty-preview-pill.is-current {
    background: rgba(21, 89, 214, 0.16);
    color: #1243a3;
}

.richtexteditor .rte-ai-review-empty-preview-pill.is-queue {
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
}

.richtexteditor .rte-ai-review-empty-preview-pill.is-focus {
    background: rgba(14, 116, 144, 0.12);
    color: #0f5d73;
}

.richtexteditor .rte-ai-review-empty-preview-pill.is-change {
    background: rgba(12, 150, 105, 0.12);
    color: #0f6a4e;
}

.richtexteditor .rte-ai-review-empty-preview-pill.is-impact {
    background: rgba(176, 120, 16, 0.14);
    color: #8a5d08;
}

.richtexteditor .rte-ai-review-empty-preview-line {
    margin-top: 4px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 10px;
    align-items: start;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    font-size: 11px;
    line-height: 1.45;
}

.richtexteditor .rte-ai-review-empty-preview-line.is-current {
    color: #18344f;
    font-weight: 600;
    background: linear-gradient(180deg, rgba(255, 247, 247, 0.92) 0%, rgba(252, 244, 244, 0.92) 100%);
}

.richtexteditor .rte-ai-review-empty-preview-line.is-result {
    color: #124b87;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(241, 248, 255, 0.94) 0%, rgba(236, 245, 255, 0.94) 100%);
}

.richtexteditor .rte-ai-review-empty-preview-line-label {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6d7f92;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(20, 36, 58, 0.08);
}

.richtexteditor .rte-ai-review-empty-preview-line.is-current .rte-ai-review-empty-preview-line-label {
    color: #8b2d2d;
    background: rgba(255, 255, 255, 0.94);
}

.richtexteditor .rte-ai-review-empty-preview-line.is-result .rte-ai-review-empty-preview-line-label {
    color: #124b87;
    background: rgba(255, 255, 255, 0.94);
}

.richtexteditor .rte-ai-review-empty-preview-line-text {
    display: block;
}

.richtexteditor .rte-ai-review-empty-preview-delta {
    display: inline;
    padding: 0 3px;
    border-radius: 4px;
}

.richtexteditor .rte-ai-review-empty-preview-delta.is-current {
    background: rgba(191, 53, 33, 0.12);
    color: #9f2b1c;
}

.richtexteditor .rte-ai-review-empty-preview-delta.is-result {
    background: rgba(21, 89, 214, 0.14);
    color: #124b87;
}

.richtexteditor .rte-ai-review-empty-preview-reason {
    margin-top: 5px;
    color: #526a83;
    font-size: 11px;
    line-height: 1.45;
}

.richtexteditor .rte-ai-review-empty-preview-result {
    margin-top: 5px;
    color: #124b87;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.richtexteditor .rte-ai-review-empty-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.richtexteditor .rte-ai-review-empty-actions .rte-ai-review-control-button {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-review-empty-action-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(21, 89, 214, 0.08);
    color: #1559d6;
}

.richtexteditor .rte-ai-review-control-button.is-primary .rte-ai-review-empty-action-pill {
    background: rgba(247, 251, 255, 0.18);
    color: #f7fbff;
}

.richtexteditor .rte-ai-review-history-title {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a8898;
}

.richtexteditor .rte-ai-review-history-entry {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(28, 42, 59, 0.08);
    background: rgba(244, 248, 255, 0.92);
}

.richtexteditor .rte-ai-review-history-meta {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7a8898;
}

.richtexteditor .rte-ai-review-history-text {
    font-size: 12px;
    line-height: 1.55;
    color: #31465c;
}

.richtexteditor .rte-ai-review-item {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(28, 42, 59, 0.08);
    background: #f9fbff;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.richtexteditor .rte-ai-review-item:hover {
    border-color: rgba(21, 89, 214, 0.16);
    background: #f5f9ff;
}

.richtexteditor .rte-ai-review-item.is-active {
    border-color: rgba(21, 89, 214, 0.22);
    box-shadow: 0 0 0 2px rgba(21, 89, 214, 0.08);
    background: linear-gradient(180deg, #f9fbff 0%, #edf5ff 100%);
    transform: translateY(-1px);
}

.richtexteditor .rte-ai-review-item.is-opened {
    border-color: rgba(34, 142, 86, 0.2);
    box-shadow: 0 0 0 2px rgba(34, 142, 86, 0.08);
    background: linear-gradient(180deg, #fbfffc 0%, #edf8f2 100%);
}

.richtexteditor .rte-ai-review-item:focus-visible {
    outline: none;
    border-color: rgba(21, 89, 214, 0.28);
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.16);
}

.richtexteditor .rte-ai-review-item-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    color: #1c2a3b;
}

.richtexteditor .rte-ai-review-item-before,
.richtexteditor .rte-ai-review-item-after {
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.55;
}

.richtexteditor .rte-ai-review-item-before {
    background: rgba(214, 67, 67, 0.08);
    color: #8b2d2d;
    text-decoration: line-through;
}

.richtexteditor .rte-ai-review-item-after {
    background: rgba(57, 159, 93, 0.1);
    color: #1f6e42;
}

.richtexteditor .rte-ai-review-item-undo-note,
.richtexteditor .rte-ai-review-item-redo-note {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.55;
}

.richtexteditor .rte-ai-review-item-undo-note {
    background: rgba(21, 89, 214, 0.08);
    border: 1px solid rgba(21, 89, 214, 0.16);
    color: #12439a;
}

.richtexteditor .rte-ai-review-item-redo-note {
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.16);
    color: #0f5f58;
}

.richtexteditor .rte-ai-review-item-history {
    display: grid;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(21, 89, 214, 0.05);
    border: 1px solid rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-review-item-history.is-redo {
    background: rgba(15, 118, 110, 0.05);
    border-color: rgba(15, 118, 110, 0.12);
}

.richtexteditor .rte-ai-review-item-history-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #516476;
}

.richtexteditor .rte-ai-review-item-history.is-redo .rte-ai-review-item-history-title {
    color: #0f5f58;
}

.richtexteditor .rte-ai-review-item-history-item {
    display: grid;
    gap: 3px;
}

.richtexteditor .rte-ai-review-item-history-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    color: #1c2a3b;
}

.richtexteditor .rte-ai-review-item-history-detail {
    font-size: 12px;
    line-height: 1.5;
    color: #4b6178;
}

.richtexteditor .rte-ai-review-item-actions {
    flex-wrap: wrap;
}

.rte-panel-aiassist rte-dialog-inner {
    /* 2026-05-08: tightened from 580 → 540 since the per-field labels
       and the "Suggested next step" guidance card are gone. The flex
       row still wraps gracefully when Translate's Language column is
       visible at the new width. */
    width: min(540px, calc(100vw - 32px)) !important;
    max-width: 540px !important;
}

/* 2026-05-08 (v20260508s): header mode chip — small pill that rides
   beside the "Ask AI" title text, surfacing the active mode (e.g.
   "Proofread", "Translate · Spanish") so users see what the dialog
   will run before scanning the Action select. Hidden when no mode is
   selected. The dialog frame uses custom element tags
   (rte-dialog-header) not classes, so target by element name. */
.rte-panel-aiassist rte-dialog-header .rte-ai-dialog-mode-chip {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    /* 2026-05-08 fix: keep this chip glued to the title on the LEFT side.
       The dialog header uses `display: flex; justify-content: space-between`,
       and `rte-dialog-header-text` has `flex: 999` (theme baseline). When
       the chip was inserted as a sibling of the title text it drifted to
       the right edge and crashed into the absolutely-positioned close X.
       margin-right: auto pushes any whitespace AFTER the chip to the right,
       guaranteeing the chip stays next to "Ask AI". */
    margin-right: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(21, 89, 214, 0.1);
    color: #1559d6;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.5;
    border: 1px solid rgba(21, 89, 214, 0.18);
    white-space: nowrap;
    flex: 0 0 auto;
    align-self: center;
}

/* Belt-and-braces: force the title element itself to pack its children to
   the start, no matter what skin / theme overrides are in effect. */
.rte-panel-aiassist rte-dialog-header > rte-dialog-header-text {
    justify-content: flex-start !important;
    gap: 0;
}

.rte-panel-aiassist rte-dialog-header .rte-ai-dialog-mode-chip:empty {
    display: none;
}

/* 2026-05-08 (v20260508s): icon-only Copy in the run row. Drops the
   text label, shrinks to a square so Generate can dominate the row.
   Selector includes both .is-icon-only and .secondary so it beats the
   later same-specificity rule
   `.demo-ai-run-row button:not(.is-primary)` that otherwise sets
   flex: 1 1 0; on the same node. */
.rte-panel-aiassist .demo-ai-run-row button.is-icon-only.secondary {
    flex: 0 0 32px;
    min-width: 32px;
    width: 32px;
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
}

.rte-panel-aiassist .demo-ai-run-row button.is-icon-only.secondary .rte-ai-review-v2-action-icon {
    margin: 0;
}

.rte-panel-aiassist .demo-ai-dialog-grid {
    display: grid;
    gap: 5px;
    padding: 2px 2px 2px;
}

.rte-panel-aiassist .demo-ai-compact-controls {
    /* 2026-05-08 second pass: dropped the per-field stacked uppercase
       labels (Action / Language / Use / blank-spacer). Each control now
       relies on its own value or button text to identify itself, so the
       row collapses to a single horizontal line of inputs. Padding /
       gap tightened to match the new single-row height. The flex wrap
       behavior from the first pass is kept so the row still breaks into
       two lines when Translate's Language select is visible at narrow
       dialog widths. */
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.rte-panel-aiassist .demo-ai-compact-controls > .demo-ai-field {
    flex: 1 1 auto;
    min-width: 0;
}

.rte-panel-aiassist .demo-ai-compact-controls > .demo-ai-action-field {
    flex: 1 1 200px;
    min-width: 180px;
}

.rte-panel-aiassist .demo-ai-compact-controls > .demo-ai-language-field {
    flex: 0 1 140px;
    min-width: 120px;
}

.rte-panel-aiassist .demo-ai-compact-controls > .demo-ai-scope-field {
    flex: 1 1 200px;
    min-width: 180px;
}

.rte-panel-aiassist .demo-ai-compact-controls > .demo-ai-run-field {
    flex: 1 1 180px;
    min-width: 160px;
}

.rte-panel-aiassist .demo-ai-compact-controls.is-no-language {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto;
}

.rte-panel-aiassist .demo-ai-compact-controls .demo-ai-language-field[hidden] {
    display: none;
}

.rte-panel-aiassist .demo-ai-field {
    display: grid;
    gap: 0;
    min-width: 0;
}

/* 2026-05-08: dropped from compact-controls. Source/Result fields wear a
   small corner pill (.demo-ai-text-tag) instead of a stacked label. */
.rte-panel-aiassist .demo-ai-dialog-grid label {
    display: none;
}

.rte-panel-aiassist .demo-ai-source-field,
.rte-panel-aiassist .demo-ai-result-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* 2026-05-08 (v20260508u): Source/Result label moved out of the textarea
   onto its own line. The earlier corner-pill overlay (.demo-ai-text-tag)
   needed a 22px text reserve inside the textarea, which clipped against
   the first line of loaded text and was fiddly to read at 9px caps. The
   inline label is taller-on-page but reads instantly and lets the
   textarea use its full height for content. */
.rte-panel-aiassist .demo-ai-text-label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    line-height: 1.2;
    padding-left: 2px;
}

.rte-panel-aiassist .demo-ai-dialog-grid select,
.rte-panel-aiassist .demo-ai-dialog-grid textarea {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid rgba(28, 42, 59, 0.14);
    border-radius: 7px;
    background: #fcfdff;
    font: inherit;
    font-size: 13px;
    color: #1c2a3b;
    box-sizing: border-box;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.rte-panel-aiassist .demo-ai-dialog-grid select:focus,
.rte-panel-aiassist .demo-ai-dialog-grid select:focus-visible,
.rte-panel-aiassist .demo-ai-dialog-grid textarea:focus,
.rte-panel-aiassist .demo-ai-dialog-grid textarea:focus-visible {
    border-color: rgba(21, 89, 214, 0.42);
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.16);
}

.rte-panel-aiassist .demo-ai-dialog-grid textarea {
    min-height: 64px;
    resize: vertical;
    line-height: 1.45;
}

.rte-panel-aiassist .demo-ai-dialog-grid textarea[readonly] {
    background: #f8fbff;
}

.rte-panel-aiassist .demo-ai-mode-help {
    margin-top: 0;
    font-size: 11px;
    line-height: 1.4;
    color: #64758a;
    grid-column: 1 / -1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rte-panel-aiassist .demo-ai-mode-help:empty {
    display: none;
}

.rte-panel-aiassist .demo-actions-row {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rte-panel-aiassist .demo-actions-row button {
    flex: 1 1 90px;
    min-width: 0;
    min-height: 28px;
    padding: 4px 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(28, 42, 59, 0.14);
    border-radius: 6px;
    background: #ffffff;
    color: #1c2a3b;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.rte-panel-aiassist .demo-actions-row button:hover:not([disabled]) {
    background: #f4f7fb;
    border-color: rgba(28, 42, 59, 0.24);
}

.rte-panel-aiassist .demo-actions-row button:focus-visible {
    outline: none;
    border-color: rgba(21, 89, 214, 0.42);
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.16);
}

.rte-panel-aiassist .demo-actions-row button:active:not([disabled]) {
    transform: translateY(1px);
}

.rte-panel-aiassist .demo-actions-row button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.rte-panel-aiassist .demo-ai-run-row .is-primary,
.rte-panel-aiassist .demo-ai-apply-row .is-primary {
    background: linear-gradient(180deg, #2873e8 0%, #1559d6 100%);
    border-color: rgba(21, 89, 214, 0.7);
    color: #ffffff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 8px 18px rgba(21, 89, 214, 0.2);
}

.rte-panel-aiassist .demo-ai-run-row .is-primary:hover:not([disabled]),
.rte-panel-aiassist .demo-ai-apply-row .is-primary:hover:not([disabled]) {
    background: linear-gradient(180deg, #3b80ee 0%, #1a63e0 100%);
    border-color: rgba(21, 89, 214, 0.82);
}

.rte-panel-aiassist .demo-ai-scope-row button,
.rte-panel-aiassist .demo-ai-run-row button {
    min-height: 28px;
}

.rte-panel-aiassist .demo-ai-apply-row {
    margin-top: 0;
    padding-top: 6px;
    border-top: 1px solid rgba(28, 42, 59, 0.08);
}

.rte-panel-aiassist .demo-ai-apply-row .is-primary {
    flex-basis: 140px;
}

/* 2026-05-08 (v20260508s): visual hierarchy on the apply row.
   - Discard pinned right with subtle styling so the destructive choice
     never competes with Apply.
   - The alternative apply buttons (Replace selection / Replace doc /
     Insert below / Preview) ride lower contrast than the primary Apply
     so the eye lands on Apply first. They keep their full label and
     remain fully accessible. */
.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="reject"] {
    flex: 0 0 auto;
    margin-left: auto;
    background: transparent;
    border-color: transparent;
    color: #8a94a3;
}

.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="reject"]:hover:not([disabled]) {
    background: rgba(196, 59, 59, 0.06);
    border-color: rgba(196, 59, 59, 0.18);
    color: #a8453d;
}

.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="selection"],
.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="document"],
.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="insert"],
.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="preview"] {
    background: #f6f8fc;
    color: #475569;
    border-color: rgba(28, 42, 59, 0.1);
}

.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="selection"]:hover:not([disabled]),
.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="document"]:hover:not([disabled]),
.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="insert"]:hover:not([disabled]),
.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="preview"]:hover:not([disabled]) {
    background: #eef2f8;
    color: #1c2a3b;
    border-color: rgba(28, 42, 59, 0.22);
}

.rte-panel-aiassist .demo-ai-text-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.rte-panel-aiassist .demo-ai-source-field textarea,
.rte-panel-aiassist .demo-ai-result-field textarea {
    min-height: 88px;
}

.rte-panel-aiassist .demo-ai-dialog-status {
    min-height: 16px;
    font-size: 11px;
    line-height: 1.5;
    color: #6b7d90;
}

.rte-panel-aiassist .demo-ai-dialog-status:empty {
    display: none;
}

.rte-panel-aiassist .demo-ai-apply-guidance {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
    margin-top: 0;
    padding: 4px 8px;
    border-radius: 7px;
    border: 1px solid rgba(21, 89, 214, 0.14);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.94) 0%, rgba(232, 241, 255, 0.94) 100%);
}

.rte-panel-aiassist .demo-ai-apply-guidance-header {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.rte-panel-aiassist .demo-ai-apply-guidance-title {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1753b8;
}

.rte-panel-aiassist .demo-ai-apply-guidance-badge {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #1f3f73;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid rgba(21, 89, 214, 0.14);
}

.rte-panel-aiassist .demo-ai-apply-guidance-detail {
    flex: 1 1 220px;
    font-size: 11px;
    line-height: 1.4;
    color: #315277;
}

/* 2026-05-08: self-scoped because the dialog wrapper class
   (.rte-panel-aiassist) is sometimes set on an outer dialog frame, not on
   a direct ancestor of the grid where this button lives. Without these
   button-class-only rules the toggle rendered as a default browser button
   spanning the full grid row. The .button rule below also wins over the
   generic dialog button styles thanks to !important on the structural
   declarations (size, alignment, background) — the visual ones are kept
   as plain rules so customers can still skin them. */
.rte-panel-aiassist .demo-ai-details-toggle,
.demo-ai-details-toggle,
button.demo-ai-details-toggle {
    align-self: start !important;
    justify-self: start !important;
    width: auto !important;
    min-width: 0 !important;
    margin-top: 4px;
    padding: 4px 12px;
    background: transparent;
    border: 1px solid rgba(28, 42, 59, 0.16);
    border-radius: 8px;
    color: #475569;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rte-panel-aiassist .demo-ai-details-toggle::before,
.demo-ai-details-toggle::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 2px;
    transition: transform 120ms ease;
    color: #6b7280;
    font-size: 10px;
}

.rte-panel-aiassist .demo-ai-details-toggle[aria-expanded="true"]::before,
.demo-ai-details-toggle[aria-expanded="true"]::before {
    transform: rotate(90deg);
}

.rte-panel-aiassist .demo-ai-details-toggle:hover:not([disabled]),
.demo-ai-details-toggle:hover:not([disabled]) {
    background: #f4f7fb;
    border-color: rgba(28, 42, 59, 0.28);
    color: #0f172a;
}

.rte-panel-aiassist .demo-ai-details-toggle:focus-visible,
.demo-ai-details-toggle:focus-visible {
    outline: none;
    border-color: rgba(21, 89, 214, 0.45);
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.18);
}

.rte-panel-aiassist .demo-ai-insight-grid.is-collapsed {
    display: none;
}

.rte-panel-aiassist .demo-ai-review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.rte-panel-aiassist .demo-ai-review-card {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(28, 42, 59, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 255, 0.96) 100%);
    box-shadow: 0 10px 24px rgba(18, 33, 56, 0.05);
}

.rte-panel-aiassist .demo-ai-review-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rte-panel-aiassist .demo-ai-review-card.preview-old {
    background: #fbfbfd;
    border-left: 3px solid rgba(196, 59, 59, 0.45);
    border-color: rgba(196, 59, 59, 0.18);
}

.rte-panel-aiassist .demo-ai-review-card.preview-new {
    background: #fbfdfc;
    border-left: 3px solid rgba(44, 138, 79, 0.45);
    border-color: rgba(44, 138, 79, 0.18);
}

.rte-panel-aiassist .demo-ai-review-card.preview-old strong {
    color: #a8453d;
}

.rte-panel-aiassist .demo-ai-review-card.preview-new strong {
    color: #2a7f4b;
}

.rte-panel-aiassist .demo-ai-review-text {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    white-space: pre-wrap;
    font: inherit;
    font-size: 13px;
    line-height: 1.55;
    color: #3b4f66;
}

.rte-panel-aiassist .demo-ai-insight-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
}

.rte-panel-aiassist .demo-ai-reason-panel {
    padding: 6px 9px;
    border-radius: 8px;
    border: 1px solid rgba(135, 87, 31, 0.14);
    background: #fffaf2;
}

.rte-panel-aiassist .demo-ai-reason-copy {
    font-size: 11px;
    line-height: 1.4;
    color: #6f5a33;
    margin-top: 2px;
}

.rte-panel-aiassist .demo-ai-plan-panel {
    padding: 6px 9px;
    border-radius: 8px;
    border: 1px solid rgba(28, 42, 59, 0.12);
    background: #fbfcff;
}

.rte-panel-aiassist .demo-ai-plan-note {
    font-size: 11px;
    line-height: 1.45;
    color: #64758a;
    margin-bottom: 4px;
}

.rte-panel-aiassist .demo-ai-plan-status {
    min-height: 0;
    margin-bottom: 0;
    font-size: 12px;
    line-height: 1.55;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rte-panel-aiassist .demo-ai-plan-status.is-stale {
    margin-bottom: 10px;
    color: #8a4f13;
    font-weight: 700;
}

.rte-panel-aiassist .demo-ai-plan-status-message {
    flex: 1 1 auto;
}

.rte-panel-aiassist .demo-ai-plan-status-action {
    flex: 0 0 auto;
    white-space: nowrap;
}

.rte-panel-aiassist .demo-ai-plan-summary {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.5;
    color: #64758a;
}

.rte-panel-aiassist .demo-ai-plan-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
    max-height: 110px;
    overflow: auto;
}

@media (max-width: 640px) {
    .rte-panel-aiassist .demo-ai-compact-controls,
    .rte-panel-aiassist .demo-ai-compact-controls.is-no-language {
        grid-template-columns: 1fr 1fr;
    }
    .rte-panel-aiassist .demo-ai-text-grid {
        grid-template-columns: 1fr;
    }
}

.rte-panel-aiassist .demo-ai-plan-item {
    display: grid;
    gap: 3px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f3f8ff;
    border: 1px solid rgba(29, 103, 186, 0.1);
}

.rte-panel-aiassist .demo-ai-plan-item.is-empty {
    background: #f8fafc;
    border-color: rgba(28, 42, 59, 0.08);
}

.rte-panel-aiassist .demo-ai-plan-type {
    font-size: 12px;
    font-weight: 700;
    color: #1c2a3b;
}

.rte-panel-aiassist .demo-ai-plan-copy {
    font-size: 11px;
    line-height: 1.5;
    color: #64758a;
}

.rte-panel-aiassist .demo-ai-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rte-panel-aiassist .demo-ai-plan-state {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rte-panel-aiassist .demo-ai-plan-state.is-done {
    background: rgba(57, 159, 93, 0.12);
    color: #1f6e42;
}

.rte-panel-aiassist .demo-ai-plan-state.is-skipped {
    background: rgba(120, 137, 156, 0.12);
    color: #506273;
}

.rte-panel-aiassist .demo-ai-plan-actions {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rte-panel-aiassist .demo-ai-plan-button {
    min-width: 0;
}

.rte-panel-aiassist .demo-ai-apply-row {
    padding-top: 2px;
}

.rte-panel-aiassist .demo-ai-apply-row button {
    flex: 1 1 120px;
}

/* 2026-05-08: highlight the recommended dialog button with a subtle blue
   border + glow only. Earlier builds also injected a "Recommended" pill via
   ::after with 92px right-padding inside the button — but the pill rendered
   visually disconnected from its button text (e.g. "Whole document" +
   floating "RECOMMENDED" badge looked like two separate buttons). The
   Suggested-next-step guidance card already surfaces the recommended action
   above the row, so the in-button pill was redundant and confusing. */
.rte-panel-aiassist .demo-ai-scope-row button[data-rte-ai-dialog-recommended="true"],
.rte-panel-aiassist .demo-ai-run-row button[data-rte-ai-dialog-recommended="true"],
.rte-panel-aiassist .demo-ai-apply-row button[data-rte-ai-dialog-recommended="true"] {
    border-color: rgba(21, 89, 214, 0.32);
    box-shadow: 0 8px 18px rgba(21, 89, 214, 0.14), inset 0 0 0 1px rgba(21, 89, 214, 0.18);
}

@media (max-width: 900px) {
    .richtexteditor .rte-ai-chat-panel {
        left: 12px;
        width: auto;
    }

    .richtexteditor .rte-ai-review-panel {
        left: 12px;
        width: auto;
    }

    .richtexteditor.rte-ai-chat-host,
    .richtexteditor.rte-ai-review-host {
        min-height: 460px;
    }

    .richtexteditor .rte-ai-hero,
    .rte-panel-aiassist .rte-ai-hero {
        grid-template-columns: 1fr;
    }

    .richtexteditor .rte-ai-hero-media,
    .rte-panel-aiassist .rte-ai-hero-media {
        height: 120px;
    }

    .rte-panel-aiassist rte-dialog-inner {
        width: min(100vw - 24px, 580px) !important;
    }
}

@media (max-width: 620px) {
    .rte-panel-aiassist .demo-ai-compact-controls,
    .rte-panel-aiassist .demo-ai-compact-controls.is-no-language,
    .rte-panel-aiassist .demo-ai-text-grid {
        grid-template-columns: 1fr;
    }
}

.rte-panel-aiassist-menu {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 6px;
    width: min(460px, calc(100vw - 32px));
    min-width: min(300px, calc(100vw - 32px));
    max-height: min(420px, calc(100vh - 120px));
    overflow: auto;
    padding: 6px;
}

.rte-ai-menu-info {
    grid-column: 1 / -1;
    padding: 4px 6px 6px;
    border: 1px solid rgba(28, 42, 59, 0.08);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(248, 251, 255, 0.96) 0%, rgba(238, 245, 255, 0.88) 100%);
    margin-bottom: 2px;
}

/* 2026-05-08 compact pass: when the subtitle row is gone, drop the
   bottom padding so the title hugs the close button and the action
   list starts immediately below. */
.rte-ai-menu-info.is-minimal {
    padding: 4px 6px;
}

.rte-ai-menu-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rte-ai-menu-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, #eef5ff 0%, #dceaff 100%);
    color: #355d9a;
    box-shadow: inset 0 0 0 1px rgba(53, 93, 154, 0.12);
    flex: 0 0 auto;
}

.rte-ai-menu-title-icon svg {
    width: 13px;
    height: 13px;
    display: block;
}

.rte-ai-menu-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #1c2a3b;
    flex: 1 1 auto;
}

.rte-ai-menu-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(28, 42, 59, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}
.rte-ai-menu-close-button:hover {
    background: #f1f5f9;
    border-color: rgba(28, 42, 59, 0.22);
    color: #0f172a;
}
.rte-ai-menu-close-button:focus-visible {
    outline: none;
    border-color: rgba(21, 89, 214, 0.42);
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.18);
}
.rte-ai-menu-close-button:active {
    transform: scale(0.95);
}
.rte-ai-menu-close-button svg {
    display: block;
    pointer-events: none;
}

.rte-ai-menu-copy {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.35;
    color: #5e6b7d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rte-ai-menu-section {
    grid-column: 1 / -1;
    padding: 6px 4px 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #7a8898;
}

.rte-ai-menu-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(28, 42, 59, 0.07);
    border-radius: 10px;
    padding: 5px 7px;
    text-align: left;
    background: rgba(248, 251, 255, 0.74);
    cursor: pointer;
    font: inherit;
}

.rte-ai-menu-item:hover,
.rte-ai-menu-item:focus-visible {
    background: #eef5ff;
    border-color: rgba(53, 93, 154, 0.16);
    outline: none;
}

.rte-ai-menu-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 9px;
    background: #f3f7fd;
    color: #406287;
    box-shadow: inset 0 0 0 1px rgba(64, 98, 135, 0.12);
    flex: 0 0 auto;
}

.rte-ai-menu-item:hover .rte-ai-menu-item-icon,
.rte-ai-menu-item:focus-visible .rte-ai-menu-item-icon {
    background: #dfeeff;
    box-shadow: inset 0 0 0 1px rgba(53, 93, 154, 0.16);
}

.rte-ai-menu-item-icon svg {
    width: 13px;
    height: 13px;
    display: block;
}

.rte-ai-menu-item-body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.rte-ai-menu-item-title {
    font-size: 12px;
    font-weight: 700;
    color: #1c2a3b;
}

.rte-ai-menu-item-copy {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    font-size: 10.5px;
    line-height: 1.25;
    color: #64758a;
}

@media (max-width: 560px) {
    .rte-panel-aiassist-menu {
        grid-template-columns: 1fr;
        width: min(360px, calc(100vw - 24px));
        min-width: min(280px, calc(100vw - 24px));
        max-height: min(440px, calc(100vh - 120px));
    }

    .rte-ai-menu-copy {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        white-space: normal;
    }
}

.rte-ai-inline-preview {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 2px;
    padding: 4px 6px;
    border-radius: 12px;
    border: 1px solid rgba(28, 42, 59, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
    box-shadow: 0 10px 24px rgba(18, 33, 56, 0.08);
}

.rte-ai-inline-preview.is-review-surface {
    flex-direction: column;
    align-items: stretch;
}

.rte-ai-inline-preview.is-focused {
    box-shadow: 0 0 0 2px rgba(21, 89, 214, 0.18), 0 12px 28px rgba(18, 33, 56, 0.12);
}

.rte-ai-inline-preview:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 105, 236, 0.2), 0 12px 28px rgba(18, 33, 56, 0.12);
}

.rte-ai-inline-preview.is-review-active {
    border-color: rgba(21, 89, 214, 0.34);
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.16), 0 12px 28px rgba(18, 33, 56, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 245, 255, 0.98));
}

.rte-ai-inline-preview.is-review-active.is-queue-opened {
    border-color: rgba(34, 142, 86, 0.34);
    box-shadow: 0 0 0 3px rgba(34, 142, 86, 0.14), 0 12px 28px rgba(18, 33, 56, 0.12);
    background: linear-gradient(180deg, rgba(250, 255, 252, 0.98), rgba(236, 248, 242, 0.98));
}

.rte-ai-inline-preview.is-review-active.is-review-preview {
    border-color: rgba(191, 123, 17, 0.34);
    box-shadow: 0 0 0 3px rgba(191, 123, 17, 0.14), 0 12px 28px rgba(18, 33, 56, 0.12);
    background: linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(255, 245, 228, 0.98));
    cursor: pointer;
}

.rte-ai-inline-preview.is-review-active.is-review-preview:hover {
    box-shadow: 0 0 0 3px rgba(191, 123, 17, 0.18), 0 14px 32px rgba(18, 33, 56, 0.14);
}

.rte-ai-inline-preview.is-block {
    display: block;
    margin: 12px 0;
    padding: 12px;
}

.rte-ai-inline-preview-actions {
    display: inline-flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.rte-ai-inline-preview.is-review-surface .rte-ai-inline-preview-compare {
    order: 1;
    width: 100%;
    box-sizing: border-box;
}

.rte-ai-inline-preview.is-review-surface .rte-ai-inline-preview-actions {
    order: 2;
    width: 100%;
    box-sizing: border-box;
    padding-top: 8px;
    border-top: 1px solid rgba(20, 36, 58, 0.08);
}

.rte-ai-inline-preview-action-summary {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid rgba(28, 42, 59, 0.08);
    background: linear-gradient(180deg, rgba(242, 247, 255, 0.96), rgba(235, 242, 251, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.rte-ai-inline-preview-action-summary-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #58708c;
}

.rte-ai-inline-preview-action-summary-pills {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.rte-ai-inline-preview-action-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #1f3550;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.rte-ai-inline-preview-action-summary-detail {
    color: #51667d;
    font-size: 11px;
    line-height: 1.45;
}

.rte-ai-inline-preview-action-group {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 7px 8px 8px;
    border-radius: 14px;
    border: 1px solid rgba(28, 42, 59, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 252, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.rte-ai-inline-preview-action-group::before {
    content: none;
    display: none;
}

.rte-ai-inline-preview-action-group.is-current-lane {
    border-color: rgba(27, 96, 214, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 0 0 1px rgba(27, 96, 214, 0.08);
}

.rte-ai-inline-preview-action-group-header {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.rte-ai-inline-preview-action-group-title {
    padding-left: 2px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7f94;
}

.rte-ai-inline-preview-action-group-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(28, 97, 214, 0.12);
    color: #184a8d;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.rte-ai-inline-preview-action-group-detail {
    color: #5d7188;
    font-size: 10px;
    line-height: 1.45;
}

.rte-ai-inline-preview-action-group-body {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.rte-ai-inline-preview-action-group.is-review {
    background: linear-gradient(180deg, rgba(238, 246, 255, 0.96), rgba(230, 240, 250, 0.92));
}

.rte-ai-inline-preview-action-group.is-move {
    background: linear-gradient(180deg, rgba(246, 242, 252, 0.96), rgba(239, 247, 243, 0.92));
}

.rte-ai-inline-preview-action-group.is-decision {
    background: linear-gradient(180deg, rgba(243, 247, 252, 0.98), rgba(234, 240, 247, 0.94));
}

.rte-ai-inline-preview-action-group.is-recovery {
    background: linear-gradient(180deg, rgba(255, 248, 238, 0.96), rgba(236, 246, 243, 0.94));
}

.rte-ai-inline-preview.is-review-preview .rte-ai-inline-preview-actions {
    display: none;
}

.rte-ai-inline-preview.is-review-preview .rte-ai-inline-preview-launch,
.rte-ai-inline-preview.is-review-preview .rte-ai-inline-preview-focus {
    display: none;
}

.rte-ai-inline-preview.is-review-preview .rte-ai-inline-preview-current,
.rte-ai-inline-preview.is-review-preview .rte-ai-inline-preview-type,
.rte-ai-inline-preview.is-review-preview .rte-ai-inline-preview-language,
.rte-ai-inline-preview.is-review-preview .rte-ai-inline-preview-scope {
    display: none;
}

.rte-ai-inline-preview-button {
    border: 1px solid transparent;
    border-radius: 999px;
    min-height: 28px;
    padding: 5px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.rte-ai-inline-preview-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(18, 33, 56, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.rte-ai-inline-preview-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.18);
}

.rte-ai-inline-preview-button.is-disabled,
.rte-ai-inline-preview-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.rte-ai-inline-preview-button.is-enter-target {
    border-color: rgba(27, 96, 214, 0.28);
    box-shadow: 0 0 0 2px rgba(27, 96, 214, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.rte-ai-inline-preview-button.is-enter-target::after {
    content: attr(data-rte-ai-enter-target-label);
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(27, 96, 214, 0.14);
    color: #184a8d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    vertical-align: middle;
}

.rte-ai-inline-preview-button.is-accept {
    background: #16324f;
    color: #f7fbff;
    border-color: rgba(22, 50, 79, 0.18);
}

.rte-ai-inline-preview-button.is-review {
    background: #dce9f6;
    color: #173654;
    border-color: rgba(23, 54, 84, 0.08);
}

.rte-ai-inline-preview-button.is-previous {
    background: #f4edf8;
    color: #5d3e7e;
    border-color: rgba(93, 62, 126, 0.08);
}

.rte-ai-inline-preview-button.is-next {
    background: #eef6ec;
    color: #2f5b24;
    border-color: rgba(47, 91, 36, 0.08);
}

.rte-ai-inline-preview-button.is-shared {
    background: #e1f3f7;
    color: #0f5d73;
    border-color: rgba(15, 93, 115, 0.08);
}

.rte-ai-inline-preview-button.is-undo {
    background: #fff0e2;
    color: #8a4208;
    border-color: rgba(138, 66, 8, 0.08);
}

.rte-ai-inline-preview-button.is-redo {
    background: #e5f6f3;
    color: #0f5f58;
    border-color: rgba(15, 95, 88, 0.08);
}

.rte-ai-inline-preview-launch {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(191, 123, 17, 0.14);
    color: #6b4308;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-focus {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(14, 116, 144, 0.12);
    color: #0f5d73;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-review-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rte-ai-inline-preview-button.is-reject {
    background: #eef3f8;
    color: #425b76;
    border-color: rgba(66, 91, 118, 0.08);
}

.rte-ai-inline-preview-old,
.rte-ai-inline-preview-new {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    border-radius: 8px;
    padding: 6px 8px;
    vertical-align: top;
}

.rte-ai-inline-preview-compare {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid rgba(20, 36, 58, 0.1);
    background: rgba(255, 255, 255, 0.7);
}

.rte-ai-inline-preview-compare-header {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.rte-ai-inline-preview-compare-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.rte-ai-inline-preview-compare-pill {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(248, 250, 252, 0.94);
    color: #4e637a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rte-ai-inline-preview-compare-pill.is-status {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.rte-ai-inline-preview-compare-pill.is-opened {
    color: #1d4ed8;
    background: rgba(219, 234, 254, 0.94);
    border-color: rgba(29, 78, 216, 0.12);
}

.rte-ai-inline-preview-compare-pill.is-remote {
    color: #0f5d73;
    background: rgba(224, 242, 254, 0.94);
    border-color: rgba(14, 116, 144, 0.12);
}

.rte-ai-inline-preview-compare-pill.is-entry {
    color: #8a5d08;
    background: rgba(255, 247, 237, 0.96);
    border-color: rgba(217, 119, 6, 0.14);
}

.rte-ai-inline-preview-compare-pill.is-queue {
    color: #4f46e5;
    background: rgba(238, 242, 255, 0.94);
    border-color: rgba(79, 70, 229, 0.1);
}

.rte-ai-inline-preview-compare-pill.is-position {
    color: #7c2d12;
    background: rgba(255, 247, 237, 0.94);
    border-color: rgba(194, 65, 12, 0.1);
}

.rte-ai-inline-preview-compare-pill.is-type {
    color: #9a3412;
    background: rgba(255, 237, 213, 0.94);
    border-color: rgba(234, 88, 12, 0.12);
}

.rte-ai-inline-preview-compare-pill.is-language {
    color: #155e75;
    background: rgba(236, 254, 255, 0.94);
    border-color: rgba(8, 145, 178, 0.12);
}

.rte-ai-inline-preview-compare-pill.is-scope {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.rte-ai-inline-preview-compare-pill.is-steps {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.rte-ai-inline-preview-compare-pill.is-target {
    color: #5b6f84;
    background: rgba(248, 250, 252, 0.94);
}

.rte-ai-inline-preview-compare-glance {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: rgba(248, 250, 252, 0.82);
}

.rte-ai-inline-preview-compare-glance-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7f94;
}

.rte-ai-inline-preview-compare-glance-pills {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.rte-ai-inline-preview-compare-glance .rte-ai-review-item-glance-pill {
    min-height: 20px;
    padding: 0 8px;
}

.rte-ai-inline-preview-compare-glance-detail {
    font-size: 10px;
    line-height: 1.5;
    color: #61758b;
}

.rte-ai-inline-preview-compare > .rte-ai-inline-preview-shortcuts {
    align-self: flex-start;
    margin-top: 2px;
}

.rte-ai-inline-preview-plan {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 2px;
}

.rte-ai-inline-preview-plan-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7f94;
}

.rte-ai-inline-preview-plan-items {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rte-ai-inline-preview-plan-item {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.86);
    color: #4c6178;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.rte-ai-inline-preview-plan-detail,
.rte-ai-inline-preview-plan-preview,
.rte-ai-inline-preview-plan-followup-detail {
    font-size: 10px;
    line-height: 1.5;
    color: #61758b;
}

.rte-ai-inline-preview-plan-preview {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    color: #31475f;
    font-weight: 600;
}

.rte-ai-inline-preview-plan-preview-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #61758c;
}

.rte-ai-inline-preview-plan-preview-text {
    color: inherit;
}

.rte-ai-inline-preview-plan-followup {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
}

.rte-ai-inline-preview-plan-followup-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4d6380;
}

.rte-ai-inline-preview-compare-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #29415e;
}

.rte-ai-inline-preview-compare-detail {
    font-size: 10px;
    font-weight: 700;
    color: #657a90;
}

.rte-ai-inline-preview-compare-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.3;
}

.rte-ai-inline-preview-compare-text {
    display: inline;
}

.rte-ai-inline-preview-reason {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid rgba(191, 141, 59, 0.18);
    background: linear-gradient(180deg, rgba(191, 141, 59, 0.16), rgba(191, 141, 59, 0.1));
    color: #7e5d17;
    font-size: 11px;
    line-height: 1.45;
}

.rte-ai-inline-preview-reason-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8b6923;
}

.rte-ai-inline-preview-reason-copy {
    font-weight: 600;
}

.rte-ai-inline-preview-glance {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.rte-ai-inline-preview-glance .rte-ai-review-item-glance-pill {
    min-height: 20px;
    padding: 0 8px;
}

.rte-ai-inline-preview-current {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(21, 89, 214, 0.14);
    color: #173f70;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-opened {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(34, 142, 86, 0.14);
    color: #1f6d46;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-current.is-preview-target {
    background: rgba(191, 123, 17, 0.16);
    color: #7e4d0b;
}

.rte-ai-inline-preview-type,
.rte-ai-inline-preview-language {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-type {
    background: rgba(97, 82, 193, 0.12);
    color: #4f3d9d;
}

.rte-ai-inline-preview-language {
    background: rgba(36, 132, 98, 0.12);
    color: #1f6a50;
}

.rte-ai-inline-preview-scope {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(166, 110, 41, 0.12);
    color: #7a4d18;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-remote {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(14, 116, 144, 0.12);
    color: #0f5d73;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-queue {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(21, 89, 214, 0.1);
    color: #1f4b82;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-transition {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: #0f5f58;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-followup {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(21, 89, 214, 0.1);
    color: #1f4b82;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-redo {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: #0f5f58;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-undo {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.12);
    color: #8a4208;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-undo-next {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(217, 119, 6, 0.08);
    color: #9a4f08;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-redo-next {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.08);
    color: #115e59;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-shortcuts {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(18, 33, 56, 0.08);
    color: #435872;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.rte-ai-inline-preview-shortcuts-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #667a90;
}

.rte-ai-inline-preview-shortcuts-body {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.rte-ai-inline-preview-shortcuts.is-action {
    background: rgba(22, 102, 173, 0.14);
    color: #19486f;
}

.rte-ai-inline-preview-shortcuts.is-preview {
    background: rgba(191, 123, 17, 0.14);
    color: #6b4308;
}

.rte-ai-inline-preview-shortcuts-separator {
    font-size: 10px;
    font-weight: 700;
    color: #93a1af;
}

.rte-ai-inline-preview-shortcuts-segment {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 3px 7px 3px 3px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.76);
    color: #475b72;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.rte-ai-inline-preview-shortcuts-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 16px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(20, 36, 58, 0.08);
    color: #173654;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rte-ai-inline-preview-shortcuts-copy {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.rte-ai-inline-preview-shortcuts.is-action .rte-ai-inline-preview-shortcuts-segment {
    background: rgba(255, 255, 255, 0.82);
}

.rte-ai-inline-preview-shortcuts.is-action .rte-ai-inline-preview-shortcuts-key {
    background: rgba(21, 89, 214, 0.14);
    color: #1753b8;
}

.rte-ai-inline-preview-shortcuts.is-preview .rte-ai-inline-preview-shortcuts-key {
    background: rgba(191, 123, 17, 0.14);
    color: #8a5d08;
}

.rte-ai-inline-preview-old {
    background: rgba(214, 67, 67, 0.12);
    color: #9a3131;
}

.rte-ai-inline-preview-old .rte-ai-inline-preview-compare-label {
    color: #b45309;
}

.rte-ai-inline-preview-old .rte-ai-inline-preview-compare-text {
    text-decoration: line-through;
}

.rte-ai-inline-preview-new {
    background: rgba(57, 159, 93, 0.14);
    color: #1f6e42;
}

.rte-ai-inline-preview-new .rte-ai-inline-preview-compare-label {
    color: #166534;
}

.rte-ai-inline-preview.is-block .rte-ai-inline-preview-old,
.rte-ai-inline-preview.is-block .rte-ai-inline-preview-new {
    display: flex;
    padding: 10px 12px;
}

.rte-ai-inline-preview.is-block .rte-ai-inline-preview-compare {
    display: flex;
    margin-top: 8px;
}

.rte-ai-inline-preview.is-block .rte-ai-inline-preview-compare-text {
    display: block;
}

/* 2026-04-24 UI polish pass */
.richtexteditor.rte-ai-chat-host,
.richtexteditor.rte-ai-review-host {
    --rte-ai-ink: #14273d;
    --rte-ai-muted: #5d7388;
    --rte-ai-border: rgba(20, 36, 58, 0.12);
    --rte-ai-border-strong: rgba(20, 36, 58, 0.18);
    --rte-ai-shadow: 0 24px 56px rgba(15, 23, 42, 0.18);
    --rte-ai-card-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --rte-ai-panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.985) 52%, rgba(243, 248, 255, 0.99) 100%);
    --rte-ai-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.96) 100%);
    --rte-ai-soft-bg: rgba(246, 249, 253, 0.92);
    --rte-ai-accent: #1559d6;
    --rte-ai-accent-strong: #1148b3;
    --rte-ai-accent-soft: rgba(21, 89, 214, 0.12);
    --rte-ai-teal: #0f766e;
    --rte-ai-teal-soft: rgba(15, 118, 110, 0.12);
    --rte-ai-amber: #9a5d10;
    --rte-ai-amber-soft: rgba(217, 119, 6, 0.14);
    isolation: isolate;
    background:
        radial-gradient(circle at top right, rgba(21, 89, 214, 0.08), transparent 34%),
        radial-gradient(circle at 0% 100%, rgba(15, 118, 110, 0.06), transparent 28%);
}

.richtexteditor .rte-ai-chat-panel,
.richtexteditor .rte-ai-review-panel {
    overflow: hidden;
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
    border-color: var(--rte-ai-border);
    background: var(--rte-ai-panel-bg);
    box-shadow: var(--rte-ai-shadow);
    backdrop-filter: blur(16px) saturate(1.08);
}

.richtexteditor .rte-ai-chat-panel {
    width: min(448px, calc(100% - 24px));
}

.richtexteditor .rte-ai-review-panel {
    width: min(392px, calc(100% - 24px));
}

.richtexteditor .rte-ai-chat-panel::before,
.richtexteditor .rte-ai-review-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 88px;
    background:
        radial-gradient(circle at top right, rgba(21, 89, 214, 0.16), transparent 50%),
        linear-gradient(135deg, rgba(21, 89, 214, 0.08), rgba(15, 118, 110, 0.06) 58%, rgba(255, 255, 255, 0));
    pointer-events: none;
}

.richtexteditor .rte-ai-chat-panel::after,
.richtexteditor .rte-ai-review-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    pointer-events: none;
}

.richtexteditor .rte-ai-chat-panel > *,
.richtexteditor .rte-ai-review-panel > * {
    position: relative;
    z-index: 1;
}

.richtexteditor .rte-ai-chat-header,
.richtexteditor .rte-ai-review-header {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(20, 36, 58, 0.08);
}

.richtexteditor .rte-ai-review-section-label,
.richtexteditor .rte-ai-chat-section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 2px 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6a7f94;
}

.richtexteditor .rte-ai-review-section-label::after,
.richtexteditor .rte-ai-chat-section-label::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(21, 89, 214, 0.18), rgba(15, 118, 110, 0.08) 55%, transparent);
}

.richtexteditor .rte-ai-review-section-label.is-overview,
.richtexteditor .rte-ai-chat-section-label.is-compose {
    color: #245588;
}

.richtexteditor .rte-ai-review-section-label.is-controls,
.richtexteditor .rte-ai-chat-section-label.is-context {
    color: #48657f;
}

.richtexteditor .rte-ai-review-section-label.is-shortcuts,
.richtexteditor .rte-ai-chat-section-label.is-quick {
    color: #6d5f8c;
}

.richtexteditor .rte-ai-review-section-label.is-feed,
.richtexteditor .rte-ai-chat-section-label.is-feed {
    color: #5f7081;
}

.richtexteditor .rte-ai-chat-header-actions,
.richtexteditor .rte-ai-review-header-actions,
.richtexteditor .rte-ai-review-item-meta,
.richtexteditor .rte-ai-review-item-actions,
.richtexteditor .rte-ai-review-controls {
    flex-wrap: wrap;
}

.richtexteditor .rte-ai-chat-title,
.richtexteditor .rte-ai-review-title {
    font-size: 15px;
    letter-spacing: -0.01em;
    color: var(--rte-ai-ink);
}

.richtexteditor .rte-ai-chat-subtitle,
.richtexteditor .rte-ai-review-subtitle {
    color: var(--rte-ai-muted);
}

.richtexteditor .rte-ai-chat-title-icon,
.richtexteditor .rte-ai-review-title-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(180deg, #ffffff 0%, #e6f1ff 100%);
    box-shadow: inset 0 0 0 1px rgba(21, 89, 214, 0.12), 0 8px 18px rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-panel-close-button,
.richtexteditor .rte-ai-chat-header-button,
.richtexteditor .rte-ai-chat-scope-button,
.richtexteditor .rte-ai-chat-quick-button,
.richtexteditor .rte-ai-chat-action-button,
.richtexteditor .rte-ai-chat-send-button,
.richtexteditor .rte-ai-review-header-button,
.richtexteditor .rte-ai-review-control-button,
.richtexteditor .rte-ai-review-action-button,
.richtexteditor .rte-ai-review-type-chip,
.richtexteditor .rte-ai-review-filter-select,
.richtexteditor .rte-ai-review-activity-button {
    transition:
        background-color 160ms ease,
        color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.richtexteditor .rte-ai-chat-header-button,
.richtexteditor .rte-ai-chat-scope-button,
.richtexteditor .rte-ai-chat-quick-button,
.richtexteditor .rte-ai-chat-action-button,
.richtexteditor .rte-ai-review-header-button,
.richtexteditor .rte-ai-review-control-button,
.richtexteditor .rte-ai-review-action-button,
.richtexteditor .rte-ai-review-type-chip,
.richtexteditor .rte-ai-review-filter-select,
.richtexteditor .rte-ai-review-activity-button {
    border: 1px solid rgba(20, 36, 58, 0.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.richtexteditor .rte-ai-chat-header-button:hover:not([disabled]),
.richtexteditor .rte-ai-chat-scope-button:hover:not([disabled]),
.richtexteditor .rte-ai-chat-quick-button:hover:not([disabled]),
.richtexteditor .rte-ai-chat-action-button:hover:not([disabled]),
.richtexteditor .rte-ai-review-header-button:hover:not([disabled]),
.richtexteditor .rte-ai-review-control-button:hover:not([disabled]),
.richtexteditor .rte-ai-review-action-button:hover:not([disabled]),
.richtexteditor .rte-ai-review-type-chip:hover:not([disabled]),
.richtexteditor .rte-ai-review-activity-button:hover:not([disabled]) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.richtexteditor .rte-ai-chat-send-button,
.richtexteditor .rte-ai-review-control-button.is-primary,
.richtexteditor .rte-ai-review-action-button.is-primary,
.richtexteditor .rte-ai-review-type-chip.is-active {
    border-color: rgba(17, 72, 179, 0.18);
}

.richtexteditor .rte-ai-review-summary,
.richtexteditor .rte-ai-review-controls,
.richtexteditor .rte-ai-chat-context-bar,
.richtexteditor .rte-ai-chat-composer {
    padding: 12px;
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.76);
    border: 1px solid rgba(20, 36, 58, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.richtexteditor .rte-ai-review-summary-pill {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.richtexteditor .rte-ai-review-summary-detail,
.richtexteditor .rte-ai-review-summary-history {
    margin-top: 0;
}

.richtexteditor .rte-ai-chat-composer {
    gap: 10px;
}

.richtexteditor .rte-ai-chat-quick-row {
    padding: 2px 2px 4px;
}

.richtexteditor .rte-ai-chat-context-preview,
.richtexteditor .rte-ai-review-summary-detail,
.richtexteditor .rte-ai-review-summary-history,
.richtexteditor .rte-ai-review-activity-card,
.richtexteditor .rte-ai-chat-message,
.richtexteditor .rte-ai-chat-empty,
.richtexteditor .rte-ai-review-empty,
.richtexteditor .rte-ai-review-history-entry,
.richtexteditor .rte-ai-review-item {
    box-shadow: var(--rte-ai-card-shadow);
}

.richtexteditor .rte-ai-review-feed,
.richtexteditor .rte-ai-chat-feed {
    padding-right: 6px;
    margin-right: -4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(111, 142, 177, 0.55) transparent;
}

.richtexteditor .rte-ai-review-feed::-webkit-scrollbar,
.richtexteditor .rte-ai-chat-feed::-webkit-scrollbar,
.richtexteditor .rte-ai-chat-quick-row::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.richtexteditor .rte-ai-review-feed::-webkit-scrollbar-thumb,
.richtexteditor .rte-ai-chat-feed::-webkit-scrollbar-thumb,
.richtexteditor .rte-ai-chat-quick-row::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(111, 142, 177, 0.38);
}

.richtexteditor .rte-ai-review-feed::-webkit-scrollbar-track,
.richtexteditor .rte-ai-chat-feed::-webkit-scrollbar-track,
.richtexteditor .rte-ai-chat-quick-row::-webkit-scrollbar-track {
    background: transparent;
}

.richtexteditor .rte-ai-review-shortcuts {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.richtexteditor .rte-ai-review-shortcuts.is-action-focused,
.richtexteditor .rte-ai-review-shortcuts.is-card-focused,
.richtexteditor .rte-ai-review-shortcuts.is-panel-focused,
.richtexteditor .rte-ai-review-shortcuts.is-control-focused {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.richtexteditor .rte-ai-review-empty {
    padding: 16px;
    border-radius: 20px;
    border-style: solid;
    border-color: rgba(20, 36, 58, 0.08);
    background:
        radial-gradient(circle at top right, rgba(217, 119, 6, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(255, 252, 246, 0.96) 0%, rgba(247, 250, 255, 0.98) 62%, rgba(243, 247, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-review-empty-title {
    font-size: 15px;
    letter-spacing: -0.01em;
}

.richtexteditor .rte-ai-review-empty-detail,
.richtexteditor .rte-ai-review-empty-undo-history-detail,
.richtexteditor .rte-ai-review-empty-preview-reason {
    color: #51697f;
}

.richtexteditor .rte-ai-review-empty-hint {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(21, 89, 214, 0.08);
    border: 1px solid rgba(21, 89, 214, 0.12);
    color: #214d7c;
}

.richtexteditor .rte-ai-review-empty-preview {
    position: relative;
    overflow: hidden;
    padding: 12px 13px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 247, 255, 0.94) 100%);
    border-color: rgba(20, 36, 58, 0.08);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.richtexteditor .rte-ai-review-empty-preview::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, rgba(21, 89, 214, 0.22), rgba(15, 118, 110, 0.16));
    opacity: 0;
    transition: opacity 160ms ease;
}

.richtexteditor .rte-ai-review-empty-preview.is-actionable:hover,
.richtexteditor .rte-ai-review-empty-preview.is-primary-target {
    box-shadow: 0 14px 28px rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-review-empty-preview.is-actionable:hover::before,
.richtexteditor .rte-ai-review-empty-preview.is-primary-target::before {
    opacity: 1;
}

.richtexteditor .rte-ai-review-empty-preview.is-primary-target {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(227, 239, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-review-empty-actions {
    margin-top: 12px;
    gap: 10px;
}

.richtexteditor .rte-ai-review-empty-actions .rte-ai-review-control-button {
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
}

.richtexteditor .rte-ai-review-empty-action-label {
    line-height: 1.35;
}

.richtexteditor .rte-ai-review-empty-action-pill,
.richtexteditor .rte-ai-review-empty-preview-pill {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.richtexteditor .rte-ai-review-history-entry,
.richtexteditor .rte-ai-review-empty-undo-history,
.richtexteditor .rte-ai-review-summary-history,
.richtexteditor .rte-ai-review-item-history,
.richtexteditor .rte-ai-review-item-undo-note,
.richtexteditor .rte-ai-review-item-redo-note {
    border-radius: 16px;
}

.richtexteditor .rte-ai-review-item {
    position: relative;
    overflow: hidden;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    border-color: rgba(20, 36, 58, 0.08);
    background: var(--rte-ai-card-bg);
    box-shadow: var(--rte-ai-card-shadow);
}

.richtexteditor .rte-ai-review-item::before {
    content: "";
    position: absolute;
    inset: 10px auto 10px 0;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(180deg, rgba(21, 89, 214, 0.88), rgba(15, 118, 110, 0.56));
    opacity: 0;
    transition: opacity 160ms ease, transform 160ms ease;
}

.richtexteditor .rte-ai-review-item:hover {
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.richtexteditor .rte-ai-review-item.is-active,
.richtexteditor .rte-ai-review-item.is-opened {
    transform: translateY(-2px);
}

.richtexteditor .rte-ai-review-item.is-active::before,
.richtexteditor .rte-ai-review-item.is-opened::before {
    opacity: 1;
}

.richtexteditor .rte-ai-review-item.is-opened::before {
    background: linear-gradient(180deg, rgba(34, 142, 86, 0.9), rgba(15, 118, 110, 0.6));
}

.richtexteditor .rte-ai-review-item-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.richtexteditor .rte-ai-review-item-before,
.richtexteditor .rte-ai-review-item-after {
    border: 1px solid rgba(20, 36, 58, 0.06);
    border-radius: 14px;
    padding: 10px 12px;
}

.richtexteditor .rte-ai-review-item-before {
    background: linear-gradient(180deg, rgba(255, 244, 244, 0.96) 0%, rgba(255, 239, 239, 0.94) 100%);
}

.richtexteditor .rte-ai-review-item-after {
    background: linear-gradient(180deg, rgba(241, 253, 247, 0.96) 0%, rgba(234, 251, 241, 0.94) 100%);
}

.richtexteditor .rte-ai-review-item-actions {
    margin-top: 2px;
    gap: 8px;
}

.richtexteditor .rte-ai-review-item-actions .rte-ai-review-action-button {
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 12px;
}

.richtexteditor .rte-ai-chat-context-preview,
.richtexteditor .rte-ai-chat-empty,
.richtexteditor .rte-ai-chat-message {
    border-radius: 18px;
    border-color: rgba(20, 36, 58, 0.08);
    background: var(--rte-ai-card-bg);
}

.richtexteditor .rte-ai-chat-message.is-user {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(228, 239, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-chat-message.is-assistant {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-chat-message.is-error {
    background: linear-gradient(180deg, rgba(255, 245, 245, 0.98) 0%, rgba(255, 239, 239, 0.98) 100%);
}

.richtexteditor .rte-ai-chat-input {
    min-height: 96px;
    border-radius: 16px;
    border-color: rgba(20, 36, 58, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.richtexteditor .rte-ai-chat-input:focus {
    outline: none;
    border-color: rgba(21, 89, 214, 0.32);
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.rte-ai-inline-preview {
    gap: 10px;
    margin: 0 3px;
    padding: 6px 8px;
    border-radius: 16px;
    border-color: rgba(20, 36, 58, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 255, 0.98));
    box-shadow: 0 14px 32px rgba(18, 33, 56, 0.1);
}

.rte-ai-inline-preview-actions {
    gap: 7px;
}

.rte-ai-inline-preview-button {
    border: 1px solid rgba(20, 36, 58, 0.08);
    border-radius: 11px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
    transition:
        background-color 160ms ease,
        color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.rte-ai-inline-preview-button:hover:not([disabled]),
.rte-ai-inline-preview-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(18, 33, 56, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.rte-ai-inline-preview-button.is-review {
    background: linear-gradient(180deg, #edf5ff 0%, #dbeaff 100%);
}

.rte-ai-inline-preview-button.is-next {
    background: linear-gradient(180deg, #f1f9ef 0%, #e2f2de 100%);
}

.rte-ai-inline-preview-button.is-previous {
    background: linear-gradient(180deg, #faf3ff 0%, #f0e5fb 100%);
}

.rte-ai-inline-preview-button.is-reject {
    background: linear-gradient(180deg, #f7f9fc 0%, #ebf1f7 100%);
}

.rte-ai-inline-preview-button.is-undo {
    background: linear-gradient(180deg, #fff5ea 0%, #ffebd2 100%);
}

.rte-ai-inline-preview-button.is-redo {
    background: linear-gradient(180deg, #ecfbf8 0%, #daf5ef 100%);
}

.rte-ai-inline-preview-current,
.rte-ai-inline-preview-opened,
.rte-ai-inline-preview-type,
.rte-ai-inline-preview-language,
.rte-ai-inline-preview-scope,
.rte-ai-inline-preview-remote,
.rte-ai-inline-preview-queue,
.rte-ai-inline-preview-transition,
.rte-ai-inline-preview-followup,
.rte-ai-inline-preview-redo,
.rte-ai-inline-preview-undo,
.rte-ai-inline-preview-undo-next,
.rte-ai-inline-preview-redo-next,
.rte-ai-inline-preview-shortcuts,
.rte-ai-inline-preview-reason,
.rte-ai-inline-preview-launch,
.rte-ai-inline-preview-focus {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-opened,
.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-remote {
    display: none;
}

.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-type,
.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-language,
.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-scope,
.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-glance,
.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-queue,
.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-transition,
.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-followup {
    display: none;
}

.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-current {
    display: none;
}

.rte-ai-inline-preview:not(.is-review-preview) .rte-ai-inline-preview-focus {
    display: none;
}

@media (max-width: 900px) {
    .richtexteditor .rte-ai-chat-panel,
    .richtexteditor .rte-ai-review-panel {
        top: 44px;
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        padding: 14px;
        border-radius: 18px;
    }

    .richtexteditor .rte-ai-review-summary {
        grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    }

    .richtexteditor .rte-ai-chat-panel::before,
    .richtexteditor .rte-ai-review-panel::before {
        height: 64px;
    }

    .richtexteditor .rte-ai-review-summary,
    .richtexteditor .rte-ai-review-controls,
    .richtexteditor .rte-ai-chat-context-bar,
    .richtexteditor .rte-ai-chat-composer,
    .richtexteditor .rte-ai-review-empty,
    .richtexteditor .rte-ai-review-item,
    .richtexteditor .rte-ai-chat-message {
        border-radius: 16px;
    }
}

/* 2026-04-24 premium editor refinement */
.richtexteditor .rte-ai-chat-panel,
.richtexteditor .rte-ai-review-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.richtexteditor .rte-ai-chat-stack,
.richtexteditor .rte-ai-review-stack {
    display: grid;
    gap: 10px;
}

.richtexteditor .rte-ai-chat-context-shell,
.richtexteditor .rte-ai-chat-quick-shell,
.richtexteditor .rte-ai-chat-compose-shell,
.richtexteditor .rte-ai-review-overview,
.richtexteditor .rte-ai-review-navigation {
    /* 2026-05-08: flattened the strong card chrome (border + gradient + shadow)
       so the panel reads as one surface instead of stacked dialogs. The header
       at the top and the feed in the middle still carry chrome, so the panel
       hierarchy stays legible without each subsection looking like its own
       floating dialog. */
    padding: 8px 4px 4px;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.richtexteditor .rte-ai-chat-feed-shell,
.richtexteditor .rte-ai-review-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 13px;
    border-radius: 22px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 14px 28px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.richtexteditor .rte-ai-chat-context-shell {
    /* tint kept for the review panel only (.rte-ai-review-overview rule above) */
    background: transparent;
}

.richtexteditor .rte-ai-chat-compose-shell {
    background: transparent;
}

.richtexteditor .rte-ai-review-navigation {
    background: linear-gradient(180deg, rgba(252, 253, 255, 0.98) 0%, rgba(246, 249, 253, 0.96) 100%);
}

.richtexteditor .rte-ai-chat-header,
.richtexteditor .rte-ai-review-header {
    padding-bottom: 13px;
}

.richtexteditor .rte-ai-chat-header-actions,
.richtexteditor .rte-ai-review-header-actions {
    gap: 8px;
}

.richtexteditor .rte-ai-panel-close-button,
.richtexteditor .rte-ai-chat-header-button,
.richtexteditor .rte-ai-chat-scope-button,
.richtexteditor .rte-ai-chat-quick-button,
.richtexteditor .rte-ai-chat-action-button,
.richtexteditor .rte-ai-chat-send-button,
.richtexteditor .rte-ai-review-header-button,
.richtexteditor .rte-ai-review-control-button,
.richtexteditor .rte-ai-review-action-button,
.richtexteditor .rte-ai-review-type-chip,
.richtexteditor .rte-ai-review-filter-select,
.richtexteditor .rte-ai-review-activity-button {
    min-height: 36px;
    border-radius: 13px;
    font-weight: 700;
}

.richtexteditor .rte-ai-chat-header-button,
.richtexteditor .rte-ai-chat-scope-button,
.richtexteditor .rte-ai-chat-quick-button,
.richtexteditor .rte-ai-chat-action-button,
.richtexteditor .rte-ai-review-header-button,
.richtexteditor .rte-ai-review-control-button,
.richtexteditor .rte-ai-review-action-button,
.richtexteditor .rte-ai-review-filter-select,
.richtexteditor .rte-ai-review-activity-button {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 247, 252, 0.96) 100%);
}

.richtexteditor .rte-ai-chat-send-button,
.richtexteditor .rte-ai-review-control-button.is-primary,
.richtexteditor .rte-ai-review-action-button.is-primary {
    background: linear-gradient(180deg, #1e67dd 0%, #1559d6 100%);
}

.richtexteditor .rte-ai-chat-context-bar {
    padding: 4px;
    border-radius: 16px;
    background: rgba(225, 234, 245, 0.48);
    border: 1px solid rgba(20, 36, 58, 0.06);
}

.richtexteditor .rte-ai-chat-scope-button {
    min-height: 34px;
    border-radius: 12px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.92);
}

.richtexteditor .rte-ai-chat-scope-button.is-active {
    background: linear-gradient(180deg, rgba(234, 243, 255, 0.98) 0%, rgba(224, 238, 255, 0.98) 100%);
    box-shadow: inset 0 0 0 1px rgba(21, 89, 214, 0.14), 0 8px 16px rgba(21, 89, 214, 0.08);
}

.richtexteditor .rte-ai-chat-context-pill {
    margin-left: auto;
    padding: 6px 10px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.84);
}

.richtexteditor .rte-ai-chat-context-preview {
    padding: 12px 14px;
    border-radius: 16px;
    max-height: 92px;
    border-color: rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.96) 100%);
}

.richtexteditor .rte-ai-chat-quick-row {
    margin: 0 -1px;
    padding: 2px 1px 4px;
}

.richtexteditor .rte-ai-chat-quick-row > .rte-ai-chat-quick-button {
    border-radius: 999px;
    padding-inline: 13px;
}

.richtexteditor .rte-ai-chat-feed,
.richtexteditor .rte-ai-review-feed {
    flex: 1 1 auto;
    min-height: 0;
    padding: 2px 4px 6px 0;
}

.richtexteditor .rte-ai-chat-empty,
.richtexteditor .rte-ai-review-empty {
    padding: 14px 15px;
    border-radius: 18px;
}

.richtexteditor .rte-ai-chat-message {
    padding: 14px 14px 12px;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-message-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-message-meta::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #5d7388;
    box-shadow: 0 0 0 4px rgba(93, 115, 136, 0.12);
}

.richtexteditor .rte-ai-chat-message.is-user .rte-ai-chat-message-meta::before {
    background: #1559d6;
    box-shadow: 0 0 0 4px rgba(21, 89, 214, 0.14);
}

.richtexteditor .rte-ai-chat-message.is-assistant .rte-ai-chat-message-meta::before {
    background: #0f766e;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.richtexteditor .rte-ai-chat-message.is-error .rte-ai-chat-message-meta::before {
    background: #c24141;
    box-shadow: 0 0 0 4px rgba(194, 65, 65, 0.12);
}

.richtexteditor .rte-ai-chat-message-text {
    color: #23384d;
}

.richtexteditor .rte-ai-chat-message-actions {
    margin-top: 2px;
}

.richtexteditor .rte-ai-chat-compose-shell .rte-ai-chat-composer {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.richtexteditor .rte-ai-chat-compose-shell .rte-ai-chat-input {
    min-height: 108px;
    padding: 13px 14px;
}

.richtexteditor .rte-ai-chat-status {
    min-height: 16px;
    padding-inline: 2px;
}

.richtexteditor .rte-ai-review-summary {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 10px;
}

.richtexteditor .rte-ai-review-summary-pill {
    gap: 8px;
    justify-content: flex-start;
}

.richtexteditor .rte-ai-review-summary-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-review-summary-pill.is-pending::before {
    background: #1559d6;
    box-shadow: 0 0 0 4px rgba(21, 89, 214, 0.14);
}

.richtexteditor .rte-ai-review-summary-pill.is-accepted::before {
    background: #15803d;
    box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.12);
}

.richtexteditor .rte-ai-review-summary-pill.is-rejected::before {
    background: #64748b;
    box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.12);
}

.richtexteditor .rte-ai-review-summary-pill.is-stale::before {
    background: #b45309;
    box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.12);
}

.richtexteditor .rte-ai-review-summary-pill.is-current::before {
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.richtexteditor .rte-ai-review-summary-pill.is-filtered::before {
    background: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.richtexteditor .rte-ai-review-summary-pill.is-remote::before {
    background: #0f766e;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.richtexteditor .rte-ai-review-navigation .rte-ai-review-controls {
    gap: 9px;
}

.richtexteditor .rte-ai-review-navigation .rte-ai-review-filter-select,
.richtexteditor .rte-ai-review-navigation .rte-ai-review-control-button {
    min-height: 38px;
}

.richtexteditor .rte-ai-review-type-chips {
    gap: 9px;
}

.richtexteditor .rte-ai-review-shortcuts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.richtexteditor .rte-ai-review-shortcuts-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7f94;
}

.richtexteditor .rte-ai-review-shortcuts-separator {
    font-size: 10px;
    font-weight: 700;
    color: #91a1b2;
}

.richtexteditor .rte-ai-review-shortcuts-segment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(252, 253, 255, 0.98) 0%, rgba(244, 248, 252, 0.96) 100%);
    color: #486075;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-shortcuts-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(20, 36, 58, 0.08);
    color: #1b3550;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-shortcuts-copy {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.richtexteditor .rte-ai-review-shortcuts.is-action-focused .rte-ai-review-shortcuts-segment,
.richtexteditor .rte-ai-review-shortcuts.is-panel-focused .rte-ai-review-shortcuts-segment,
.richtexteditor .rte-ai-review-shortcuts.is-control-focused .rte-ai-review-shortcuts-segment,
.richtexteditor .rte-ai-review-shortcuts.is-card-focused .rte-ai-review-shortcuts-segment {
    background: rgba(255, 255, 255, 0.94);
}

.richtexteditor .rte-ai-review-shortcuts.is-action-focused .rte-ai-review-shortcuts-key {
    background: rgba(21, 89, 214, 0.14);
    color: #1753b8;
}

.richtexteditor .rte-ai-review-shortcuts.is-control-focused .rte-ai-review-shortcuts-key {
    background: rgba(59, 130, 246, 0.14);
    color: #245588;
}

.richtexteditor .rte-ai-review-shortcuts.is-card-focused .rte-ai-review-shortcuts-key {
    background: rgba(100, 116, 139, 0.14);
    color: #44586d;
}

.richtexteditor .rte-ai-review-item {
    padding: 15px 15px 14px;
    gap: 11px;
}

.richtexteditor .rte-ai-review-item.is-condensed {
    padding: 12px 13px;
    gap: 9px;
}

.richtexteditor .rte-ai-review-item-meta {
    gap: 6px;
    row-gap: 6px;
}

.richtexteditor .rte-ai-review-item-state {
    display: grid;
    gap: 5px;
    padding: 12px 13px;
    border-radius: 18px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(243, 247, 252, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-item-state.is-pending.is-current {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(230, 240, 255, 0.96) 100%);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-review-item-state.is-pending.is-opened {
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.98) 0%, rgba(228, 249, 236, 0.96) 100%);
    border-color: rgba(22, 101, 52, 0.1);
}

.richtexteditor .rte-ai-review-item-state.is-accepted {
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.98) 0%, rgba(232, 249, 238, 0.96) 100%);
    border-color: rgba(22, 101, 52, 0.08);
}

.richtexteditor .rte-ai-review-item-state.is-rejected {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(239, 244, 248, 0.96) 100%);
    border-color: rgba(100, 116, 139, 0.1);
}

.richtexteditor .rte-ai-review-item-state.is-stale {
    background: linear-gradient(180deg, rgba(255, 248, 235, 0.98) 0%, rgba(255, 241, 220, 0.96) 100%);
    border-color: rgba(217, 119, 6, 0.1);
}

.richtexteditor .rte-ai-review-item-state-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #60748c;
}

.richtexteditor .rte-ai-review-item-state-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-review-item-state-detail {
    font-size: 12px;
    line-height: 1.55;
    color: #5c6f85;
}

.richtexteditor .rte-ai-review-item-title {
    font-size: 15px;
    line-height: 1.35;
    color: #13273d;
}

.richtexteditor .rte-ai-review-feed-section {
    display: grid;
    gap: 6px;
    padding: 4px 2px 2px;
}

.richtexteditor .rte-ai-review-feed-section-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.richtexteditor .rte-ai-review-feed-section-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #61758d;
}

.richtexteditor .rte-ai-review-feed-section-detail {
    font-size: 11.5px;
    line-height: 1.55;
    color: #6a7d93;
}

.richtexteditor .rte-ai-review-feed-section-pill {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: #5f738a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-feed-section.is-current .rte-ai-review-feed-section-title,
.richtexteditor .rte-ai-review-feed-section.is-current .rte-ai-review-feed-section-pill {
    color: #1753b8;
}

.richtexteditor .rte-ai-review-feed-section.is-next .rte-ai-review-feed-section-title,
.richtexteditor .rte-ai-review-feed-section.is-next .rte-ai-review-feed-section-pill {
    color: #0f766e;
}

.richtexteditor .rte-ai-review-feed-section.is-later .rte-ai-review-feed-section-title,
.richtexteditor .rte-ai-review-feed-section.is-later .rte-ai-review-feed-section-pill {
    color: #9a5d10;
}

.richtexteditor .rte-ai-review-feed-section.is-earlier .rte-ai-review-feed-section-title,
.richtexteditor .rte-ai-review-feed-section.is-earlier .rte-ai-review-feed-section-pill {
    color: #6d28d9;
}

.richtexteditor .rte-ai-review-item-summary {
    display: grid;
    gap: 10px;
}

.richtexteditor .rte-ai-review-item-glance-card {
    display: grid;
    gap: 7px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(250, 251, 255, 0.98) 0%, rgba(244, 247, 252, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.richtexteditor .rte-ai-review-item-glance-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #173654;
}

.richtexteditor .rte-ai-review-item-glance-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-review-item-glance-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #566d86;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-item-glance-pill.is-change {
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.12);
    background: rgba(245, 243, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-glance-pill.is-impact {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.12);
    background: rgba(240, 253, 250, 0.96);
}

.richtexteditor .rte-ai-review-item-glance-pill.is-scope {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-glance-detail {
    font-size: 11.5px;
    line-height: 1.6;
    color: #5c7188;
}

.richtexteditor .rte-ai-review-item-condensed-preview {
    display: grid;
    gap: 6px;
    padding: 9px 10px;
    border-radius: 14px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: rgba(250, 252, 255, 0.92);
}

.richtexteditor .rte-ai-review-item-condensed-preview-header {
    display: grid;
    gap: 3px;
}

.richtexteditor .rte-ai-review-item-condensed-preview-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #61758c;
}

.richtexteditor .rte-ai-review-item-condensed-preview-detail {
    font-size: 11px;
    line-height: 1.5;
    color: #61758b;
}

.richtexteditor .rte-ai-review-item-condensed-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.richtexteditor .rte-ai-review-item-condensed-preview-pill {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: #5f738a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-item-condensed-preview-pill.is-status {
    color: #1559d6;
    border-color: rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-condensed-preview-pill.is-remote {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.12);
    background: rgba(240, 253, 250, 0.96);
}

.richtexteditor .rte-ai-review-item-condensed-preview-pill.is-type {
    color: #7c3aed;
    border-color: rgba(124, 58, 237, 0.14);
    background: rgba(245, 243, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-condensed-preview-pill.is-language,
.richtexteditor .rte-ai-review-item-condensed-preview-pill.is-scope {
    color: #9a5d10;
    border-color: rgba(217, 119, 6, 0.12);
    background: rgba(255, 247, 237, 0.96);
}

.richtexteditor .rte-ai-review-item-condensed-preview-pill.is-steps {
    color: #516579;
}

.richtexteditor .rte-ai-review-item-condensed-queue,
.richtexteditor .rte-ai-review-item-condensed-entry,
.richtexteditor .rte-ai-review-item-condensed-transition {
    display: grid;
    gap: 5px;
    padding: 8px 9px;
    border-radius: 12px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: rgba(255, 255, 255, 0.94);
}

.richtexteditor .rte-ai-review-item-condensed-queue.is-next {
    border-color: rgba(15, 118, 110, 0.12);
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.98) 0%, rgba(232, 247, 242, 0.96) 100%);
}

.richtexteditor .rte-ai-review-item-condensed-entry {
    border-color: rgba(21, 89, 214, 0.12);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(233, 242, 255, 0.96) 100%);
}

.richtexteditor .rte-ai-review-item-condensed-queue-title,
.richtexteditor .rte-ai-review-item-condensed-entry-title,
.richtexteditor .rte-ai-review-item-condensed-transition-title,
.richtexteditor .rte-ai-review-item-condensed-transition-followup-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #61758c;
}

.richtexteditor .rte-ai-review-item-condensed-queue-meta,
.richtexteditor .rte-ai-review-item-condensed-transition-meta,
.richtexteditor .rte-ai-review-item-condensed-transition-followup-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.richtexteditor .rte-ai-review-item-condensed-queue-detail,
.richtexteditor .rte-ai-review-item-condensed-transition-detail,
.richtexteditor .rte-ai-review-item-condensed-transition-preview,
.richtexteditor .rte-ai-review-item-condensed-transition-followup-detail {
    font-size: 11px;
    line-height: 1.5;
    color: #61758b;
}

.richtexteditor .rte-ai-review-item-condensed-transition-followup {
    display: grid;
    gap: 5px;
    padding-top: 2px;
    border-top: 1px solid rgba(20, 36, 58, 0.08);
}

.richtexteditor .rte-ai-review-item-condensed-open {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.richtexteditor .rte-ai-review-item-condensed-open-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #667b92;
}

.richtexteditor .rte-ai-review-item-condensed-open-pill {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
    color: #1753b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-item-condensed-entry-detail {
    font-size: 11px;
    line-height: 1.5;
    color: #5d6f86;
}

.richtexteditor .rte-ai-review-item-condensed-shortcuts {
    display: grid;
    gap: 5px;
}

.richtexteditor .rte-ai-review-item-condensed-shortcuts-title {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1753b8;
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-condensed-shortcuts .rte-ai-review-shortcuts {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.richtexteditor .rte-ai-review-item-condensed-glance {
    display: grid;
    gap: 5px;
}

.richtexteditor .rte-ai-review-item-condensed-glance-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #61758c;
}

.richtexteditor .rte-ai-review-item-condensed-glance-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.richtexteditor .rte-ai-review-item-condensed-glance .rte-ai-review-item-glance-pill {
    min-height: 20px;
    padding: 0 8px;
    font-size: 9.5px;
}

.richtexteditor .rte-ai-review-item-condensed-glance-detail {
    font-size: 11px;
    line-height: 1.5;
    color: #6a7d93;
}

.richtexteditor .rte-ai-review-item-condensed-preview-line {
    display: grid;
    gap: 4px;
}

.richtexteditor .rte-ai-review-item-condensed-preview-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6a7e95;
    background: rgba(255, 255, 255, 0.94);
}

.richtexteditor .rte-ai-review-item-condensed-preview-line.is-current .rte-ai-review-item-condensed-preview-label {
    color: #9f2b1c;
    background: rgba(255, 245, 243, 0.96);
}

.richtexteditor .rte-ai-review-item-condensed-preview-line.is-result .rte-ai-review-item-condensed-preview-label {
    color: #124b87;
    background: rgba(241, 247, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-condensed-preview .rte-ai-review-item-compare-text {
    font-size: 11.5px;
    line-height: 1.55;
}

.richtexteditor .rte-ai-review-item-condensed-reason {
    display: grid;
    gap: 5px;
    padding-top: 2px;
    border-top: 1px solid rgba(20, 36, 58, 0.08);
}

.richtexteditor .rte-ai-review-item-condensed-reason-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7c5816;
    background: rgba(255, 248, 233, 0.96);
}

.richtexteditor .rte-ai-review-item-condensed-reason-copy {
    font-size: 11.5px;
    line-height: 1.55;
    color: #5f7083;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-state,
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-glance-card {
    padding: 9px 11px;
    border-radius: 15px;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-queue-card,
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-transition-card {
    display: none;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-state {
    display: none;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-glance-card {
    display: none;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-meta {
    display: none;
}

/* 2026-05-08: condensed (non-active) review items used to hide their title
   too, leaving only the status pill + "SELECTION SUGGESTION" stamp visible
   — rows looked empty. Now we keep the truncated title + the meta line so
   each row communicates what the suggestion is about at a glance. The
   compare card, reason, recovery notes, and actions still stay collapsed
   until the user clicks the row to expand it. */
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #1f2937 !important;
    opacity: 1 !important;
    margin: 4px 0 0 !important;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-state-detail,
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-glance-detail,
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-reason-card,
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-compare,
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-undo-note,
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-redo-note,
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-history,
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-actions {
    display: none;
}

/* 2026-05-08: full condensed-row styling. The user reported the rows looked
   "all the same" with no status indicator. We add:
     - 3 px coloured left border per status (blue=pending, green=accepted,
       grey=rejected, amber=stale) — instant scannability without taking
       horizontal space.
     - Compact, uppercase status pill + scope stamp meta row.
     - Subtle border + hover affordance so the row reads as clickable. */
.richtexteditor .rte-ai-review-item.is-condensed {
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
    padding: 10px 12px 10px 14px !important;
    gap: 4px !important;
    margin: 0 0 6px !important;
    border: 1px solid rgba(20, 36, 58, 0.06);
    border-left: 3px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
}

.richtexteditor .rte-ai-review-item.is-condensed.is-pending {
    border-left-color: #1559d6;
}

.richtexteditor .rte-ai-review-item.is-condensed.is-accepted {
    border-left-color: #16a34a;
}

.richtexteditor .rte-ai-review-item.is-condensed.is-rejected {
    border-left-color: #94a3b8;
}

.richtexteditor .rte-ai-review-item.is-condensed.is-stale {
    border-left-color: #d97706;
}

.richtexteditor .rte-ai-review-item.is-condensed:hover {
    background: #f7faff !important;
    border-color: rgba(21, 89, 214, 0.22) !important;
}

/* Compact meta row inside condensed items: small uppercase pills, no
   gradient backgrounds, just status colour + secondary scope stamp. */
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-meta {
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 10px;
    line-height: 1;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 7px 2px 5px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    border: 0;
}

/* 2026-05-08: small status glyph before each pill — ✓ for accepted,
   × for rejected, • for pending, ⟳ for stale. Uses ::before so we don't
   need to touch the renderer; the parent's `display: inline-flex` aligns
   the glyph on the pill baseline. */
.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status::before {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status.is-accepted::before {
    content: "\2713"; /* ✓ */
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status.is-rejected::before {
    content: "\00D7"; /* × */
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status.is-pending::before {
    content: "\2022"; /* • */
    font-size: 13px;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status.is-stale::before {
    content: "\27F3"; /* ⟳ */
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status.is-accepted {
    background: #dcfce7;
    color: #166534;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status.is-rejected {
    background: #f1f5f9;
    color: #64748b;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status.is-pending {
    background: #dbeafe;
    color: #1559d6;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status.is-stale {
    background: #fef3c7;
    color: #92400e;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-stamp {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
    background: transparent;
    border: 0;
    padding: 0;
}

.richtexteditor .rte-ai-review-item-queue-card {
    display: grid;
    gap: 8px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(249, 251, 254, 0.98) 0%, rgba(243, 247, 252, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.richtexteditor .rte-ai-review-item-queue-card.is-current {
    border-color: rgba(21, 89, 214, 0.12);
    background: linear-gradient(180deg, rgba(241, 247, 255, 0.99) 0%, rgba(232, 241, 255, 0.97) 100%);
}

.richtexteditor .rte-ai-review-item-queue-card.is-next {
    border-color: rgba(15, 118, 110, 0.12);
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.99) 0%, rgba(231, 247, 242, 0.97) 100%);
}

.richtexteditor .rte-ai-review-item-queue-card.is-earlier {
    border-color: rgba(124, 58, 237, 0.12);
    background: linear-gradient(180deg, rgba(247, 244, 255, 0.99) 0%, rgba(240, 235, 255, 0.97) 100%);
}

.richtexteditor .rte-ai-review-item-queue-card.is-later {
    border-color: rgba(217, 119, 6, 0.12);
    background: linear-gradient(180deg, rgba(255, 249, 240, 0.99) 0%, rgba(255, 243, 227, 0.97) 100%);
}

.richtexteditor .rte-ai-review-item-queue-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-review-item-queue-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-review-item-queue-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #5b7088;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-item-queue-pill.is-role {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-queue-card.is-next .rte-ai-review-item-queue-pill.is-role {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.12);
    background: rgba(240, 253, 250, 0.96);
}

.richtexteditor .rte-ai-review-item-queue-card.is-earlier .rte-ai-review-item-queue-pill.is-role {
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.12);
    background: rgba(245, 243, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-queue-card.is-later .rte-ai-review-item-queue-pill.is-role {
    color: #9a5d10;
    border-color: rgba(217, 119, 6, 0.12);
    background: rgba(255, 247, 237, 0.96);
}

.richtexteditor .rte-ai-review-item-queue-detail {
    font-size: 11.5px;
    line-height: 1.6;
    color: #5e7288;
}

.richtexteditor .rte-ai-review-item-transition-card {
    display: grid;
    gap: 8px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(15, 118, 110, 0.1);
    background: linear-gradient(180deg, rgba(242, 252, 249, 0.99) 0%, rgba(233, 248, 243, 0.97) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.richtexteditor .rte-ai-review-item-transition-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #114c47;
}

.richtexteditor .rte-ai-review-item-transition-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-review-item-transition-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #5b7088;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-item-transition-pill.is-status {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.12);
    background: rgba(240, 253, 250, 0.96);
}

.richtexteditor .rte-ai-review-item-transition-pill.is-position,
.richtexteditor .rte-ai-review-item-transition-pill.is-scope {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-transition-pill.is-type {
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.12);
    background: rgba(245, 243, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-transition-detail,
.richtexteditor .rte-ai-review-item-transition-preview {
    font-size: 11.5px;
    line-height: 1.6;
}

.richtexteditor .rte-ai-review-item-condensed-transition-preview,
.richtexteditor .rte-ai-review-item-transition-preview {
    display: grid;
    gap: 3px;
}

.richtexteditor .rte-ai-review-item-condensed-transition-preview-label,
.richtexteditor .rte-ai-review-item-transition-preview-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #61758c;
}

.richtexteditor .rte-ai-review-item-condensed-transition-preview-text,
.richtexteditor .rte-ai-review-item-transition-preview-text {
    color: inherit;
}

.richtexteditor .rte-ai-review-item-transition-detail {
    color: #40625c;
}

.richtexteditor .rte-ai-review-item-transition-preview {
    padding: 10px 11px;
    border-radius: 14px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: rgba(255, 255, 255, 0.76);
    color: #25524d;
}

.richtexteditor .rte-ai-review-item-transition-followup {
    display: grid;
    gap: 7px;
    padding: 10px 11px;
    border-radius: 14px;
    border: 1px solid rgba(21, 89, 214, 0.08);
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(239, 246, 255, 0.96) 100%);
}

.richtexteditor .rte-ai-review-item-transition-followup-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-review-item-transition-followup-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-review-item-transition-pill.is-followup {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-review-item-transition-followup-detail {
    font-size: 11.5px;
    line-height: 1.6;
    color: #4c647b;
}

.richtexteditor .rte-ai-review-item-reason-card {
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    border-radius: 15px;
    border: 1px solid rgba(21, 89, 214, 0.08);
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(240, 246, 255, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-item-reason-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5e7390;
}

.richtexteditor .rte-ai-review-item-compare {
    display: grid;
    gap: 10px;
    padding: 13px 13px 12px;
    border-radius: 18px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(252, 253, 255, 0.98) 0%, rgba(246, 249, 253, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-item-compare-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 10px;
}

.richtexteditor .rte-ai-review-item-compare-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #173654;
}

.richtexteditor .rte-ai-review-item-compare-detail {
    font-size: 11px;
    color: #5f7288;
}

.richtexteditor .rte-ai-review-item-before,
.richtexteditor .rte-ai-review-item-after {
    position: relative;
    padding-top: 28px;
    padding-bottom: 12px;
    padding-left: 14px;
    line-height: 1.58;
    text-decoration: none;
}

.richtexteditor .rte-ai-review-item-before::before,
.richtexteditor .rte-ai-review-item-after::before {
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-item-before::before {
    content: "Original";
    color: #9a3412;
}

.richtexteditor .rte-ai-review-item-before {
    box-shadow: inset 3px 0 0 rgba(154, 52, 18, 0.18);
}

.richtexteditor .rte-ai-review-item-after::before {
    content: "Suggested";
    color: #166534;
}

.richtexteditor .rte-ai-review-item-after {
    box-shadow: inset 3px 0 0 rgba(22, 101, 52, 0.18);
}

.richtexteditor .rte-ai-review-item-compare-text {
    display: block;
    color: #23384f;
}

.richtexteditor .rte-ai-review-item-compare-segment {
    display: inline;
}

.richtexteditor .rte-ai-review-item-compare-delta {
    display: inline;
    padding: 0 3px;
    border-radius: 4px;
}

.richtexteditor .rte-ai-review-item-compare-delta.is-current {
    background: rgba(191, 53, 33, 0.12);
    color: #9f2b1c;
}

.richtexteditor .rte-ai-review-item-compare-delta.is-result {
    background: rgba(21, 89, 214, 0.14);
    color: #124b87;
}

@media (min-width: 960px) {
    .richtexteditor .rte-ai-review-item-compare {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .richtexteditor .rte-ai-review-item-compare-header {
        grid-column: 1 / -1;
    }
}

.richtexteditor .rte-ai-review-item-actions {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(20, 36, 58, 0.08);
}

.richtexteditor .rte-ai-review-item-actions .rte-ai-review-action-button {
    min-height: 36px;
    border-radius: 13px;
}

.richtexteditor .rte-ai-review-content .rte-ai-review-history-title {
    margin-top: 4px;
}

@media (max-width: 900px) {
    .richtexteditor .rte-ai-chat-context-shell,
    .richtexteditor .rte-ai-chat-quick-shell,
    .richtexteditor .rte-ai-chat-compose-shell,
    .richtexteditor .rte-ai-review-overview,
    .richtexteditor .rte-ai-review-navigation,
    .richtexteditor .rte-ai-chat-feed-shell,
    .richtexteditor .rte-ai-review-content {
        padding: 11px 12px;
        border-radius: 18px;
    }

    .richtexteditor .rte-ai-review-summary {
        grid-template-columns: repeat(auto-fit, minmax(102px, 1fr));
    }

    .richtexteditor .rte-ai-chat-context-pill {
        margin-left: 0;
    }
}

/* 2026-04-24 action identity refinement */
.richtexteditor .rte-ai-chat-message-actions,
.richtexteditor .rte-ai-review-item-actions {
    display: grid;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-message-action-summary {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(21, 89, 214, 0.08);
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(239, 246, 255, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-item-action-summary {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(21, 89, 214, 0.08);
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(239, 246, 255, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-message-action-summary-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-review-item-action-summary-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-message-action-summary-detail {
    font-size: 11px;
    line-height: 1.55;
    color: #5e7288;
}

.richtexteditor .rte-ai-review-item-action-summary-detail {
    font-size: 11px;
    line-height: 1.55;
    color: #5e7288;
}

.richtexteditor .rte-ai-review-item-action-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-review-item-action-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(20, 36, 58, 0.08);
    color: #1753b8;
}

.richtexteditor .rte-ai-review-item-shortcuts {
    display: grid;
    gap: 6px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(248, 250, 252, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-item-shortcuts-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-review-item-shortcuts .rte-ai-review-shortcuts {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.richtexteditor .rte-ai-chat-message-action-group,
.richtexteditor .rte-ai-review-item-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.richtexteditor .rte-ai-chat-message-action-group::before,
.richtexteditor .rte-ai-review-item-action-group::before {
    width: 100%;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-chat-message-action-group:empty,
.richtexteditor .rte-ai-review-item-action-group:empty {
    display: none;
}

.richtexteditor .rte-ai-chat-message-action-group {
    padding: 4px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: rgba(247, 250, 255, 0.9);
}

.richtexteditor .rte-ai-chat-message-action-group::before {
    content: none;
    display: none;
}

.richtexteditor .rte-ai-review-item-action-group::before {
    content: none;
    display: none;
}

.richtexteditor .rte-ai-chat-message-action-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 6px 4px;
}

.richtexteditor .rte-ai-chat-message-action-group-title {
    min-width: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-chat-message-action-group-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(20, 36, 58, 0.08);
    color: #1753b8;
}

.richtexteditor .rte-ai-chat-message-action-group-detail {
    width: 100%;
    padding: 0 6px 2px;
    font-size: 11px;
    line-height: 1.55;
    color: #5e7288;
}

.richtexteditor .rte-ai-review-item-action-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 6px 4px;
}

.richtexteditor .rte-ai-review-item-action-group-title {
    min-width: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-item-action-group-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(20, 36, 58, 0.08);
    color: #1753b8;
}

.richtexteditor .rte-ai-review-item-action-group-detail {
    width: 100%;
    padding: 0 6px 2px;
    font-size: 11px;
    line-height: 1.55;
    color: #5e7288;
}

.richtexteditor .rte-ai-chat-message-action-group.is-primary {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.94) 0%, rgba(231, 239, 252, 0.94) 100%);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-message-action-group.is-primary .rte-ai-chat-message-action-group-title {
    color: #1d4ed8;
}

.richtexteditor .rte-ai-chat-message-action-group.is-secondary {
    background: linear-gradient(180deg, rgba(242, 251, 245, 0.94) 0%, rgba(232, 247, 238, 0.94) 100%);
    border-color: rgba(22, 101, 52, 0.08);
}

.richtexteditor .rte-ai-chat-message-action-group.is-secondary .rte-ai-chat-message-action-group-title {
    color: #166534;
}

.richtexteditor .rte-ai-chat-message-action-group.is-utility {
    background: rgba(248, 250, 252, 0.96);
}

.richtexteditor .rte-ai-chat-message-action-group.is-utility .rte-ai-chat-message-action-group-title {
    color: #64748b;
}

.richtexteditor .rte-ai-chat-message-action-group[data-rte-ai-chat-group-recommended="true"] {
    border-color: rgba(21, 89, 214, 0.18);
    box-shadow: 0 14px 28px rgba(21, 89, 214, 0.08), inset 0 0 0 1px rgba(21, 89, 214, 0.06);
}

.richtexteditor .rte-ai-chat-message-action-group[data-rte-ai-chat-group-recommended="true"] .rte-ai-chat-message-action-group-title {
    color: #1753b8;
}

.richtexteditor .rte-ai-review-item-action-group {
    padding: 4px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: rgba(248, 250, 252, 0.94);
}

.richtexteditor .rte-ai-review-item-action-group.is-current-lane {
    border-color: rgba(21, 89, 214, 0.18);
    box-shadow: 0 14px 28px rgba(21, 89, 214, 0.08), inset 0 0 0 1px rgba(21, 89, 214, 0.06);
}

.richtexteditor .rte-ai-review-item-action-group.is-locate {
    justify-content: flex-start;
    background: linear-gradient(180deg, rgba(240, 249, 252, 0.96) 0%, rgba(231, 243, 248, 0.96) 100%);
    border-color: rgba(24, 83, 111, 0.08);
}

.richtexteditor .rte-ai-review-item-action-group.is-locate .rte-ai-review-item-action-group-title {
    color: #18536f;
}

.richtexteditor .rte-ai-review-item-action-group.is-decision {
    background: linear-gradient(180deg, rgba(244, 248, 252, 0.96) 0%, rgba(238, 243, 248, 0.96) 100%);
}

.richtexteditor .rte-ai-review-item-action-group.is-decision .rte-ai-review-item-action-group-title {
    color: #334155;
}

.richtexteditor .rte-ai-review-item-action-group.is-recovery {
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.96) 0%, rgba(247, 252, 249, 0.96) 100%);
}

.richtexteditor .rte-ai-review-item-action-group.is-recovery .rte-ai-review-item-action-group-title {
    color: #8a5a12;
}

.richtexteditor .rte-ai-chat-compose-shell .rte-ai-chat-composer-actions {
    justify-content: flex-end;
}

.richtexteditor .rte-ai-chat-compose-shell .rte-ai-chat-composer-actions button {
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-chat-action-button.is-open-dialog {
    min-width: 132px;
}

/* 2026-05-08 (v20260508u): icon-only Open-Ask-AI in the composer row.
   Drops the 132px min-width so the Send primary owns more of the row. */
.richtexteditor .rte-ai-chat-action-button.is-open-dialog.is-icon-only {
    min-width: 36px;
    width: 36px;
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
}

.richtexteditor .rte-ai-chat-action-button.is-open-dialog.is-icon-only .rte-ai-review-v2-action-icon {
    margin: 0;
}

.richtexteditor .rte-ai-chat-send-button {
    min-width: 110px;
}

.richtexteditor .rte-ai-chat-message-action-group .rte-ai-chat-action-button,
.richtexteditor .rte-ai-review-item-action-group .rte-ai-review-action-button {
    min-height: 34px;
}

.richtexteditor .rte-ai-chat-message-action-group.is-primary .rte-ai-chat-action-button,
.richtexteditor .rte-ai-chat-message-action-group.is-secondary .rte-ai-chat-action-button,
.richtexteditor .rte-ai-review-item-action-group.is-decision .rte-ai-review-action-button {
    flex: 1 1 160px;
}

.richtexteditor .rte-ai-chat-message-action-group.is-utility .rte-ai-chat-action-button,
.richtexteditor .rte-ai-review-item-action-group.is-locate .rte-ai-review-action-button,
.richtexteditor .rte-ai-review-item-action-group.is-recovery .rte-ai-review-action-button {
    flex: 0 1 auto;
}

.richtexteditor .rte-ai-chat-action-button[data-rte-ai-chat-action="copy"] {
    color: #475c72;
}

.richtexteditor .rte-ai-chat-action-button[data-rte-ai-chat-action="apply"],
.richtexteditor .rte-ai-chat-action-button[data-rte-ai-chat-action="preview"] {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.12);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(227, 239, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-chat-action-button[data-rte-ai-chat-action="selection"],
.richtexteditor .rte-ai-chat-action-button[data-rte-ai-chat-action="insert"],
.richtexteditor .rte-ai-chat-action-button[data-rte-ai-chat-action="document"] {
    color: #166534;
    border-color: rgba(22, 101, 52, 0.12);
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.98) 0%, rgba(226, 250, 234, 0.98) 100%);
}

.richtexteditor .rte-ai-chat-action-button[data-rte-ai-chat-action="open-dialog"] {
    color: #6d4c9c;
    border-color: rgba(109, 76, 156, 0.12);
    background: linear-gradient(180deg, rgba(249, 245, 255, 0.98) 0%, rgba(241, 234, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-chat-action-button[data-rte-ai-chat-recommended="true"] {
    position: relative;
    padding-right: 102px;
    box-shadow: 0 12px 24px rgba(21, 89, 214, 0.12), inset 0 0 0 1px rgba(21, 89, 214, 0.16);
}

.richtexteditor .rte-ai-chat-action-button[data-rte-ai-chat-recommended="true"]::after {
    content: "Recommended";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(20, 36, 58, 0.08);
    color: #1753b8;
}

.richtexteditor .rte-ai-review-action-button[data-rte-ai-review-enter-target="true"] {
    position: relative;
    padding-right: 72px;
    border-color: rgba(21, 89, 214, 0.16);
    box-shadow: 0 12px 24px rgba(21, 89, 214, 0.1), inset 0 0 0 1px rgba(21, 89, 214, 0.08);
}

.richtexteditor .rte-ai-review-action-button[data-rte-ai-review-enter-target="true"]::after {
    content: attr(data-rte-ai-review-enter-target-label);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(20, 36, 58, 0.08);
    color: #1753b8;
}

.richtexteditor .rte-ai-review-header-button.is-sync,
.richtexteditor .rte-ai-review-header-button.is-shared,
.richtexteditor .rte-ai-review-header-button.is-locate-current,
.richtexteditor .rte-ai-review-header-button.is-nav,
.richtexteditor .rte-ai-review-header-button.is-undo,
.richtexteditor .rte-ai-review-header-button.is-redo,
.richtexteditor .rte-ai-review-control-button.is-toggle-resolved,
.richtexteditor .rte-ai-review-control-button.is-accept-batch,
.richtexteditor .rte-ai-review-control-button.is-reject-batch,
.richtexteditor .rte-ai-review-action-button.is-locate,
.richtexteditor .rte-ai-review-action-button.is-reject,
.richtexteditor .rte-ai-review-action-button.is-undo,
.richtexteditor .rte-ai-review-action-button.is-redo,
.richtexteditor .rte-ai-review-empty-actions .rte-ai-review-control-button[data-rte-ai-empty-action-id] {
    position: relative;
}

.richtexteditor .rte-ai-review-header-button.is-sync,
.richtexteditor .rte-ai-review-header-button.is-shared,
.richtexteditor .rte-ai-review-action-button.is-locate {
    color: #18536f;
    border-color: rgba(24, 83, 111, 0.12);
    background: linear-gradient(180deg, rgba(241, 249, 252, 0.98) 0%, rgba(230, 243, 248, 0.98) 100%);
}

.richtexteditor .rte-ai-review-header-button.is-locate-current,
.richtexteditor .rte-ai-review-header-button.is-nav,
.richtexteditor .rte-ai-review-control-button.is-toggle-resolved {
    color: #4c6178;
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(241, 246, 251, 0.98) 100%);
}

.richtexteditor .rte-ai-review-control-button.is-accept-batch,
.richtexteditor .rte-ai-review-empty-actions .rte-ai-review-control-button[data-rte-ai-empty-action-id="undo-last"] {
    color: #166534;
    border-color: rgba(22, 101, 52, 0.12);
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.98) 0%, rgba(226, 250, 234, 0.98) 100%);
}

.richtexteditor .rte-ai-review-control-button.is-reject-batch,
.richtexteditor .rte-ai-review-action-button.is-reject {
    color: #6b7280;
    border-color: rgba(100, 116, 139, 0.14);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(237, 242, 247, 0.98) 100%);
}

.richtexteditor .rte-ai-review-header-button.is-undo,
.richtexteditor .rte-ai-review-action-button.is-undo,
.richtexteditor .rte-ai-review-empty-actions .rte-ai-review-control-button[data-rte-ai-empty-action-id="undo-last"] {
    color: #9a5d10;
    border-color: rgba(217, 119, 6, 0.12);
    background: linear-gradient(180deg, rgba(255, 248, 235, 0.98) 0%, rgba(255, 238, 209, 0.98) 100%);
}

.richtexteditor .rte-ai-review-header-button.is-redo,
.richtexteditor .rte-ai-review-action-button.is-redo,
.richtexteditor .rte-ai-review-empty-actions .rte-ai-review-control-button[data-rte-ai-empty-action-id="redo-last"] {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.12);
    background: linear-gradient(180deg, rgba(238, 252, 249, 0.98) 0%, rgba(220, 247, 241, 0.98) 100%);
}

.richtexteditor .rte-ai-review-empty-actions .rte-ai-review-control-button[data-rte-ai-empty-action-id="go-type"],
.richtexteditor .rte-ai-review-empty-actions .rte-ai-review-control-button[data-rte-ai-empty-action-id="next-overall"] {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.14);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(226, 238, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-review-header-button.is-undo::before,
.richtexteditor .rte-ai-review-header-button.is-redo::before,
.richtexteditor .rte-ai-review-action-button.is-undo::before,
.richtexteditor .rte-ai-review-action-button.is-redo::before,
.richtexteditor .rte-ai-review-action-button.is-locate::before,
.richtexteditor .rte-ai-review-action-button.is-reject::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.richtexteditor .rte-ai-review-header-button.is-undo::before,
.richtexteditor .rte-ai-review-action-button.is-undo::before {
    background: #d97706;
}

.richtexteditor .rte-ai-review-header-button.is-redo::before,
.richtexteditor .rte-ai-review-action-button.is-redo::before {
    background: #0f766e;
}

.richtexteditor .rte-ai-review-action-button.is-locate::before {
    background: #0f766e;
}

.richtexteditor .rte-ai-review-action-button.is-reject::before {
    background: #94a3b8;
}

@media (max-width: 900px) {
    .richtexteditor .rte-ai-chat-compose-shell .rte-ai-chat-composer-actions {
        justify-content: stretch;
    }

    .richtexteditor .rte-ai-chat-compose-shell .rte-ai-chat-composer-actions button {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* 2026-04-24 timeline polish */
.richtexteditor .rte-ai-review-summary-history-item,
.richtexteditor .rte-ai-review-empty-undo-history-item,
.richtexteditor .rte-ai-review-item-history-item {
    position: relative;
    padding-left: 16px;
}

.richtexteditor .rte-ai-review-summary-history-item::before,
.richtexteditor .rte-ai-review-empty-undo-history-item::before,
.richtexteditor .rte-ai-review-item-history-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.richtexteditor .rte-ai-review-summary-history-item::before {
    background: rgba(15, 118, 110, 0.82);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.richtexteditor .rte-ai-review-empty-undo-history-item::before,
.richtexteditor .rte-ai-review-item-history-item::before {
    background: rgba(217, 119, 6, 0.82);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.12);
}

.richtexteditor .rte-ai-review-item-history.is-redo .rte-ai-review-item-history-item::before {
    background: rgba(15, 118, 110, 0.82);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.richtexteditor .rte-ai-review-history-entry {
    position: relative;
    overflow: hidden;
    gap: 6px;
    padding: 12px 13px 12px 16px;
}

.richtexteditor .rte-ai-review-history-entry::before {
    content: "";
    position: absolute;
    inset: 10px auto 10px 0;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: rgba(100, 116, 139, 0.32);
}

.richtexteditor .rte-ai-review-history-entry.is-created::before {
    background: rgba(21, 89, 214, 0.34);
}

.richtexteditor .rte-ai-review-history-entry.is-accepted::before {
    background: rgba(22, 101, 52, 0.34);
}

.richtexteditor .rte-ai-review-history-entry.is-rejected::before {
    background: rgba(100, 116, 139, 0.34);
}

.richtexteditor .rte-ai-review-history-entry.is-reopened::before {
    background: rgba(217, 119, 6, 0.34);
}

.richtexteditor .rte-ai-review-history-entry.is-stale::before {
    background: rgba(180, 83, 9, 0.34);
}

.richtexteditor .rte-ai-review-history-entry.is-updated::before {
    background: rgba(14, 116, 144, 0.34);
}

.richtexteditor .rte-ai-review-history-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.richtexteditor .rte-ai-review-history-event {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-history-event.is-created {
    background: rgba(21, 89, 214, 0.14);
    color: #1753b8;
}

.richtexteditor .rte-ai-review-history-event.is-accepted {
    background: rgba(22, 101, 52, 0.14);
    color: #166534;
}

.richtexteditor .rte-ai-review-history-event.is-rejected {
    background: rgba(100, 116, 139, 0.16);
    color: #475569;
}

.richtexteditor .rte-ai-review-history-event.is-reopened {
    background: rgba(217, 119, 6, 0.14);
    color: #9a5d10;
}

.richtexteditor .rte-ai-review-history-event.is-stale {
    background: rgba(180, 83, 9, 0.14);
    color: #9a5b10;
}

.richtexteditor .rte-ai-review-history-event.is-updated {
    background: rgba(14, 116, 144, 0.14);
    color: #0f5d73;
}

.richtexteditor .rte-ai-review-empty {
    display: grid;
    gap: 14px;
}

.richtexteditor .rte-ai-review-empty-hero,
.richtexteditor .rte-ai-review-empty-zone {
    display: grid;
    gap: 10px;
    padding: 14px 15px;
    border-radius: 18px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.richtexteditor .rte-ai-review-empty-hero {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 252, 246, 0.98) 0%, rgba(247, 250, 255, 0.98) 62%, rgba(241, 246, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-review-empty-zone.is-recovery {
    background: linear-gradient(180deg, rgba(255, 249, 239, 0.97) 0%, rgba(255, 245, 231, 0.97) 100%);
}

.richtexteditor .rte-ai-review-empty-zone.is-next {
    background: linear-gradient(180deg, rgba(246, 250, 255, 0.98) 0%, rgba(239, 246, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-review-empty-zone.is-actions {
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(244, 248, 253, 0.98) 100%);
}

.richtexteditor .rte-ai-review-empty-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-review-empty-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #486075;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.richtexteditor .rte-ai-review-empty-status-pill.is-ready {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-review-empty-status-pill.is-recovery {
    color: #9a5d10;
    background: rgba(255, 247, 237, 0.94);
    border-color: rgba(217, 119, 6, 0.12);
}

.richtexteditor .rte-ai-review-empty-status-pill.is-clear {
    color: #166534;
    background: rgba(240, 253, 244, 0.94);
    border-color: rgba(22, 101, 52, 0.12);
}

.richtexteditor .rte-ai-review-empty-status-pill.is-count {
    color: #5b6f84;
}

.richtexteditor .rte-ai-review-empty-hero .rte-ai-review-empty-title {
    font-size: 16px;
}

.richtexteditor .rte-ai-review-empty-hero .rte-ai-review-empty-detail {
    max-width: 62ch;
}

.richtexteditor .rte-ai-review-empty-hero .rte-ai-review-empty-hint {
    margin-top: 2px;
}

.richtexteditor .rte-ai-review-empty-zone .rte-ai-review-section-label {
    margin-bottom: 2px;
}

.richtexteditor .rte-ai-review-empty-actions {
    margin-top: 0;
    display: grid;
    gap: 10px;
}

.richtexteditor .rte-ai-review-empty-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 11px 12px 12px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-empty-action-group::before {
    content: attr(data-rte-ai-empty-group-label);
    width: 100%;
    padding-left: 2px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7f94;
}

.richtexteditor .rte-ai-review-empty-action-group.is-queue {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.92) 0%, rgba(231, 240, 255, 0.9) 100%);
}

.richtexteditor .rte-ai-review-empty-action-group.is-recovery {
    background: linear-gradient(180deg, rgba(255, 248, 235, 0.92) 0%, rgba(255, 239, 214, 0.9) 100%);
}

.richtexteditor .rte-ai-review-empty-action-group.is-utility {
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.94) 0%, rgba(242, 246, 251, 0.92) 100%);
}

.richtexteditor .rte-ai-review-empty-action-group .rte-ai-review-control-button {
    margin-top: 2px;
}

.richtexteditor .rte-ai-chat-message {
    position: relative;
    overflow: hidden;
    gap: 10px;
    padding: 15px 15px 13px;
}

.richtexteditor .rte-ai-chat-message::before {
    content: "";
    position: absolute;
    inset: 12px auto 12px 0;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: rgba(93, 115, 136, 0.28);
}

.richtexteditor .rte-ai-chat-message.is-user::before {
    background: rgba(21, 89, 214, 0.34);
}

.richtexteditor .rte-ai-chat-message.is-assistant::before {
    background: rgba(15, 118, 110, 0.3);
}

.richtexteditor .rte-ai-chat-message.is-error::before {
    background: rgba(194, 65, 65, 0.34);
}

.richtexteditor .rte-ai-chat-exchange-banner {
    display: grid;
    gap: 7px;
    padding: 11px 13px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.09), transparent 36%),
        linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(243, 247, 252, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.richtexteditor .rte-ai-chat-exchange-group {
    display: grid;
    gap: 8px;
    padding: 6px 6px 10px;
    border-radius: 22px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: linear-gradient(180deg, rgba(252, 253, 255, 0.98) 0%, rgba(246, 249, 253, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.richtexteditor .rte-ai-chat-exchange-group[data-rte-ai-chat-current-exchange="true"] {
    border-color: rgba(21, 89, 214, 0.12);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.1), transparent 34%),
        linear-gradient(180deg, rgba(248, 251, 255, 0.99) 0%, rgba(241, 247, 255, 0.97) 100%);
    box-shadow: 0 16px 34px rgba(21, 89, 214, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.richtexteditor .rte-ai-chat-exchange-banner[data-rte-ai-chat-current-exchange="true"] {
    border-color: rgba(21, 89, 214, 0.14);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(246, 250, 255, 0.99) 0%, rgba(239, 245, 255, 0.97) 100%);
    box-shadow: 0 14px 28px rgba(21, 89, 214, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.richtexteditor .rte-ai-chat-exchange-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-exchange-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-chat-exchange-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #5b7088;
}

.richtexteditor .rte-ai-chat-exchange-pill.is-exchange {
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.12);
    background: rgba(245, 243, 255, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-pill.is-scope {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-pill.is-status {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.12);
    background: rgba(240, 253, 250, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-pill.is-current {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-pill.is-action {
    color: #9a5d10;
    border-color: rgba(217, 119, 6, 0.12);
    background: rgba(255, 247, 237, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-pill.is-change {
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.12);
    background: rgba(245, 243, 255, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-pill.is-impact {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.12);
    background: rgba(240, 253, 250, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-detail {
    font-size: 11.5px;
    line-height: 1.55;
    color: #5e7288;
}

.richtexteditor .rte-ai-chat-exchange-outcome {
    display: grid;
    gap: 8px;
    padding: 12px 13px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(243, 247, 252, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.richtexteditor .rte-ai-chat-exchange-outcome[data-rte-ai-chat-current-exchange="true"] {
    border-color: rgba(21, 89, 214, 0.12);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 36%),
        linear-gradient(180deg, rgba(246, 250, 255, 0.99) 0%, rgba(239, 245, 255, 0.97) 100%);
    box-shadow: 0 14px 28px rgba(21, 89, 214, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.richtexteditor .rte-ai-chat-exchange-outcome-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-exchange-outcome-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-chat-exchange-outcome-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #5b7088;
}

.richtexteditor .rte-ai-chat-exchange-outcome-pill.is-status {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.12);
    background: rgba(240, 253, 250, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-outcome-pill.is-scope,
.richtexteditor .rte-ai-chat-exchange-outcome-pill.is-current {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-outcome-pill.is-steps {
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.12);
    background: rgba(245, 243, 255, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-outcome-pill.is-action {
    color: #9a5d10;
    border-color: rgba(217, 119, 6, 0.12);
    background: rgba(255, 247, 237, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-outcome-pill.is-change {
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.12);
    background: rgba(245, 243, 255, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-outcome-pill.is-impact {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.12);
    background: rgba(240, 253, 250, 0.96);
}

.richtexteditor .rte-ai-chat-exchange-outcome-detail {
    font-size: 11.5px;
    line-height: 1.6;
    color: #5e7288;
}

.richtexteditor .rte-ai-chat-message[data-rte-ai-chat-thread-role] {
    overflow: visible;
}

.richtexteditor .rte-ai-chat-message[data-rte-ai-chat-current-exchange="true"] {
    box-shadow: 0 16px 30px rgba(21, 89, 214, 0.08), var(--rte-ai-card-shadow);
}

.richtexteditor .rte-ai-chat-message[data-rte-ai-chat-thread-role="request"] {
    margin-bottom: -4px;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.richtexteditor .rte-ai-chat-message[data-rte-ai-chat-thread-role="response"] {
    margin-top: -4px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.richtexteditor .rte-ai-chat-message[data-rte-ai-chat-thread-role="request"]::before {
    inset: 12px auto -10px 0;
}

.richtexteditor .rte-ai-chat-message[data-rte-ai-chat-thread-role="response"]::before {
    inset: -10px auto 12px 0;
}

.richtexteditor .rte-ai-chat-message-header {
    display: grid;
    gap: 6px;
}

.richtexteditor .rte-ai-chat-message-role-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.richtexteditor .rte-ai-chat-message-role,
.richtexteditor .rte-ai-chat-message-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(20, 36, 58, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.richtexteditor .rte-ai-chat-message-role {
    color: #486075;
    background: rgba(248, 250, 252, 0.92);
}

.richtexteditor .rte-ai-chat-message-role.is-user {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-chat-message-role.is-assistant {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.12);
}

.richtexteditor .rte-ai-chat-message-role.is-error {
    color: #b42318;
    background: rgba(254, 242, 242, 0.94);
    border-color: rgba(194, 65, 65, 0.12);
}

.richtexteditor .rte-ai-chat-message-pill {
    color: #64748b;
    background: rgba(255, 255, 255, 0.9);
}

.richtexteditor .rte-ai-chat-message-pill.is-scope {
    color: #48657f;
}

.richtexteditor .rte-ai-chat-message-pill.is-type {
    color: #6b7280;
    background: rgba(248, 250, 252, 0.96);
}

.richtexteditor .rte-ai-chat-message-pill.is-turn {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.92);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-message.is-assistant .rte-ai-chat-message-pill.is-type {
    color: #0f766e;
    background: rgba(238, 252, 249, 0.96);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-message.is-user .rte-ai-chat-message-pill.is-type {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.96);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-message.is-error .rte-ai-chat-message-pill.is-type {
    color: #b42318;
    background: rgba(254, 242, 242, 0.96);
    border-color: rgba(194, 65, 65, 0.1);
}

.richtexteditor .rte-ai-chat-message-meta {
    display: block;
    font-size: 11px;
    line-height: 1.5;
    color: #708295;
    padding-left: 2px;
}

.richtexteditor .rte-ai-chat-message-meta::before {
    display: none;
}

.richtexteditor .rte-ai-chat-message-state {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(243, 247, 252, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-message-state.is-user {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(230, 240, 255, 0.96) 100%);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-message-state.is-assistant {
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.98) 0%, rgba(229, 248, 242, 0.96) 100%);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-message-state.is-error {
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.98) 0%, rgba(252, 235, 235, 0.96) 100%);
    border-color: rgba(194, 65, 65, 0.1);
}

.richtexteditor .rte-ai-chat-message-state-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #60748c;
}

.richtexteditor .rte-ai-chat-message-state-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-message-state-detail {
    font-size: 11px;
    line-height: 1.55;
    color: #5e7288;
}

.richtexteditor .rte-ai-chat-message-text {
    color: #22384f;
}

.richtexteditor .rte-ai-chat-message.is-user .rte-ai-chat-message-text {
    color: #173654;
}

.richtexteditor .rte-ai-chat-message.is-error .rte-ai-chat-message-text {
    color: #7f1d1d;
}

.richtexteditor .rte-ai-chat-message-prompt-card {
    display: grid;
    gap: 9px;
    padding: 12px 13px;
    border-radius: 16px;
    border: 1px solid rgba(21, 89, 214, 0.1);
    background: linear-gradient(180deg, rgba(245, 250, 255, 0.98) 0%, rgba(236, 244, 255, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.richtexteditor .rte-ai-chat-message-prompt-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-message-prompt-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-message-prompt-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1753b8;
    border: 1px solid rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-chat-message-prompt-pill.is-exchange,
.richtexteditor .rte-ai-chat-message-request-pill.is-exchange {
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.12);
    background: rgba(245, 243, 255, 0.96);
}

.richtexteditor .rte-ai-chat-message-prompt-body {
    font-size: 12.5px;
    line-height: 1.7;
    color: #274763;
    padding: 10px 11px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(20, 36, 58, 0.06);
}

.richtexteditor .rte-ai-chat-message-context-card {
    display: grid;
    gap: 9px;
    padding: 12px 13px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(244, 248, 253, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.richtexteditor .rte-ai-chat-message-context-card.is-user {
    border-color: rgba(21, 89, 214, 0.1);
    background: linear-gradient(180deg, rgba(244, 249, 255, 0.98) 0%, rgba(235, 243, 255, 0.96) 100%);
}

.richtexteditor .rte-ai-chat-message-context-header {
    display: grid;
    gap: 7px;
}

.richtexteditor .rte-ai-chat-message-context-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-message-context-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-chat-message-context-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: #55708b;
}

.richtexteditor .rte-ai-chat-message-context-pill.is-scope {
    color: #1753b8;
    border-color: rgba(21, 89, 214, 0.12);
    background: rgba(239, 246, 255, 0.96);
}

.richtexteditor .rte-ai-chat-message-context-copy {
    font-size: 12px;
    line-height: 1.65;
    color: #355168;
    padding: 10px 11px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(20, 36, 58, 0.06);
}

.richtexteditor .rte-ai-chat-message-request-card {
    display: grid;
    gap: 9px;
    padding: 12px 13px;
    border-radius: 16px;
    border: 1px solid rgba(15, 118, 110, 0.1);
    background: linear-gradient(180deg, rgba(242, 252, 249, 0.98) 0%, rgba(233, 248, 243, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.richtexteditor .rte-ai-chat-message-request-header {
    display: grid;
    gap: 7px;
}

.richtexteditor .rte-ai-chat-message-request-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f5f59;
}

.richtexteditor .rte-ai-chat-message-request-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-chat-message-request-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0f766e;
    border: 1px solid rgba(15, 118, 110, 0.12);
    background: rgba(240, 253, 250, 0.96);
}

.richtexteditor .rte-ai-chat-message-request-pill.is-detail {
    color: #55786f;
    border-color: rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.richtexteditor .rte-ai-chat-message-request-body {
    font-size: 12.5px;
    line-height: 1.7;
    color: #25524d;
    padding: 10px 11px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(20, 36, 58, 0.06);
}

.richtexteditor .rte-ai-chat-quick-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 2px 0 4px;
}

.richtexteditor .rte-ai-chat-quick-row > .rte-ai-chat-quick-button {
    display: grid;
    justify-items: start;
    align-content: start;
    gap: 7px;
    min-height: 116px;
    padding: 12px 13px;
    border-radius: 18px;
    text-align: left;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.96) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-quick-button.is-active {
    border-color: rgba(21, 89, 214, 0.14);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(229, 239, 255, 0.98) 100%);
    box-shadow: 0 12px 28px rgba(21, 89, 214, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.richtexteditor .rte-ai-chat-quick-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    background: rgba(248, 250, 252, 0.94);
    border: 1px solid rgba(20, 36, 58, 0.08);
}

.richtexteditor .rte-ai-chat-quick-button[data-rte-ai-chat-prompt-tone="summary"] .rte-ai-chat-quick-eyebrow {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-quick-button[data-rte-ai-chat-prompt-tone="review"] .rte-ai-chat-quick-eyebrow {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-quick-button[data-rte-ai-chat-prompt-tone="language"] .rte-ai-chat-quick-eyebrow {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-quick-button[data-rte-ai-chat-prompt-tone="structure"] .rte-ai-chat-quick-eyebrow {
    color: #9a5d10;
    background: rgba(255, 247, 237, 0.94);
    border-color: rgba(217, 119, 6, 0.1);
}

.richtexteditor .rte-ai-chat-quick-button[data-rte-ai-chat-prompt-tone="expand"] .rte-ai-chat-quick-eyebrow {
    color: #166534;
    background: rgba(240, 253, 244, 0.94);
    border-color: rgba(22, 101, 52, 0.1);
}

.richtexteditor .rte-ai-chat-quick-title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    color: #173654;
}

.richtexteditor .rte-ai-chat-quick-copy {
    font-size: 11px;
    line-height: 1.5;
    color: #5a6f84;
}

.richtexteditor .rte-ai-chat-quick-summary {
    display: grid;
    gap: 8px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(241, 245, 249, 0.92) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.richtexteditor .rte-ai-chat-quick-summary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-quick-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.richtexteditor .rte-ai-chat-quick-summary-pill.is-count {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-quick-summary-pill.is-active {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-quick-summary-pill.is-custom {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-quick-summary-pill.is-ready {
    color: #9a5d10;
    background: rgba(255, 247, 237, 0.94);
    border-color: rgba(217, 119, 6, 0.1);
}

.richtexteditor .rte-ai-chat-quick-summary-text {
    font-size: 12px;
    line-height: 1.6;
    color: #52697f;
}

.richtexteditor .rte-ai-chat-compose-shell .rte-ai-chat-composer {
    display: grid;
    gap: 10px;
}

.richtexteditor .rte-ai-chat-composer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-composer-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(248, 250, 252, 0.94);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.richtexteditor .rte-ai-chat-composer-pill.is-scope {
    color: #48657f;
}

.richtexteditor .rte-ai-chat-composer-pill.is-exchanges {
    color: #6d28d9;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(109, 40, 217, 0.1);
}

.richtexteditor .rte-ai-chat-composer-pill.is-messages {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-composer-pill.is-send {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-composer-pill.is-starter {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-composer-pill.is-custom {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-composer-pill.is-prompt {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-composer-pill.is-count {
    color: #5b6f84;
    margin-left: auto;
}

.richtexteditor .rte-ai-chat-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 22px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(248, 250, 252, 0.9);
}

.richtexteditor .rte-ai-chat-status.is-ready {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.94) 0%, rgba(233, 244, 255, 0.94) 100%);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-status.is-busy {
    background: linear-gradient(180deg, rgba(255, 248, 235, 0.94) 0%, rgba(255, 243, 220, 0.94) 100%);
    border-color: rgba(217, 119, 6, 0.1);
}

.richtexteditor .rte-ai-chat-status.is-error {
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.94) 0%, rgba(254, 236, 236, 0.94) 100%);
    border-color: rgba(194, 65, 65, 0.1);
}

.richtexteditor .rte-ai-chat-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.86);
    color: #64748b;
}

.richtexteditor .rte-ai-chat-status-pill.is-ready {
    color: #1753b8;
}

.richtexteditor .rte-ai-chat-status-pill.is-busy {
    color: #9a5d10;
}

.richtexteditor .rte-ai-chat-status-pill.is-error {
    color: #b42318;
}

.richtexteditor .rte-ai-chat-status-text {
    font-size: 12px;
    line-height: 1.5;
    color: #51697f;
}

.richtexteditor .rte-ai-chat-context-summary {
    display: grid;
    gap: 8px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(241, 245, 249, 0.92) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.richtexteditor .rte-ai-chat-context-summary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-context-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.richtexteditor .rte-ai-chat-context-summary-pill.is-selection {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-context-summary-pill.is-document {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-context-summary-pill.is-available {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-context-summary-pill.is-empty {
    color: #9a5d10;
    background: rgba(255, 247, 237, 0.94);
    border-color: rgba(217, 119, 6, 0.1);
}

.richtexteditor .rte-ai-chat-context-summary-text {
    font-size: 12px;
    line-height: 1.6;
    color: #52697f;
}

.richtexteditor .rte-ai-chat-context-preview {
    display: grid;
    gap: 9px;
}

.richtexteditor .rte-ai-chat-context-preview-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-context-preview-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #48657f;
}

.richtexteditor .rte-ai-chat-context-preview-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.richtexteditor .rte-ai-chat-context-preview-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-context-preview.is-selection .rte-ai-chat-context-preview-pill.is-words {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-context-preview.is-document .rte-ai-chat-context-preview-pill.is-words {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-context-preview-copy {
    font-size: 12px;
    line-height: 1.6;
    color: #4f667c;
}

.richtexteditor .rte-ai-chat-empty {
    display: grid;
    gap: 14px;
    padding: 15px;
    border-radius: 20px;
    border-style: solid;
    background:
        radial-gradient(circle at top right, rgba(21, 89, 214, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(255, 252, 246, 0.96) 0%, rgba(247, 250, 255, 0.98) 62%, rgba(243, 247, 255, 0.98) 100%);
}

.richtexteditor .rte-ai-chat-empty-hero {
    display: grid;
    gap: 9px;
}

.richtexteditor .rte-ai-chat-empty-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-empty-detail {
    max-width: 62ch;
    font-size: 12px;
    line-height: 1.6;
    color: #556d84;
}

.richtexteditor .rte-ai-chat-empty-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-empty-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.richtexteditor .rte-ai-chat-empty-pill.is-scope {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-empty-pill.is-prompts {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-empty-pill.is-size {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-empty-capabilities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.richtexteditor .rte-ai-chat-empty-capability {
    display: grid;
    gap: 6px;
    padding: 12px 13px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-empty-capability-title {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
    color: #18344d;
}

.richtexteditor .rte-ai-chat-empty-capability-copy {
    font-size: 11px;
    line-height: 1.55;
    color: #61768b;
}

.richtexteditor .rte-ai-chat-feed-intro {
    display: grid;
    gap: 8px;
    padding: 13px 14px;
    border-radius: 18px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background:
        radial-gradient(circle at top right, rgba(21, 89, 214, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(252, 253, 255, 0.96) 0%, rgba(245, 248, 252, 0.94) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-feed-intro-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-feed-intro-detail {
    font-size: 12px;
    line-height: 1.6;
    color: #556d84;
}

.richtexteditor .rte-ai-chat-feed-intro-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-feed-intro-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.richtexteditor .rte-ai-chat-feed-intro-pill.is-status {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-feed-intro-pill.is-exchanges {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-feed-intro-pill.is-starter {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-feed-intro-pill.is-custom {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-feed-summary {
    display: grid;
    gap: 8px;
    padding: 13px 14px;
    border-radius: 18px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background:
        radial-gradient(circle at top right, rgba(21, 89, 214, 0.1), transparent 30%),
        linear-gradient(180deg, rgba(252, 253, 255, 0.98) 0%, rgba(246, 249, 253, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-feed-summary-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-feed-summary-detail {
    font-size: 12px;
    line-height: 1.55;
    color: #5f7288;
}

.richtexteditor .rte-ai-chat-feed-summary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-feed-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-feed-summary-pill.is-status {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-feed-summary-pill.is-scope {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-feed-summary-pill.is-exchanges {
    color: #6d28d9;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(109, 40, 217, 0.1);
}

.richtexteditor .rte-ai-chat-feed-summary-pill.is-action {
    color: #9a5d10;
    background: rgba(255, 247, 237, 0.96);
    border-color: rgba(217, 119, 6, 0.12);
}

.richtexteditor .rte-ai-chat-feed-summary-pill.is-change {
    color: #6d28d9;
    background: rgba(245, 243, 255, 0.96);
    border-color: rgba(109, 40, 217, 0.12);
}

.richtexteditor .rte-ai-chat-feed-summary-pill.is-impact {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.96);
    border-color: rgba(15, 118, 110, 0.12);
}

.richtexteditor .rte-ai-chat-message-preview {
    display: grid;
    gap: 8px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 249, 255, 0.94) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-message-preview-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-message-preview-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #48657f;
}

.richtexteditor .rte-ai-chat-message-preview-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-message-preview-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(239, 246, 255, 0.92);
    color: #1753b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.richtexteditor .rte-ai-chat-message-preview-pill.is-status {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-message-preview-pill.is-scope {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-message-preview-pill.is-steps {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-message-preview-pill.is-target {
    color: #5b6f84;
    background: rgba(248, 250, 252, 0.94);
}

.richtexteditor .rte-ai-chat-message-preview-compare {
    display: grid;
    gap: 8px;
    padding: 11px 11px 10px;
    border-radius: 15px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(252, 253, 255, 0.98) 0%, rgba(246, 249, 253, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-message-preview-compare-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 10px;
}

.richtexteditor .rte-ai-chat-message-preview-compare-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-message-preview-compare-detail {
    font-size: 11px;
    color: #5f7288;
}

.richtexteditor .rte-ai-chat-message-preview .rte-ai-review-empty-preview-line {
    margin-top: 0;
    padding: 10px 11px;
    border-radius: 13px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-message-preview-reason-card {
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    border-radius: 15px;
    border: 1px solid rgba(21, 89, 214, 0.08);
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(240, 246, 255, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-message-preview-reason-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5e7390;
}

.richtexteditor .rte-ai-chat-message-preview-reason {
    font-size: 11px;
    line-height: 1.55;
    color: #5c7186;
}

.richtexteditor .rte-ai-chat-message-preview-glance {
    display: grid;
    gap: 7px;
    padding: 11px 12px;
    border-radius: 15px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: linear-gradient(180deg, rgba(250, 251, 255, 0.98) 0%, rgba(244, 247, 252, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.richtexteditor .rte-ai-chat-message-preview-glance-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-message-preview-glance-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.richtexteditor .rte-ai-chat-message-preview-glance-detail {
    font-size: 11px;
    line-height: 1.55;
    color: #5c7186;
}

.richtexteditor .rte-ai-chat-message-preview-plan {
    display: grid;
    gap: 7px;
}

.richtexteditor .rte-ai-chat-message-preview-plan-lead {
    display: grid;
    gap: 6px;
}

.richtexteditor .rte-ai-chat-message-preview-plan-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7f94;
}

.richtexteditor .rte-ai-chat-message-preview-plan-lead-title,
.richtexteditor .rte-ai-chat-message-preview-plan-followup-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7f94;
}

.richtexteditor .rte-ai-chat-message-preview-plan-lead-detail {
    font-size: 11px;
    line-height: 1.55;
    color: #5c7186;
}

.richtexteditor .rte-ai-chat-message-preview-plan-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-message-preview-plan-item {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.86);
    color: #4c6178;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-message-preview-plan-item.is-more {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.92);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-message-preview-plan-item.is-recommended {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.92);
    border-color: rgba(21, 89, 214, 0.12);
}

.richtexteditor .rte-ai-chat-message-preview-plan-followups {
    display: grid;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-message-preview-plan-followup {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border-radius: 15px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-message-preview-plan-followup-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5e7390;
}

.richtexteditor .rte-ai-chat-message-preview-plan-followup-detail {
    font-size: 11px;
    line-height: 1.55;
    color: #5c7186;
}

.richtexteditor .rte-ai-chat-message-preview-plan-followup.is-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(21, 89, 214, 0.1);
    background: rgba(239, 246, 255, 0.92);
    color: #1753b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.richtexteditor .rte-ai-review-overview-hero {
    display: grid;
    gap: 10px;
    padding: 14px 15px;
    border-radius: 18px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background:
        radial-gradient(circle at top right, rgba(21, 89, 214, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 252, 246, 0.98) 0%, rgba(246, 250, 255, 0.98) 64%, rgba(241, 246, 255, 0.98) 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.richtexteditor .rte-ai-review-overview-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-review-overview-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-overview-pill.is-status {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-review-overview-pill.is-progress {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-review-overview-pill.is-filter {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-review-overview-pill.is-remote {
    color: #18536f;
    background: rgba(240, 249, 252, 0.94);
    border-color: rgba(24, 83, 111, 0.1);
}

.richtexteditor .rte-ai-review-overview-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
    color: #173654;
}

.richtexteditor .rte-ai-review-overview-detail {
    font-size: 12px;
    line-height: 1.6;
    color: #556d84;
}

.richtexteditor .rte-ai-review-overview-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.richtexteditor .rte-ai-review-overview-progress-bar {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(221, 231, 242, 0.88);
    box-shadow: inset 0 1px 2px rgba(20, 36, 58, 0.08);
}

.richtexteditor .rte-ai-review-overview-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(21, 89, 214, 0.94) 0%, rgba(15, 118, 110, 0.9) 100%);
}

.richtexteditor .rte-ai-review-overview-progress-label {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    color: #48657f;
}

.richtexteditor .rte-ai-review-header {
    align-items: flex-start;
    gap: 14px;
    padding: 14px 15px 15px;
    border-radius: 22px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background:
        radial-gradient(circle at top left, rgba(21, 89, 214, 0.13), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(245, 249, 255, 0.97) 68%, rgba(241, 246, 255, 0.96) 100%);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.richtexteditor .rte-ai-review-header-copy {
    flex: 1 1 320px;
    display: grid;
    gap: 8px;
    padding-right: 8px;
}

.richtexteditor .rte-ai-review-header-eyebrow,
.richtexteditor .rte-ai-review-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-review-header-kicker,
.richtexteditor .rte-ai-review-header-status,
.richtexteditor .rte-ai-review-header-meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-header-kicker,
.richtexteditor .rte-ai-review-header-status {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-header-kicker {
    color: #5c7087;
    background: rgba(248, 250, 252, 0.94);
}

.richtexteditor .rte-ai-review-header-status.is-status {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-review-header-status.is-filter {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-review-header-status.is-remote {
    color: #18536f;
    background: rgba(240, 249, 252, 0.94);
    border-color: rgba(24, 83, 111, 0.1);
}

.richtexteditor .rte-ai-review-title-row {
    gap: 10px;
}

.richtexteditor .rte-ai-review-title-icon {
    width: 32px;
    height: 32px;
    box-shadow: inset 0 0 0 1px rgba(21, 89, 214, 0.14), 0 8px 18px rgba(21, 89, 214, 0.09);
}

.richtexteditor .rte-ai-review-title {
    font-size: 16px;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-review-subtitle {
    margin-top: 0;
}

.richtexteditor .rte-ai-review-header-meta-pill {
    min-height: 26px;
    font-size: 11px;
    font-weight: 700;
    color: #4b647c;
}

.richtexteditor .rte-ai-review-header-meta-pill.is-current {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-review-header-meta-pill.is-pending {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-review-header-meta-pill.is-total {
    color: #6b7280;
    background: rgba(248, 250, 252, 0.94);
    border-color: rgba(100, 116, 139, 0.12);
}

.richtexteditor .rte-ai-review-header-meta-pill.is-stale {
    color: #9a5d10;
    background: rgba(255, 248, 235, 0.94);
    border-color: rgba(217, 119, 6, 0.1);
}

.richtexteditor .rte-ai-review-header-meta-pill.is-complete {
    color: #166534;
    background: rgba(240, 253, 244, 0.94);
    border-color: rgba(22, 101, 52, 0.1);
}

.richtexteditor .rte-ai-chat-header {
    align-items: flex-start;
    gap: 14px;
    padding: 14px 15px 15px;
    border-radius: 22px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background:
        radial-gradient(circle at top right, rgba(21, 89, 214, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 255, 0.97) 70%, rgba(241, 246, 255, 0.96) 100%);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.richtexteditor .rte-ai-chat-header-copy {
    flex: 1 1 320px;
    display: grid;
    gap: 8px;
    padding-right: 8px;
}

.richtexteditor .rte-ai-chat-header-eyebrow,
.richtexteditor .rte-ai-chat-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-chat-header-kicker,
.richtexteditor .rte-ai-chat-header-status,
.richtexteditor .rte-ai-chat-header-meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-chat-header-kicker,
.richtexteditor .rte-ai-chat-header-status {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-chat-header-kicker {
    color: #5c7087;
    background: rgba(248, 250, 252, 0.94);
}

.richtexteditor .rte-ai-chat-header-status.is-status {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-header-status.is-scope {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-header-status.is-version {
    color: #f8fbff;
    background: linear-gradient(180deg, rgba(19, 33, 56, 0.96) 0%, rgba(31, 53, 88, 0.96) 100%);
    border-color: rgba(19, 33, 56, 0.2);
}

.richtexteditor .rte-ai-chat-title-row {
    gap: 10px;
}

.richtexteditor .rte-ai-chat-title-icon {
    width: 32px;
    height: 32px;
    box-shadow: inset 0 0 0 1px rgba(21, 89, 214, 0.14), 0 8px 18px rgba(21, 89, 214, 0.09);
}

.richtexteditor .rte-ai-chat-title {
    font-size: 16px;
    letter-spacing: -0.01em;
    color: #173654;
}

.richtexteditor .rte-ai-chat-subtitle {
    margin-top: 0;
}

.richtexteditor .rte-ai-chat-header-meta-pill {
    min-height: 26px;
    font-size: 11px;
    font-weight: 700;
    color: #4b647c;
}

.richtexteditor .rte-ai-chat-header-meta-pill.is-messages {
    color: #1753b8;
    background: rgba(239, 246, 255, 0.94);
    border-color: rgba(21, 89, 214, 0.1);
}

.richtexteditor .rte-ai-chat-header-meta-pill.is-exchanges {
    color: #6d28d9;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(109, 40, 217, 0.1);
}

.richtexteditor .rte-ai-chat-header-meta-pill.is-words {
    color: #5b6f84;
}

.richtexteditor .rte-ai-chat-header-meta-pill.is-scope {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.94);
    border-color: rgba(15, 118, 110, 0.1);
}

.richtexteditor .rte-ai-chat-header-meta-pill.is-prompt {
    color: #7c3aed;
    background: rgba(245, 243, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.1);
}

.richtexteditor .rte-ai-chat-header-meta-pill.is-action {
    color: #9a5d10;
    background: rgba(255, 247, 237, 0.96);
    border-color: rgba(217, 119, 6, 0.12);
}

.richtexteditor .rte-ai-chat-header-actions {
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 8px;
}

@media (max-width: 1100px) {
    .richtexteditor .rte-ai-chat-header {
        flex-wrap: wrap;
    }

    .richtexteditor .rte-ai-chat-header-copy {
        flex-basis: 100%;
        padding-right: 0;
    }
}

.richtexteditor .rte-ai-review-header-actions {
    flex: 0 1 470px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 10px;
}

.richtexteditor .rte-ai-review-header-group {
    display: grid;
    gap: 7px;
    padding: 10px 11px 11px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-header-group.is-context {
    background: linear-gradient(180deg, rgba(241, 249, 252, 0.96) 0%, rgba(232, 244, 249, 0.94) 100%);
}

.richtexteditor .rte-ai-review-header-group.is-move {
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(242, 246, 251, 0.96) 100%);
}

.richtexteditor .rte-ai-review-header-group.is-recover {
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.98) 0%, rgba(246, 250, 255, 0.96) 100%);
}

.richtexteditor .rte-ai-review-header-group-label {
    padding-left: 2px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7f94;
}

.richtexteditor .rte-ai-review-header-group-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-review-header-utility {
    order: 99;
    margin-left: auto;
}

.richtexteditor .rte-ai-review-header-button {
    min-height: 37px;
}

.richtexteditor .rte-ai-panel-close-button.is-review-close {
    min-width: 37px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 247, 252, 0.96) 100%);
    border: 1px solid rgba(20, 36, 58, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

@media (max-width: 1100px) {
    .richtexteditor .rte-ai-review-header {
        flex-wrap: wrap;
    }

    .richtexteditor .rte-ai-review-header-copy {
        flex-basis: 100%;
        padding-right: 0;
    }

    .richtexteditor .rte-ai-review-header-actions {
        flex-basis: 100%;
        justify-content: flex-start;
    }

    .richtexteditor .rte-ai-review-header-utility {
        margin-left: 0;
    }
}

.richtexteditor .rte-ai-review-controls {
    display: grid;
    gap: 10px;
}

.richtexteditor .rte-ai-review-control-group {
    display: grid;
    gap: 8px;
    padding: 11px 12px 12px;
    border-radius: 16px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.richtexteditor .rte-ai-review-control-group::before {
    content: attr(data-rte-ai-review-group-label);
    padding-left: 2px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7f94;
}

.richtexteditor .rte-ai-review-control-group.is-scope {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.92) 0%, rgba(231, 240, 255, 0.9) 100%);
}

.richtexteditor .rte-ai-review-control-group.is-visibility {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(242, 246, 251, 0.92) 100%);
}

.richtexteditor .rte-ai-review-control-group.is-batch {
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.92) 0%, rgba(255, 247, 237, 0.9) 100%);
}

.richtexteditor .rte-ai-review-control-group-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.richtexteditor .rte-ai-review-control-group .rte-ai-review-filter-select,
.richtexteditor .rte-ai-review-control-group .rte-ai-review-control-button {
    min-height: 38px;
}

.richtexteditor .rte-ai-review-control-group .rte-ai-review-filter-select {
    min-width: 156px;
}

.richtexteditor .rte-ai-review-control-group.is-scope .rte-ai-review-type-chips {
    width: 100%;
    margin-top: 2px;
}

/* Keep the docked AI Chat / AI Review drawers below wrapped two-row
   toolbars (these are fixed-position rails along the right edge — they
   need an explicit `top` so they don't sit behind the toolbar). */
.richtexteditor .rte-ai-chat-panel,
.richtexteditor .rte-ai-review-panel {
    top: 144px;
}

/* 2026-05-08: removed `.rte-panel-aiassist { top: 144px !important }`.
   The Ask-AI dropdown is a popover anchored by the editor's
   createToolbarItemDropDownPanel helper to the AI button's bounding box —
   forcing it to a fixed top pinned the popover ~100 px below the button on
   wide toolbars, leaving a visible gap between the trigger and the panel. */

.rte-panel-aiassist rte-dialog-inner {
    max-height: min(680px, calc(100vh - 160px));
    overflow: auto;
}

.richtexteditor .rte-ai-chat-context-shell {
    position: relative;
    min-height: 96px;
    padding-left: 112px !important;
}

.richtexteditor .rte-ai-context-photo {
    position: absolute;
    left: 14px;
    top: 14px;
    width: 80px;
    height: 74px;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.16);
    display: block !important;
    pointer-events: none;
    z-index: 3;
}

.richtexteditor .rte-ai-context-photo-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 640px) {
    .richtexteditor .rte-ai-chat-context-shell {
        padding-left: 13px !important;
        padding-top: 104px !important;
    }

    .richtexteditor .rte-ai-context-photo {
        left: 13px;
        right: 13px;
        width: auto;
        height: 78px;
    }
}

/* 2026-05-08: keep docked AI panels operable inside shorter demo editors. */
.richtexteditor .rte-ai-chat-panel,
.richtexteditor .rte-ai-review-panel {
    top: 76px;
    bottom: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.richtexteditor .rte-ai-chat-header,
.richtexteditor .rte-ai-review-header {
    position: sticky;
    top: 0;
    z-index: 8;
    flex: 0 0 auto;
    margin: -6px -6px 0;
    padding: 10px 10px 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.96) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.richtexteditor .rte-ai-chat-header-copy {
    gap: 5px;
}

.richtexteditor .rte-ai-chat-header-eyebrow,
.richtexteditor .rte-ai-chat-header-meta {
    gap: 5px;
}

.richtexteditor .rte-ai-chat-header-kicker,
.richtexteditor .rte-ai-chat-header-status,
.richtexteditor .rte-ai-chat-header-meta-pill {
    min-height: 20px;
    padding: 0 7px;
}

.richtexteditor .rte-ai-chat-title-icon {
    width: 28px;
    height: 28px;
}

.richtexteditor .rte-ai-chat-title {
    font-size: 14px;
}

.richtexteditor .rte-ai-chat-subtitle {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.35;
}

.richtexteditor .rte-ai-chat-header-actions {
    flex-wrap: nowrap;
    align-items: flex-start;
    margin-left: auto;
}

.richtexteditor .rte-ai-chat-header-button {
    white-space: nowrap;
}

.richtexteditor .rte-ai-panel-close-button {
    min-width: 30px;
    min-height: 30px;
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-chat-panel .rte-ai-hero,
.richtexteditor .rte-ai-chat-context-shell,
.richtexteditor .rte-ai-chat-quick-shell,
.richtexteditor .rte-ai-chat-compose-shell,
.richtexteditor .rte-ai-chat-status {
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-chat-feed-shell {
    flex: 1 0 120px;
    min-height: 120px;
}

.richtexteditor .rte-ai-chat-panel .rte-ai-hero {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
}

.richtexteditor .rte-ai-chat-panel .rte-ai-hero-media {
    height: 64px;
    border-radius: 14px;
}

.richtexteditor .rte-ai-chat-context-shell {
    min-height: 76px;
    padding-left: 92px !important;
}

.richtexteditor .rte-ai-context-photo {
    left: 13px;
    top: 13px;
    width: 64px;
    height: 58px;
    border-radius: 14px;
}

.richtexteditor .rte-ai-chat-input {
    min-height: 74px;
    max-height: 140px;
}

@media (max-width: 900px) {
    .richtexteditor .rte-ai-chat-panel,
    .richtexteditor .rte-ai-review-panel {
        top: 44px;
    }
}

/* 2026-05-08: viewport-dock AI Review at the top-right corner. Two rounds of
   feedback ("tall and narrow", then "messy and too long") asked for a
   shorter, calmer panel. Now it sizes to its own content (no bottom: clamp
   anchor, no min-height) so the empty state collapses to ~220 px instead of
   stretching to the full viewport, and the populated state grows up to a
   sensible cap. The minimal-skin overrides further down hide section labels,
   progress bar, stat pills, recovery/utility zones, and the AI Chat redirect
   card so the surviving content reads as: title + close + filter + queue. */
.richtexteditor .rte-ai-review-panel {
    position: fixed;
    top: 56px;
    right: clamp(12px, 2.5vw, 28px);
    bottom: auto;
    left: auto;
    width: min(520px, calc(100vw - 24px));
    max-height: calc(100vh - 76px);
    z-index: 2147483000;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.richtexteditor.rte-ai-review-host {
    isolation: auto;
    z-index: 2147482999;
}

.richtexteditor .rte-ai-review-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    margin: -4px -4px 0;
    padding: 8px;
}

.richtexteditor .rte-ai-review-header-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.richtexteditor .rte-ai-review-header-eyebrow,
.richtexteditor .rte-ai-review-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.richtexteditor .rte-ai-review-header-status,
.richtexteditor .rte-ai-review-header-meta-pill {
    min-height: 20px;
    padding: 0 7px;
    font-size: 10px;
}

.richtexteditor .rte-ai-review-title-icon {
    width: 28px;
    height: 28px;
}

.richtexteditor .rte-ai-review-title {
    font-size: 14px;
}

.richtexteditor .rte-ai-review-subtitle {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.35;
}

.richtexteditor .rte-ai-review-header-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 6px;
    max-width: 180px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.richtexteditor .rte-ai-review-header-utility {
    order: -1;
    margin-left: 0;
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-review-header-group {
    flex: 0 0 auto;
    gap: 5px;
    padding: 6px;
    border-radius: 12px;
}

.richtexteditor .rte-ai-review-header-group-label {
    font-size: 9px;
}

.richtexteditor .rte-ai-review-header-group-body {
    gap: 5px;
}

.richtexteditor .rte-ai-review-header-button {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 11px;
    white-space: nowrap;
}

.richtexteditor .rte-ai-panel-close-button.is-review-close {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 12px;
}

.richtexteditor .rte-ai-review-overview,
.richtexteditor .rte-ai-review-navigation {
    flex: 0 0 auto;
    padding: 10px;
    border-radius: 16px;
}

.richtexteditor .rte-ai-review-controls {
    gap: 8px;
    padding: 10px;
}

.richtexteditor .rte-ai-review-control-group {
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
}

.richtexteditor .rte-ai-review-content {
    flex: 1 0 140px;
    min-height: 140px;
    padding: 10px;
}

@media (max-width: 560px) {
    .richtexteditor .rte-ai-review-panel {
        top: 44px;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        max-height: calc(100vh - 52px);
    }

    .richtexteditor .rte-ai-review-header {
        grid-template-columns: 1fr auto;
    }

    .richtexteditor .rte-ai-review-header-actions {
        max-width: 124px;
    }
}

/* 2026-05-08: compact AI polish modeled on chat/actions/review competitor flows. */
.rte-panel-aiassist rte-dialog-inner {
    width: min(580px, calc(100vw - 28px)) !important;
    max-width: 580px !important;
    max-height: min(560px, calc(100vh - 72px)) !important;
    overflow: auto !important;
}

.rte-panel-aiassist .demo-ai-dialog-grid {
    gap: 6px;
    padding: 4px 0 0;
}

.rte-panel-aiassist .rte-ai-hero.is-dialog {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 10px;
    border-radius: 16px;
}

.rte-panel-aiassist .rte-ai-hero.is-dialog .rte-ai-hero-media {
    height: 54px;
    border-radius: 14px;
}

.rte-panel-aiassist .rte-ai-hero.is-dialog .rte-ai-hero-title {
    font-size: 13px;
}

.rte-panel-aiassist .rte-ai-hero.is-dialog .rte-ai-hero-copy,
.richtexteditor .rte-ai-chat-panel .rte-ai-hero-copy {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.rte-panel-aiassist .demo-ai-dialog-note {
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    line-height: 1.35;
}

.rte-panel-aiassist .demo-ai-dialog-meta {
    gap: 5px;
}

.rte-panel-aiassist .demo-ai-compact-controls {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 1.05fr) max-content;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 10px;
}

.rte-panel-aiassist .demo-ai-compact-controls.is-no-language {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) max-content;
}

.rte-panel-aiassist .demo-ai-scope-row,
.rte-panel-aiassist .demo-ai-run-row {
    flex-wrap: nowrap;
}

.rte-panel-aiassist .demo-ai-scope-row button,
.rte-panel-aiassist .demo-ai-run-row button {
    white-space: nowrap;
    flex: 1 1 auto;
    flex-basis: 0;
}

.rte-panel-aiassist .demo-ai-field {
    gap: 4px;
}

.rte-panel-aiassist .demo-ai-dialog-grid select,
.rte-panel-aiassist .demo-ai-dialog-grid textarea {
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 12px;
}

.rte-panel-aiassist .demo-ai-mode-help {
    font-size: 10.5px;
    line-height: 1.3;
}

.rte-panel-aiassist .demo-actions-row {
    gap: 6px;
}

.rte-panel-aiassist .demo-actions-row button {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11.5px;
}

.rte-panel-aiassist .demo-ai-scope-row button,
.rte-panel-aiassist .demo-ai-run-row button {
    min-height: 28px;
}

.rte-panel-aiassist .demo-ai-text-grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 6px;
}

.rte-panel-aiassist .demo-ai-source-field textarea,
.rte-panel-aiassist .demo-ai-result-field textarea {
    min-height: 88px;
}

.rte-panel-aiassist .demo-ai-review-grid,
.rte-panel-aiassist .demo-ai-insight-grid {
    gap: 6px;
}

.rte-panel-aiassist .demo-ai-review-card,
.rte-panel-aiassist .demo-ai-reason-panel,
.rte-panel-aiassist .demo-ai-plan-panel {
    padding: 6px 9px;
    border-radius: 8px;
}

.rte-panel-aiassist .demo-ai-review-card strong {
    margin-bottom: 4px;
    font-size: 10.5px;
}

.rte-panel-aiassist .demo-ai-review-text {
    max-height: 78px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.4;
}

.rte-panel-aiassist .demo-ai-plan-note,
.rte-panel-aiassist .demo-ai-plan-summary {
    display: none;
}

.rte-panel-aiassist .demo-ai-plan-list {
    max-height: 96px;
}

.rte-panel-aiassist .demo-ai-plan-item {
    padding: 6px 8px;
}

.rte-panel-aiassist .demo-ai-apply-row {
    margin: 0;
    padding: 6px 0 0;
    border-top: 1px solid rgba(28, 42, 59, 0.08);
}

.rte-panel-aiassist .demo-ai-apply-row button {
    flex: 1 1 92px;
}

.rte-panel-aiassist .demo-ai-apply-row .is-primary {
    flex-basis: 116px;
}

.rte-panel-aiassist-menu {
    width: min(500px, calc(100vw - 24px));
    max-height: min(390px, calc(100vh - 92px));
}

.rte-panel-aiassist-menu .rte-ai-menu-copy {
    margin-top: 4px;
    font-size: 11.5px;
}

.rte-panel-aiassist-menu .rte-ai-menu-section {
    margin: 8px 0 4px;
}

.rte-panel-aiassist-menu .rte-ai-menu-item {
    min-height: 46px;
    padding: 8px;
}

.rte-panel-aiassist-menu .rte-ai-menu-item-copy {
    -webkit-line-clamp: 1;
}

.richtexteditor .rte-ai-chat-panel {
    width: min(390px, calc(100vw - 24px));
    gap: 8px;
    padding: 10px;
}

.richtexteditor .rte-ai-chat-panel .rte-ai-hero {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 9px;
    padding: 8px;
    border-radius: 15px;
}

.richtexteditor .rte-ai-chat-panel .rte-ai-hero-media {
    height: 48px;
    border-radius: 13px;
}

.richtexteditor .rte-ai-chat-panel .rte-ai-chat-context-shell,
.richtexteditor .rte-ai-chat-panel .rte-ai-chat-quick-shell,
.richtexteditor .rte-ai-chat-panel .rte-ai-chat-input-shell {
    padding: 9px;
    border-radius: 14px;
}

.richtexteditor .rte-ai-chat-panel .rte-ai-chat-context-shell {
    min-height: 64px;
    padding-left: 74px !important;
}

.richtexteditor .rte-ai-chat-panel .rte-ai-chat-context-photo {
    top: 11px;
    left: 11px;
    width: 50px;
    height: 44px;
}

.richtexteditor .rte-ai-chat-panel .rte-ai-chat-input {
    min-height: 64px;
}

.richtexteditor .rte-ai-review-panel {
    width: min(560px, calc(100vw - 24px));
    gap: 8px;
    padding: 10px;
}

.richtexteditor .rte-ai-review-overview,
.richtexteditor .rte-ai-review-navigation,
.richtexteditor .rte-ai-review-controls {
    padding: 8px;
}

.richtexteditor .rte-ai-review-content {
    min-height: 120px;
    padding: 8px;
}

@media (max-width: 620px) {
    .rte-panel-aiassist .demo-ai-compact-controls,
    .rte-panel-aiassist .demo-ai-text-grid,
    .rte-panel-aiassist .demo-ai-review-grid {
        grid-template-columns: 1fr;
    }

    .rte-panel-aiassist .rte-ai-hero.is-dialog {
        grid-template-columns: 1fr;
    }
}

/* ===========================================================================
 * 2026-05-08 AI Chat redesign — minimal layout
 *
 * The earlier panel was "everything in a card": eyebrow pill row, subtitle
 * paragraph, header-meta pill row, decorative hero, context preview card,
 * context summary pill row, quick-start summary, "Conversation" section
 * label, feed-intro card, empty-state capability grid, per-message scope/
 * type/turn pills, state card, prompt card, context card, request card —
 * stacked one on top of the other inside a 390 px panel.
 *
 * Two consecutive screenshot reports came back as "hard to use, hard to
 * understand. please redesign it." The renderer now skips most of those
 * subsections; this stylesheet block makes the surviving pieces look like
 * one clean chat surface (header, scope toggle, chips, conversation,
 * composer) instead of a stack of dense cards.
 *
 * Adding overrides at the end of the file rather than editing the older
 * rules in place lets us keep the historic state-card/preview-card styling
 * intact for the few code paths that still render those nodes (e.g. when
 * customers re-enable the legacy renderer via the `false &&` guards).
 * ======================================================================= */

.richtexteditor .rte-ai-chat-panel {
    /* 2026-05-08: bumped panel padding 10 -> 16 px and section gap 8 -> 14 px
       after a "header looks cramped" report. The earlier minimal-skin used a
       single 10 px outer padding which left the title icon and the New chat /
       × buttons sitting flush against the panel edges. */
    padding: 16px !important;
    gap: 14px !important;
    border-radius: 14px;
}

/* Minimal header: icon + title + actions row, nothing else. Padding bumped
   from 0/0/10 to 4/4/14 so the title doesn't crowd the icon and the action
   buttons get a little air on the right edge before the divider line. */
.richtexteditor .rte-ai-chat-header.is-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 14px;
    border-bottom: 1px solid rgba(20, 36, 58, 0.08);
}

.richtexteditor .rte-ai-chat-header.is-minimal .rte-ai-chat-header-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.richtexteditor .rte-ai-chat-header.is-minimal .rte-ai-chat-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.richtexteditor .rte-ai-chat-header.is-minimal .rte-ai-chat-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: #1b2a3d;
    margin: 0;
}

.richtexteditor .rte-ai-chat-header.is-minimal .rte-ai-chat-title-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
}

.richtexteditor .rte-ai-chat-header.is-minimal .rte-ai-chat-title-icon svg {
    width: 22px;
    height: 22px;
}

.richtexteditor .rte-ai-chat-header.is-minimal .rte-ai-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-chat-header.is-minimal .rte-ai-chat-header-button {
    min-height: 30px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Compact scope toggle (Selection | Document) — no preview, no summary */
.richtexteditor .rte-ai-chat-context-shell.is-minimal {
    padding: 2px 4px 0;
    min-height: 0;
}

.richtexteditor .rte-ai-chat-context-shell.is-minimal .rte-ai-chat-context-bar {
    margin: 0;
    padding: 3px;
    display: inline-flex;
    border-radius: 12px;
    background: rgba(225, 234, 245, 0.45);
    border: 1px solid rgba(20, 36, 58, 0.06);
}

.richtexteditor .rte-ai-chat-context-shell.is-minimal .rte-ai-chat-scope-button {
    min-height: 28px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #4b5b6e;
}

.richtexteditor .rte-ai-chat-context-shell.is-minimal .rte-ai-chat-scope-button.is-active {
    background: #ffffff;
    color: #1559d6;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Quick-start chips — pill buttons in a tight row */
.richtexteditor .rte-ai-chat-quick-shell.is-minimal {
    padding: 0 4px;
}

.richtexteditor .rte-ai-chat-quick-shell.is-minimal .rte-ai-chat-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
}

/* 2026-05-08: chips re-rendered as huge ovals because the older
   `.rte-ai-chat-quick-row > .rte-ai-chat-quick-button` rule sets
   `min-height: 116px` and `display: grid`, while the row's
   `grid-template-columns: repeat(auto-fit, minmax(146px, 1fr))` stretched
   each chip cell to ~140px wide. min-height was not being reset by the
   chip rule (only height was set), so `height: 28px` lost to the inherited
   `min-height: 116px`. Bumping these to !important guarantees the chip
   wins regardless of which rule comes first or who imports the stylesheet.
   The row's grid-template-columns is also overridden by the .is-minimal
   shell's flex-wrap, but adding the `min-height: 0` reset here means even
   if a customer loses the .is-minimal class, chips still render correctly. */
.richtexteditor .rte-ai-chat-quick-button.is-chip,
.richtexteditor .rte-ai-chat-quick-row > .rte-ai-chat-quick-button.is-chip {
    display: inline-flex !important;
    align-items: center !important;
    justify-items: initial !important;
    align-content: initial !important;
    width: auto !important;
    height: 28px !important;
    min-height: 0 !important;
    gap: 0 !important;
    padding: 0 12px !important;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    border-radius: 999px !important;
    background: #f3f6fb !important;
    border: 1px solid rgba(20, 36, 58, 0.08) !important;
    color: #2a3a4e;
    box-shadow: none !important;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
}

.richtexteditor .rte-ai-chat-quick-button.is-chip:hover,
.richtexteditor .rte-ai-chat-quick-row > .rte-ai-chat-quick-button.is-chip:hover {
    background: #e9eff8 !important;
    border-color: rgba(21, 89, 214, 0.22) !important;
}

.richtexteditor .rte-ai-chat-quick-button.is-chip.is-active,
.richtexteditor .rte-ai-chat-quick-row > .rte-ai-chat-quick-button.is-chip.is-active {
    background: #e3edff !important;
    border-color: rgba(21, 89, 214, 0.45) !important;
    color: #1559d6 !important;
}

/* Empty conversation state — single title + single hint, no pills, no cards */
.richtexteditor .rte-ai-chat-feed-shell.is-minimal {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.richtexteditor .rte-ai-chat-empty.is-minimal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 16px;
    text-align: center;
    color: #5d7388;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.richtexteditor .rte-ai-chat-empty.is-minimal .rte-ai-chat-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: #1b2a3d;
}

.richtexteditor .rte-ai-chat-empty.is-minimal .rte-ai-chat-empty-detail {
    font-size: 12px;
    color: #5d7388;
    line-height: 1.45;
    max-width: 320px;
}

/* 2026-05-08: hero illustration + per-message avatar glyphs. The user said
   the post-redesign panel "looked too plain", so we add a friendly inline
   SVG above the empty-state title and small avatar circles next to each
   message role label. SVG markup lives in aitoolkit.js (no external
   network requests). */
.richtexteditor .rte-ai-chat-empty-art {
    display: block;
    width: 160px;
    height: 110px;
    margin: 0 auto 8px;
    user-select: none;
    pointer-events: none;
}

.richtexteditor .rte-ai-chat-empty-art svg {
    width: 100%;
    height: 100%;
    display: block;
}

.richtexteditor .rte-ai-chat-message-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    flex: 0 0 22px;
    background: #eef2f7;
    color: #5d7388;
    margin-right: 6px;
}

.richtexteditor .rte-ai-chat-message-avatar svg {
    width: 14px;
    height: 14px;
}

.richtexteditor .rte-ai-chat-message-avatar.is-user {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1559d6;
}

.richtexteditor .rte-ai-chat-message-avatar.is-assistant {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #0f766e;
}

.richtexteditor .rte-ai-chat-message-avatar.is-error {
    background: #fee2e2;
    color: #c24141;
}

/* Per-message minimal layout */
.richtexteditor .rte-ai-chat-message.is-minimal {
    padding: 10px 12px;
    margin: 6px 0;
    gap: 4px;
    border-radius: 12px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: #ffffff;
    display: block;
}

.richtexteditor .rte-ai-chat-message.is-minimal.is-user {
    background: #f5f8fd;
}

.richtexteditor .rte-ai-chat-message.is-minimal.is-error {
    background: #fdf3f3;
    border-color: rgba(194, 65, 65, 0.25);
}

.richtexteditor .rte-ai-chat-message.is-minimal .rte-ai-chat-message-header.is-minimal {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.richtexteditor .rte-ai-chat-message.is-minimal .rte-ai-chat-message-role {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5d7388;
    background: transparent;
    padding: 0;
}

.richtexteditor .rte-ai-chat-message.is-minimal.is-user .rte-ai-chat-message-role {
    color: #1559d6;
}

.richtexteditor .rte-ai-chat-message.is-minimal.is-assistant .rte-ai-chat-message-role {
    color: #0f766e;
}

.richtexteditor .rte-ai-chat-message.is-minimal .rte-ai-chat-message-text {
    font-size: 13px;
    line-height: 1.5;
    color: #23384d;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===========================================================================
 * 2026-05-08 AI Review redesign — minimal layout (CSS-only)
 *
 * Same disease as the AI Chat panel: section labels ("QUEUE OVERVIEW",
 * "FILTER AND BATCH", "KEYBOARD LANE", "RECOVERY AND NEXT QUEUES",
 * "ACTIONS"), eyebrow status pills ("REVIEW WORKSPACE", "NO SUGGESTIONS"),
 * a header-meta pill row ("Queue complete"), an overview hero with status
 * pills + title + paragraph + 0 % progress bar, three stat boxes
 * (`0 pending`, `0 accepted`, `0 rejected`), and an "Press Enter to AI
 * Chat. Tab for more actions." hint card.
 *
 * Renderer kept intact — sync logic still updates these nodes — but they
 * are visually hidden so the panel reads as: title + close + scope toggle
 * + filter buttons + queue list + main action.
 * ======================================================================= */

/* Hide noisy review-panel chrome (everything that isn't the title, the
   filter row, the queue list, or a primary action button). */
.richtexteditor .rte-ai-review-header-eyebrow,
.richtexteditor .rte-ai-review-header-meta,
.richtexteditor .rte-ai-review-subtitle,
.richtexteditor .rte-ai-review-section-label,
.richtexteditor .rte-ai-review-overview-status-row,
.richtexteditor .rte-ai-review-overview-detail,
.richtexteditor .rte-ai-review-overview-progress,
.richtexteditor .rte-ai-review-summary,
.richtexteditor .rte-ai-review-empty-status-row,
.richtexteditor .rte-ai-review-empty-hint,
.richtexteditor .rte-ai-review-empty-undo-history,
.richtexteditor .rte-ai-review-summary-detail,
.richtexteditor .rte-ai-review-summary-history,
.richtexteditor .rte-ai-review-empty-undo-detail,
.richtexteditor .rte-ai-review-control-group-label,
.richtexteditor .rte-ai-review-empty-preview-meta,
.richtexteditor .rte-ai-review-shortcuts,
/* 2026-05-08: hide auxiliary header button groups. The "Sync now",
   "Newest shared", "Locate current" (CONTEXT group), "Previous", "Next
   pending" (Navigate group), and "Undo last", "Redo last" (Recover
   group) were rendering as a row of pill-buttons crowded next to the
   close X. The CONTEXT group in particular kept landing outside the
   panel's right edge in the screenshots. Auto-sync still runs in the
   background; locate/navigate/undo are all reachable via keyboard and
   per-item buttons, so the header copy stays clean with just the title
   + close button. */
.richtexteditor .rte-ai-review-header-group.is-context,
.richtexteditor .rte-ai-review-header-group.is-move,
.richtexteditor .rte-ai-review-header-group.is-recover,
/* 2026-05-08: hide the secondary chrome that survived the first pass:
   - .rte-ai-review-control-group::before is the QUEUE SCOPE / VISIBILITY /
     BATCH REVIEW eyebrow text rendered via attr() — content: none kills it.
   - .rte-ai-review-type-chips holds the redundant "All types (0)" pill
     duplicating the dropdown above it.
   - .rte-ai-review-feed-section-detail is the verbose subtitle paragraph
     under "RESOLVED ITEMS" / "PENDING ITEMS" headers.
   - .rte-ai-review-header-group-label is the "CONTEXT" / "Navigate" /
     "Recover" button-group eyebrow, whose buttons explain themselves.
   - .rte-ai-review-sync-badge is the green "LIVE" pill next to the title. */
.richtexteditor .rte-ai-review-type-chips,
.richtexteditor .rte-ai-review-feed-section-detail,
.richtexteditor .rte-ai-review-header-group-label,
.richtexteditor .rte-ai-review-sync-badge {
    display: none !important;
}

/* Strip the ::before pseudo-element that renders the QUEUE SCOPE etc. eyebrow
   (it uses attr(data-rte-ai-review-group-label) so a `display: none` on the
   element doesn't help — we have to override the content). */
.richtexteditor .rte-ai-review-control-group::before {
    content: none !important;
}

/* Flatten the group cards' tinted gradient backgrounds so QUEUE SCOPE,
   VISIBILITY, BATCH REVIEW don't read as three separate pill-cards. They now
   sit as a single horizontal control row. */
.richtexteditor .rte-ai-review-control-group,
.richtexteditor .rte-ai-review-control-group.is-scope,
.richtexteditor .rte-ai-review-control-group.is-visibility,
.richtexteditor .rte-ai-review-control-group.is-batch {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* 2026-05-08: ensure the review content area scrolls cleanly inside the
   fixed-height panel. Previously the panel had `overflow: hidden` and the
   content section had its own padding/border, so items at the bottom of the
   feed got clipped instead of being scrolled into view. */
.richtexteditor .rte-ai-review-content {
    flex: 1 1 auto;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.richtexteditor .rte-ai-review-feed {
    overflow: visible !important;
    padding: 0 !important;
}

/* Tighten the feed-section header (the "RESOLVED ITEMS · 2 ITEMS" row). */
.richtexteditor .rte-ai-review-feed-section {
    margin-top: 8px;
    padding: 6px 4px;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(2px);
}

.richtexteditor .rte-ai-review-feed-section-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7f94;
}

.richtexteditor .rte-ai-review-feed-section-pill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7f94;
    background: transparent;
    border: 0;
    padding: 0;
}

/* Flatten the empty-state recovery / next-queue / utility zones — keep the
   action buttons visible, drop the framing chrome (extra padding, border,
   gradient backgrounds) so the panel looks calm instead of card-stacked. */
.richtexteditor .rte-ai-review-empty-zone {
    padding: 0 !important;
    margin: 6px 0 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Tighten the overview hero (remaining title only). Now styled like a small
   inline notice: blue dot + sentence, no card chrome. */
.richtexteditor .rte-ai-review-overview {
    padding: 8px 10px;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.6) 0%, rgba(243, 244, 246, 0) 100%);
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    margin-bottom: 4px;
}

.richtexteditor .rte-ai-review-overview-hero {
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.richtexteditor .rte-ai-review-overview-title {
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

/* Decorative dot on the left of the status sentence */
.richtexteditor .rte-ai-review-overview-hero::before {
    content: "";
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #1559d6;
    box-shadow: 0 0 0 3px rgba(21, 89, 214, 0.15);
}

/* Tighten the navigation block (filter + batch + keyboard). The previous
   build wrapped this in a pill-card; now it sits flush in the panel as a
   single row of controls. */
.richtexteditor .rte-ai-review-navigation {
    padding: 4px 0 8px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(20, 36, 58, 0.06);
    margin-bottom: 6px;
}

.richtexteditor .rte-ai-review-controls {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px !important;
    align-items: center !important;
}

.richtexteditor .rte-ai-review-control-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.richtexteditor .rte-ai-review-control-group-body {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* Refine the type-filter dropdown so it visually matches the Show resolved /
   Accept all / Reject all buttons next to it (same height, same border, same
   border-radius). */
.richtexteditor .rte-ai-review-controls .rte-ai-review-filter-select,
.richtexteditor .rte-ai-review-control-group .rte-ai-review-filter-select {
    min-height: 30px !important;
    height: 30px;
    padding: 0 24px 0 10px !important;
    min-width: 120px !important;
    border: 1px solid rgba(20, 36, 58, 0.12) !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    color: #1f2937 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer;
}

/* Show resolved / Accept all / Reject all buttons — match the dropdown */
.richtexteditor .rte-ai-review-controls .rte-ai-review-control-button,
.richtexteditor .rte-ai-review-control-group .rte-ai-review-control-button {
    min-height: 30px !important;
    height: 30px;
    padding: 0 12px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.richtexteditor .rte-ai-review-controls .rte-ai-review-control-button.is-accept-batch:not([disabled]) {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: rgba(22, 101, 52, 0.18) !important;
}

.richtexteditor .rte-ai-review-controls .rte-ai-review-control-button.is-reject-batch:not([disabled]) {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border-color: rgba(153, 27, 27, 0.18) !important;
}

.richtexteditor .rte-ai-review-control-group-label {
    display: none;
}

/* Empty-state card — let it breathe into the wider panel */
.richtexteditor .rte-ai-review-empty {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(20, 36, 58, 0.06);
    background: #fafbfd;
    box-shadow: none;
}

.richtexteditor .rte-ai-review-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: #1b2a3d;
    margin-bottom: 4px;
}

.richtexteditor .rte-ai-review-empty-detail {
    font-size: 12px;
    color: #5d7388;
    line-height: 1.45;
}

.richtexteditor .rte-ai-review-empty-hero {
    padding: 0;
    margin-bottom: 8px;
}

/* 2026-05-08: AI Review header polish — give the bot icon a subtle blue
   gradient backdrop, tighten the title, soften the close button. */
.richtexteditor .rte-ai-review-header {
    padding: 0 0 12px !important;
    border-bottom: 1px solid rgba(20, 36, 58, 0.08);
    margin-bottom: 8px;
    align-items: center;
}

.richtexteditor .rte-ai-review-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #dbeafe 0%, #ddd6fe 100%);
    color: #1559d6;
    margin-right: 4px;
}

.richtexteditor .rte-ai-review-title-icon svg {
    width: 18px;
    height: 18px;
}

.richtexteditor .rte-ai-review-title-row {
    gap: 8px !important;
    align-items: center;
}

.richtexteditor .rte-ai-review-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1b2a3d !important;
    letter-spacing: -0.005em;
}

.richtexteditor .rte-ai-panel-close-button.is-review-close {
    min-width: 30px !important;
    min-height: 30px !important;
    width: 30px;
    height: 30px;
    border-radius: 8px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    color: #64748b;
    transition: background 120ms ease, border-color 120ms ease;
}

.richtexteditor .rte-ai-panel-close-button.is-review-close:hover {
    background: #f1f5f9 !important;
    border-color: rgba(20, 36, 58, 0.1) !important;
}

/* 2026-05-08: distinguish the active (expanded) review item with a
   blue-tinted border + soft shadow so it stands out from the surrounding
   condensed rows. The expanded item shows the full state card, before /
   after compare, and decision buttons — it deserves the visual weight. */
.richtexteditor .rte-ai-review-item.is-active {
    border: 1px solid rgba(21, 89, 214, 0.22) !important;
    border-left: 3px solid #1559d6 !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, #fafcff 0%, #f4f7fc 100%) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
    margin: 4px 0 !important;
    padding: 14px !important;
}

/* Polish the empty-state card when the queue is truly empty (no resolved,
   no pending). The "Review queue complete" / "Ask AI to create a queue."
   states get a gentle gradient background + extra breathing room. */
.richtexteditor .rte-ai-review-empty {
    padding: 20px 16px !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #f8fbff 0%, #f0f4f9 100%) !important;
    border: 1px solid rgba(20, 36, 58, 0.06) !important;
    box-shadow: none !important;
    text-align: center;
}

.richtexteditor .rte-ai-review-empty .rte-ai-review-empty-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1b2a3d !important;
    margin: 0 0 4px !important;
}

.richtexteditor .rte-ai-review-empty .rte-ai-review-empty-detail {
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.5;
    max-width: 340px;
    margin: 0 auto;
}

/* Tiny illustrated check-mark above the truly-empty title via ::before.
   Uses CSS only so the JS renderer doesn't need to know about it. */
.richtexteditor .rte-ai-review-empty.is-queue-complete::before {
    content: "";
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    background-image:
        linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-size: 100% 100%, 24px 24px;
    background-position: center, center;
    background-repeat: no-repeat;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.18);
}

/* Trim the "ACTIONS / MORE / AI Chat" footer block */
.richtexteditor .rte-ai-review-empty-zone.is-utility {
    padding: 0;
}

.richtexteditor .rte-ai-review-empty-zone-label {
    display: none;
}

/* ===========================================================================
 * 2026-05-08 Ask AI dialog — declutter bottom + reposition closer to toolbar
 *
 * User feedback was "top area has space, bottom is crowdy" and "the dialog
 * position is too far from the button".
 *
 * - apply-guidance card hidden: the recommended button below already glows
 *   blue from the existing data-rte-ai-dialog-recommended highlight, so the
 *   "SUGGESTED NEXT STEP - Generate" card was double-signalling the same
 *   recommendation while crowding the Details toggle and WHY/PLAN cards.
 *
 * - rte-dialog-outer flex centering switched to top-anchor when its inner
 *   has the .rte-panel-aiassist class. The toolbar sits near the top of the
 *   page, so dropping the dialog 72 px from the top of the viewport puts it
 *   right under the toolbar instead of vertically centered halfway down.
 * ======================================================================= */

.rte-panel-aiassist .demo-ai-apply-guidance {
    display: none !important;
}

rte-dialog-outer:has(.rte-panel-aiassist),
rte-dialog-outer.rte-dialog-aiassist {
    align-items: flex-start;
    padding-top: 72px;
}

@media (max-width: 900px) {
    rte-dialog-outer:has(.rte-panel-aiassist),
    rte-dialog-outer.rte-dialog-aiassist {
        padding-top: 48px;
    }
}

/* ===========================================================================
 * 2026-05-08 Ask AI dialog — compact + clearer pass
 *
 * Goals: easier to scan, less visual chrome, smaller footprint without
 * sacrificing readability. Source-of-truth styles still live above; this
 * block only overrides what the redesign needs.
 *
 * - Compact-controls card border / shadow / inset removed: it created a
 *   "card inside a dialog" look that competed with the dialog frame for
 *   attention. The fields below now sit flat on the dialog surface.
 * - Field labels switched from 9px UPPERCASE / 0.05em tracking to 10.5px
 *   sentence case so they're legible without leaning forward.
 * - "Use" buttons fused into a real segmented toggle (shared border,
 *   no inter-button gap) so it's visually obvious they're an either/or
 *   scope picker rather than two independent actions. Active scope is
 *   filled via the existing aria-pressed="true" already set in JS.
 * - Run row: Generate keeps its primary fill; Copy demoted to a flat
 *   pill so the eye lands on Generate first.
 * - Apply row: Discard pinned to the right and de-emphasized so the
 *   destructive option doesn't sit shoulder-to-shoulder with apply.
 * - Status line trimmed in size; the highlighted recommended button
 *   already carries the "what to do next" signal.
 * ======================================================================= */

.rte-panel-aiassist rte-dialog-header {
    padding: 10px 14px;
}

.rte-panel-aiassist rte-dialog-header-text {
    font-size: 14px;
}

.rte-panel-aiassist rte-dialog-header-close {
    top: 9px;
    right: 9px;
}

.rte-panel-aiassist rte-dialog-inner {
    width: min(560px, calc(100vw - 36px)) !important;
    max-width: 560px !important;
}

.rte-panel-aiassist .demo-ai-dialog-grid {
    gap: 8px;
    padding: 8px 4px 4px;
}

.rte-panel-aiassist .demo-ai-compact-controls {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    gap: 4px 10px;
}

.rte-panel-aiassist .demo-ai-dialog-grid label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #475569;
    min-height: 13px;
}

.rte-panel-aiassist .demo-ai-mode-help {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.35;
    margin-top: 1px;
}

/* Segmented "Use" picker — Selection | Document share borders. */
.rte-panel-aiassist .demo-ai-scope-row {
    gap: 0;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid rgba(28, 42, 59, 0.18);
    background: #ffffff;
}

.rte-panel-aiassist .demo-ai-scope-row button {
    flex: 1 1 0;
    border-radius: 0;
    border: 0;
    border-left: 1px solid rgba(28, 42, 59, 0.14);
    background: transparent;
    color: #475569;
    font-weight: 600;
    box-shadow: none;
}

.rte-panel-aiassist .demo-ai-scope-row button:first-child {
    border-left: 0;
}

.rte-panel-aiassist .demo-ai-scope-row button:hover:not([disabled]) {
    background: #f1f5f9;
    border-color: rgba(28, 42, 59, 0.14);
}

.rte-panel-aiassist .demo-ai-scope-row button[aria-pressed="true"] {
    background: linear-gradient(180deg, #2873e8 0%, #1559d6 100%);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.rte-panel-aiassist .demo-ai-scope-row button[aria-pressed="true"]:hover:not([disabled]) {
    background: linear-gradient(180deg, #3b80ee 0%, #1a63e0 100%);
}

/* Suppress the recommended-action blue glow on the segmented toggle —
   the aria-pressed fill already shows what's active there. */
.rte-panel-aiassist .demo-ai-scope-row button[data-rte-ai-dialog-recommended="true"] {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(28, 42, 59, 0.14);
}

/* Run row: Generate prominent, Copy quiet. */
.rte-panel-aiassist .demo-ai-run-row {
    gap: 6px;
}

.rte-panel-aiassist .demo-ai-run-row .is-primary {
    flex: 2 1 0;
}

.rte-panel-aiassist .demo-ai-run-row button:not(.is-primary) {
    flex: 1 1 0;
    background: transparent;
    border-color: rgba(28, 42, 59, 0.16);
    color: #475569;
    box-shadow: none;
}

/* Apply row: Discard pinned right and de-emphasized. */
.rte-panel-aiassist .demo-ai-apply-row {
    border-top: 1px dashed rgba(28, 42, 59, 0.1);
    padding-top: 7px;
    margin-top: 1px;
    gap: 6px;
    align-items: center;
}

.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="reject"] {
    margin-left: auto;
    flex: 0 0 auto;
    background: transparent;
    border-color: transparent;
    color: #94a3b8;
    box-shadow: none;
    font-weight: 500;
}

.rte-panel-aiassist .demo-ai-apply-row [data-rte-ai-dialog-action="reject"]:hover:not([disabled]) {
    background: #f1f5f9;
    border-color: rgba(28, 42, 59, 0.14);
    color: #1f2937;
}

/* Status line — keep informative but visually quieter. */
.rte-panel-aiassist .demo-ai-dialog-status {
    font-size: 11px;
    color: #6b7280;
    min-height: 0;
    padding: 0 2px;
}

/* Source / result panels: tighter, with grouped border so each pane
   reads as one card instead of label-floating-above-textarea. */
.rte-panel-aiassist .demo-ai-text-grid {
    gap: 8px;
}

.rte-panel-aiassist .demo-ai-source-field textarea,
.rte-panel-aiassist .demo-ai-result-field textarea {
    min-height: 76px;
    line-height: 1.4;
}

.rte-panel-aiassist .demo-ai-result-field textarea[readonly] {
    background: #f8fafc;
}

/* Details toggle: align with the other quiet text below the apply row. */
.rte-panel-aiassist .demo-ai-details-toggle,
.demo-ai-details-toggle,
button.demo-ai-details-toggle {
    margin-top: 0;
    padding: 3px 10px;
    font-size: 10.5px;
    color: #6b7280;
    border-color: transparent;
}

.rte-panel-aiassist .demo-ai-details-toggle:hover:not([disabled]),
.demo-ai-details-toggle:hover:not([disabled]) {
    background: #f1f5f9;
    border-color: rgba(28, 42, 59, 0.14);
    color: #1f2937;
}

/* ===========================================================================
 * 2026-05-08 AI Review compact pass — every dimension tightened ~20-30 %
 * after a "make it more compact" report. The previous polish round had
 * each row ~64 px tall with 14 px outer padding (~5 visible rows in a
 * 480 px-tall panel). After this pass it's ~44 px / row, fitting ~7-8
 * visible rows in the same panel height.
 *
 * Numeric overrides only — none of the typography / colour decisions are
 * touched, so the panel still reads as the same product, just denser.
 * Appended at file-end so these rules win the cascade against the earlier
 * polish blocks regardless of selector specificity.
 * ======================================================================= */

.richtexteditor .rte-ai-review-panel {
    padding: 10px !important;
    gap: 4px !important;
    width: min(480px, calc(100vw - 24px)) !important;
}

.richtexteditor .rte-ai-review-header {
    padding: 0 0 8px !important;
    margin-bottom: 6px !important;
}

.richtexteditor .rte-ai-review-title-icon {
    width: 24px !important;
    height: 24px !important;
    border-radius: 7px !important;
}

.richtexteditor .rte-ai-review-title-icon svg {
    width: 15px !important;
    height: 15px !important;
}

.richtexteditor .rte-ai-review-title {
    font-size: 14px !important;
}

.richtexteditor .rte-ai-panel-close-button.is-review-close {
    min-width: 26px !important;
    min-height: 26px !important;
    width: 26px;
    height: 26px;
}

.richtexteditor .rte-ai-review-overview {
    padding: 5px 8px !important;
    margin-bottom: 4px !important;
}

.richtexteditor .rte-ai-review-overview-title {
    font-size: 11.5px !important;
}

.richtexteditor .rte-ai-review-overview-hero::before {
    width: 5px !important;
    height: 5px !important;
    flex-basis: 5px !important;
    box-shadow: 0 0 0 2px rgba(21, 89, 214, 0.15) !important;
}

.richtexteditor .rte-ai-review-navigation {
    padding: 2px 0 6px !important;
    margin-bottom: 4px !important;
}

.richtexteditor .rte-ai-review-controls {
    gap: 4px !important;
}

.richtexteditor .rte-ai-review-control-group,
.richtexteditor .rte-ai-review-control-group-body {
    gap: 4px !important;
}

.richtexteditor .rte-ai-review-controls .rte-ai-review-filter-select,
.richtexteditor .rte-ai-review-control-group .rte-ai-review-filter-select {
    min-height: 26px !important;
    height: 26px !important;
    padding: 0 22px 0 8px !important;
    min-width: 100px !important;
    font-size: 11.5px !important;
}

.richtexteditor .rte-ai-review-controls .rte-ai-review-control-button,
.richtexteditor .rte-ai-review-control-group .rte-ai-review-control-button {
    min-height: 26px !important;
    height: 26px !important;
    padding: 0 10px !important;
    font-size: 11.5px !important;
}

/* Tight item rows — ~44 px tall instead of ~64 px */
.richtexteditor .rte-ai-review-item.is-condensed {
    padding: 6px 10px 7px 12px !important;
    gap: 3px !important;
    margin: 0 0 4px !important;
    border-radius: 7px !important;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-title {
    font-size: 12px !important;
    line-height: 1.35 !important;
    margin: 2px 0 0 !important;
    -webkit-line-clamp: 1 !important;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-meta {
    gap: 5px !important;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status {
    font-size: 9px !important;
    padding: 1px 5px 1px 4px !important;
    gap: 2px !important;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status::before {
    font-size: 10px !important;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-status.is-pending::before {
    font-size: 12px !important;
}

.richtexteditor .rte-ai-review-item.is-condensed .rte-ai-review-item-stamp {
    font-size: 9px !important;
}

.richtexteditor .rte-ai-review-feed-section {
    margin-top: 4px !important;
    padding: 4px 4px !important;
}

.richtexteditor .rte-ai-review-feed-section-title {
    font-size: 10px !important;
}

.richtexteditor .rte-ai-review-feed-section-pill {
    font-size: 9px !important;
}

/* Compact empty state — same celebration check, just smaller frame */
.richtexteditor .rte-ai-review-empty {
    padding: 14px 12px !important;
}

.richtexteditor .rte-ai-review-empty .rte-ai-review-empty-title {
    font-size: 13px !important;
    margin: 0 0 2px !important;
}

.richtexteditor .rte-ai-review-empty .rte-ai-review-empty-detail {
    font-size: 11.5px !important;
}

.richtexteditor .rte-ai-review-empty.is-queue-complete::before {
    width: 38px !important;
    height: 38px !important;
    margin: 0 auto 8px !important;
    background-size: 100% 100%, 20px 20px !important;
}

/* Active (expanded) item — tighten without losing its emphasis */
.richtexteditor .rte-ai-review-item.is-active {
    padding: 10px 12px !important;
    margin: 3px 0 !important;
    border-radius: 8px !important;
}

/* ===========================================================================
 * 2026-05-08 AI Review V2 redesign — clean from-scratch styles for the
 * `.rte-ai-review-v2` panel rendered by renderReviewPanelV2 in
 * aitoolkit.js. Independent of all the legacy `.rte-ai-review-*` rules so
 * we don't have to chase specificity wars across the file.
 * ======================================================================= */

.richtexteditor .rte-ai-review-panel.rte-ai-review-v2 {
    /* Width bumped from 480 to 600 px per the "improve width" report.
       Stays viewport-bound on small screens via the calc() fallback. */
    width: min(600px, calc(100vw - 24px)) !important;
    padding: 14px !important;
    gap: 10px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* ----- Header ----- */
.richtexteditor .rte-ai-review-v2-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(20, 36, 58, 0.08);
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-review-v2-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: linear-gradient(135deg, #dbeafe 0%, #ddd6fe 100%);
    color: #1559d6;
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-review-v2-icon svg {
    width: 16px;
    height: 16px;
}

.richtexteditor .rte-ai-review-v2-title {
    font-size: 14px;
    font-weight: 700;
    color: #1b2a3d;
    flex: 1 1 auto;
    min-width: 0;
}

.richtexteditor .rte-ai-review-v2-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #1559d6;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-review-v2-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: background 120ms ease, border-color 120ms ease;
}

.richtexteditor .rte-ai-review-v2-close:hover {
    background: #f1f5f9;
    border-color: rgba(20, 36, 58, 0.1);
}

.richtexteditor .rte-ai-review-v2-close:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(21, 89, 214, 0.45);
}

/* ----- Tab strip (Pending / Resolved) ----- */
.richtexteditor .rte-ai-review-v2-tabs {
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin: 0 -2px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 9px;
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-review-v2-tab {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
    font-family: inherit;
}

.richtexteditor .rte-ai-review-v2-tab:hover {
    color: #1f2937;
    background: rgba(255, 255, 255, 0.6);
}

.richtexteditor .rte-ai-review-v2-tab.is-active {
    background: #ffffff;
    color: #1559d6;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(20, 36, 58, 0.04);
}

.richtexteditor .rte-ai-review-v2-tab:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px #f1f5f9, 0 0 0 4px rgba(21, 89, 214, 0.45);
}

.richtexteditor .rte-ai-review-v2-tab-label {
    line-height: 1;
}

.richtexteditor .rte-ai-review-v2-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(20, 36, 58, 0.1);
    color: #64748b;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
}

.richtexteditor .rte-ai-review-v2-tab.is-active .rte-ai-review-v2-tab-count {
    background: #dbeafe;
    color: #1559d6;
}

/* The Pending tab's count badge runs blue when there's something to do —
   draws the eye to "you have N items to review". */
.richtexteditor .rte-ai-review-v2-tab[data-rte-ai-review-tab="pending"] .rte-ai-review-v2-tab-count.is-active {
    background: #1559d6;
    color: #ffffff;
}

.richtexteditor .rte-ai-review-v2-tab.is-active[data-rte-ai-review-tab="pending"] .rte-ai-review-v2-tab-count.is-active {
    background: #1559d6;
    color: #ffffff;
}

/* ----- Toolbar ----- */
.richtexteditor .rte-ai-review-v2-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(20, 36, 58, 0.06);
    flex: 0 0 auto;
}

.richtexteditor .rte-ai-review-v2-toolbar-spacer {
    flex: 1 1 auto;
    min-width: 8px;
}

/* When the toolbar is otherwise empty (only spacer + nothing else), don't
   render the divider line — looks like a stray rule. */
.richtexteditor .rte-ai-review-v2-toolbar:empty,
.richtexteditor .rte-ai-review-v2-toolbar:has(> :only-child.rte-ai-review-v2-toolbar-spacer) {
    display: none;
}

.richtexteditor .rte-ai-review-v2-select,
.richtexteditor .rte-ai-review-v2-toggle,
.richtexteditor .rte-ai-review-v2-batch {
    height: 30px;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(20, 36, 58, 0.14);
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
    font-family: inherit;
}

.richtexteditor .rte-ai-review-v2-select {
    min-width: 130px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 26px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1 6 7 11 1'/></svg>");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 9px 6px;
}

.richtexteditor .rte-ai-review-v2-toggle:hover,
.richtexteditor .rte-ai-review-v2-batch:not([disabled]):hover,
.richtexteditor .rte-ai-review-v2-select:hover {
    background: #f7fafc;
    border-color: rgba(21, 89, 214, 0.28);
}

.richtexteditor .rte-ai-review-v2-toggle.is-on {
    background: #eff6ff;
    border-color: rgba(21, 89, 214, 0.4);
    color: #1559d6;
}

.richtexteditor .rte-ai-review-v2-batch.is-accept:not([disabled]) {
    background: #dcfce7;
    border-color: rgba(22, 101, 52, 0.22);
    color: #166534;
}

.richtexteditor .rte-ai-review-v2-batch.is-accept:not([disabled]):hover {
    background: #bbf7d0;
    border-color: rgba(22, 101, 52, 0.4);
}

.richtexteditor .rte-ai-review-v2-batch.is-reject:not([disabled]) {
    background: #fef2f2;
    border-color: rgba(153, 27, 27, 0.22);
    color: #991b1b;
}

.richtexteditor .rte-ai-review-v2-batch.is-reject:not([disabled]):hover {
    background: #fecaca;
    border-color: rgba(153, 27, 27, 0.4);
}

.richtexteditor .rte-ai-review-v2-batch[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.richtexteditor .rte-ai-review-v2-select:focus-visible,
.richtexteditor .rte-ai-review-v2-toggle:focus-visible,
.richtexteditor .rte-ai-review-v2-batch:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(21, 89, 214, 0.45);
    border-color: rgba(21, 89, 214, 0.45);
}

/* ----- Body / list ----- */
.richtexteditor .rte-ai-review-v2-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 2px;
    margin: 0 -2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(20, 36, 58, 0.18) transparent;
}

.richtexteditor .rte-ai-review-v2-body::-webkit-scrollbar { width: 6px; }
.richtexteditor .rte-ai-review-v2-body::-webkit-scrollbar-track { background: transparent; }
.richtexteditor .rte-ai-review-v2-body::-webkit-scrollbar-thumb {
    background: rgba(20, 36, 58, 0.18);
    border-radius: 999px;
}
.richtexteditor .rte-ai-review-v2-body::-webkit-scrollbar-thumb:hover {
    background: rgba(20, 36, 58, 0.32);
}

/* ----- Empty state ----- */
.richtexteditor .rte-ai-review-v2-empty {
    text-align: center;
    padding: 28px 20px;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
    border: 1px solid rgba(20, 36, 58, 0.06);
}

.richtexteditor .rte-ai-review-v2-empty-art {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
}

.richtexteditor .rte-ai-review-v2-empty-art.is-clear {
    background-color: #d1fae5;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}

.richtexteditor .rte-ai-review-v2-empty-art.is-prompt {
    background-color: #dbeafe;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231559d6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 6v12M6 12h12'/></svg>");
}

.richtexteditor .rte-ai-review-v2-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: #1b2a3d;
    margin: 0 0 4px;
}

.richtexteditor .rte-ai-review-v2-empty-detail {
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
    max-width: 360px;
    margin: 0 auto;
}

/* ----- Items ----- */
.richtexteditor .rte-ai-review-v2-item {
    margin: 0 0 6px;
    padding: 10px 12px 10px 14px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    border-left: 3px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.richtexteditor .rte-ai-review-v2-item:hover {
    background: #f7faff;
    border-color: rgba(21, 89, 214, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.richtexteditor .rte-ai-review-v2-item.is-pending { border-left-color: #1559d6; }
.richtexteditor .rte-ai-review-v2-item.is-accepted { border-left-color: #16a34a; }
.richtexteditor .rte-ai-review-v2-item.is-rejected { border-left-color: #94a3b8; }
.richtexteditor .rte-ai-review-v2-item.is-stale { border-left-color: #d97706; }

.richtexteditor .rte-ai-review-v2-item.is-active {
    cursor: default;
    background: linear-gradient(180deg, #fafcff 0%, #f4f7fc 100%);
    border-color: rgba(21, 89, 214, 0.28);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transform: none;
    padding: 14px 14px 12px 16px;
}

.richtexteditor .rte-ai-review-v2-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 9.5px;
    line-height: 1;
}

.richtexteditor .rte-ai-review-v2-item-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px 2px 5px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.richtexteditor .rte-ai-review-v2-item-status::before {
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
}

.richtexteditor .rte-ai-review-v2-item-status.is-accepted::before { content: "\2713"; }
.richtexteditor .rte-ai-review-v2-item-status.is-rejected::before { content: "\00D7"; }
.richtexteditor .rte-ai-review-v2-item-status.is-pending::before { content: "\2022"; font-size: 13px; }
.richtexteditor .rte-ai-review-v2-item-status.is-stale::before { content: "\27F3"; }

.richtexteditor .rte-ai-review-v2-item-status.is-accepted { background: #dcfce7; color: #166534; }
.richtexteditor .rte-ai-review-v2-item-status.is-rejected { background: #f1f5f9; color: #64748b; }
.richtexteditor .rte-ai-review-v2-item-status.is-pending { background: #dbeafe; color: #1559d6; }
.richtexteditor .rte-ai-review-v2-item-status.is-stale { background: #fef3c7; color: #92400e; }

.richtexteditor .rte-ai-review-v2-item-type,
.richtexteditor .rte-ai-review-v2-item-scope {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
}

.richtexteditor .rte-ai-review-v2-item-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
    margin: 6px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.richtexteditor .rte-ai-review-v2-item.is-active .rte-ai-review-v2-item-title {
    -webkit-line-clamp: 2;
    margin: 8px 0 4px;
    font-size: 13.5px;
}

/* ----- Active item: compare + reason + actions ----- */
.richtexteditor .rte-ai-review-v2-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.richtexteditor .rte-ai-review-v2-before,
.richtexteditor .rte-ai-review-v2-after {
    border-radius: 7px;
    padding: 8px 10px;
    border: 1px solid rgba(20, 36, 58, 0.08);
    background: #ffffff;
}

.richtexteditor .rte-ai-review-v2-before { background: #fef2f2; border-color: rgba(153, 27, 27, 0.14); }
.richtexteditor .rte-ai-review-v2-after { background: #f0fdf4; border-color: rgba(22, 101, 52, 0.16); }

.richtexteditor .rte-ai-review-v2-compare-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
}

.richtexteditor .rte-ai-review-v2-before .rte-ai-review-v2-compare-label { color: #991b1b; }
.richtexteditor .rte-ai-review-v2-after .rte-ai-review-v2-compare-label { color: #166534; }

.richtexteditor .rte-ai-review-v2-compare-text {
    font-size: 12px;
    line-height: 1.45;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 88px;
    overflow-y: auto;
}

.richtexteditor .rte-ai-review-v2-reason {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    background: #f8fafc;
    border: 1px solid rgba(20, 36, 58, 0.06);
    font-size: 12px;
    line-height: 1.45;
    color: #334155;
}

.richtexteditor .rte-ai-review-v2-reason-label {
    font-weight: 700;
    color: #1559d6;
    margin-right: 6px;
    text-transform: uppercase;
    font-size: 9.5px;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

.richtexteditor .rte-ai-review-v2-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.richtexteditor .rte-ai-review-v2-action {
    height: 30px;
    padding: 0 14px;
    border: 1px solid rgba(20, 36, 58, 0.14);
    border-radius: 7px;
    background: #ffffff;
    color: #1f2937;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
    font-family: inherit;
}

.richtexteditor .rte-ai-review-v2-action:hover {
    background: #f7fafc;
    border-color: rgba(21, 89, 214, 0.28);
}

.richtexteditor .rte-ai-review-v2-action.is-accept {
    background: #16a34a;
    border-color: #15803d;
    color: #ffffff;
}

.richtexteditor .rte-ai-review-v2-action.is-accept:hover {
    background: #15803d;
}

.richtexteditor .rte-ai-review-v2-action.is-reject {
    background: #ffffff;
    border-color: rgba(153, 27, 27, 0.32);
    color: #991b1b;
}

.richtexteditor .rte-ai-review-v2-action.is-reject:hover {
    background: #fef2f2;
    border-color: rgba(153, 27, 27, 0.5);
}

.richtexteditor .rte-ai-review-v2-action:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(21, 89, 214, 0.45);
}

/* ===========================================================================
 * 2026-05-08 V2 panel — icon polish layer.
 *
 * Each toolbar / action button now ships with an inline SVG glyph + label
 * pair (rendered by setReviewV2ButtonContent in aitoolkit.js). The button's
 * native flex centering takes care of vertical alignment; we just give the
 * icon a tight gap, hint colour for disabled state, and let the SVG
 * inherit currentColor so accept (white-on-green) and reject (red text)
 * look correct without per-icon overrides. */

.richtexteditor .rte-ai-review-v2-toggle,
.richtexteditor .rte-ai-review-v2-batch,
.richtexteditor .rte-ai-review-v2-action,
/* 2026-05-08 unification: AI Chat composer + AI Chat header + Ask AI
   dialog buttons all share the same setReviewV2ButtonContent helper now,
   so the same flex / gap rule applies wherever the helper is used. */
.richtexteditor .rte-ai-chat-send-button,
.richtexteditor .rte-ai-chat-action-button.is-open-dialog,
.richtexteditor .rte-ai-chat-header-button,
.rte-panel-aiassist .demo-ai-run-row > button,
.rte-panel-aiassist .demo-ai-apply-row > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
}

.richtexteditor .rte-ai-review-v2-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
}

.richtexteditor .rte-ai-review-v2-action-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.richtexteditor .rte-ai-review-v2-action-label {
    display: inline-block;
}

/* Send-button glyph in AI Chat composer + Generate button in Ask AI dialog
   sit on a coloured fill; we need the SVG to render in white. */
.richtexteditor .rte-ai-chat-send-button .rte-ai-review-v2-action-icon,
.rte-panel-aiassist .demo-ai-run-row > button.is-primary .rte-ai-review-v2-action-icon,
.rte-panel-aiassist .demo-ai-apply-row > button.is-primary .rte-ai-review-v2-action-icon {
    color: currentColor;
}

/* Slightly larger glyph for primary action buttons so they read as the
   centre of gravity of each window. */
.richtexteditor .rte-ai-chat-send-button .rte-ai-review-v2-action-icon svg,
.rte-panel-aiassist button.is-primary .rte-ai-review-v2-action-icon svg {
    width: 14px;
    height: 14px;
}

/* ===========================================================================
 * 2026-05-08 expansion — icons inside V2 tabs, AI Chat scope toggle, and
 * Ask AI dialog header + USE row. Same family-pack icon library, same flex
 * layout, same currentColor inheritance. */

/* AI Review V2 tab strip — icon sits before the label */
.richtexteditor .rte-ai-review-v2-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    color: inherit;
    margin-right: 2px;
}

.richtexteditor .rte-ai-review-v2-tab-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Active tab gets the blue accent on its icon to match the label */
.richtexteditor .rte-ai-review-v2-tab.is-active .rte-ai-review-v2-tab-icon {
    color: #1559d6;
}

/* AI Chat scope toggle (Selection / Document) — icon + label inline */
.richtexteditor .rte-ai-chat-context-shell.is-minimal .rte-ai-chat-scope-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    line-height: 1 !important;
}

.richtexteditor .rte-ai-chat-context-shell.is-minimal .rte-ai-chat-scope-button .rte-ai-review-v2-action-icon {
    width: 12px;
    height: 12px;
    color: inherit;
}

.richtexteditor .rte-ai-chat-context-shell.is-minimal .rte-ai-chat-scope-button .rte-ai-review-v2-action-icon svg {
    width: 100%;
    height: 100%;
}

/* Ask AI dialog: USE row buttons get the same scope-icon treatment as the
   AI Chat panel — cursor for Selection, document for Document. */
.rte-panel-aiassist .demo-ai-scope-row > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
}

.rte-panel-aiassist .demo-ai-scope-row > button .rte-ai-review-v2-action-icon {
    width: 13px;
    height: 13px;
}

/* 2026-05-08: soften toolbar icon weight after a "buttons too strong, make
   thinner" report. Filled icons in the core toolbar (paragraph / alignment /
   list / etc.) use `fill="#5F6368"` which renders heavy. We dim them with
   opacity so they read as a lighter weight without rewriting each path; on
   hover they pop back to full opacity so the affordance is still clear.
   AI / comments / revision-history stroke icons were thinned at the SVG
   level (1.9 -> 1.5 stroke-width) in their respective plugin files. */
.richtexteditor rte-toolbar-button > svg,
.richtexteditor rte-toolbar-splitbutton-direct > svg,
.richtexteditor rte-toolbar-dropdown svg {
    opacity: 0.72;
    transition: opacity 120ms ease;
}

.richtexteditor rte-toolbar-button:hover > svg,
.richtexteditor rte-toolbar-button[rte-active="true"] > svg,
.richtexteditor rte-toolbar-splitbutton:hover svg,
.richtexteditor rte-toolbar-dropdown:hover svg {
    opacity: 1;
}

/* 2026-05-08 spinner animation for the Send button "Thinking..." state.
   Rotates the inline spinner SVG without spinning the label text. */
@keyframes rte-ai-spin {
    to { transform: rotate(360deg); }
}

/* 2026-05-08 message slide-in: each new chat message gently rises from
   below + fades in. ~180 ms is fast enough to not feel laggy and still
   communicate "this just arrived". */
@keyframes rte-ai-message-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.richtexteditor .rte-ai-chat-message.is-minimal {
    animation: rte-ai-message-in 180ms ease-out both;
}

/* Per-message action row (Copy / Regenerate) on assistant turns. Sits
   under the message text, only visible when the message is hovered or
   focused — keeps the conversation visually calm but the actions one
   gesture away. */
.richtexteditor .rte-ai-chat-message-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 140ms ease;
}

.richtexteditor .rte-ai-chat-message:hover .rte-ai-chat-message-actions-row,
.richtexteditor .rte-ai-chat-message:focus-within .rte-ai-chat-message-actions-row {
    opacity: 1;
}

/* Last assistant message keeps actions visible at all times — that's the
   one users want to copy or regenerate most often. */
.richtexteditor .rte-ai-chat-message.is-assistant:last-child .rte-ai-chat-message-actions-row {
    opacity: 1;
}

.richtexteditor .rte-ai-chat-message-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 5px;
    border: 1px solid rgba(20, 36, 58, 0.12);
    background: #ffffff;
    color: #475569;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
    font-family: inherit;
}

.richtexteditor .rte-ai-chat-message-action:hover {
    background: #f4f7fb;
    border-color: rgba(21, 89, 214, 0.3);
    color: #1f2937;
}

.richtexteditor .rte-ai-chat-message-action:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(21, 89, 214, 0.45);
}

.richtexteditor .rte-ai-chat-message-action.is-just-copied {
    background: #dcfce7;
    border-color: rgba(22, 101, 52, 0.32);
    color: #166534;
}

.richtexteditor .rte-ai-chat-message-action .rte-ai-review-v2-action-icon {
    width: 11px;
    height: 11px;
}

.richtexteditor .rte-ai-chat-message-action .rte-ai-review-v2-action-icon svg {
    width: 100%;
    height: 100%;
}

.richtexteditor .rte-ai-chat-send-button.is-busy .rte-ai-review-v2-action-icon svg,
.richtexteditor .rte-ai-spinner-svg {
    animation: rte-ai-spin 0.9s linear infinite;
    transform-origin: 50% 50%;
}

/* Quick-start chip icons sit before the chip label, slightly smaller than
   the toolbar / action button icons (12 px vs 13 px) so the chip stays
   compact at 28 px tall. Colour inherits from the chip text colour, which
   already varies per tone via data-rte-ai-chat-prompt-tone. */
.richtexteditor .rte-ai-chat-quick-button.is-chip .rte-ai-review-v2-action-icon {
    width: 12px;
    height: 12px;
}

.richtexteditor .rte-ai-chat-quick-button.is-chip .rte-ai-review-v2-action-icon svg {
    width: 100%;
    height: 100%;
}

/* Ask AI dialog title bar — gentle sparkle backdrop next to the title text.
   The editor's createDialog owns the header markup, so we decorate via
   ::before rather than reaching into editor core. The 22 x 22 px gradient
   square + sparkle SVG matches the AI Chat header treatment. */
.rte-panel-aiassist rte-dialog-header rte-dialog-title::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    vertical-align: -5px;
    border-radius: 6px;
    background-color: #dbeafe;
    background-image:
        linear-gradient(135deg, #dbeafe 0%, #ddd6fe 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231559d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1'/><path d='M12 8 13.4 10.6 16 12l-2.6 1.4L12 16l-1.4-2.6L8 12l2.6-1.4L12 8z' fill='%231559d6'/></svg>");
    background-size: 100% 100%, 14px 14px;
    background-position: center, center;
    background-repeat: no-repeat;
    background-blend-mode: normal;
}

/* Reason card: bulb icon + "Why" label inside the leading pill */
.richtexteditor .rte-ai-review-v2-reason-label {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    margin-right: 8px !important;
}

.richtexteditor .rte-ai-review-v2-reason-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    color: #1559d6;
}

/* Compare grid: arrow glyph anchored to the centerline between the
   Current and Suggested cards. Sits inside a 26x26 white circle so it
   reads against either card's tinted background. */
.richtexteditor .rte-ai-review-v2-compare {
    position: relative;
}

.richtexteditor .rte-ai-review-v2-compare-arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(20, 36, 58, 0.12);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    color: #1559d6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.richtexteditor .rte-ai-review-v2-compare-arrow svg {
    width: 14px;
    height: 14px;
}

/* On narrow viewports the compare grid stacks vertically; rotate the
   arrow 90deg so it still points the right way. */
@media (max-width: 540px) {
    .richtexteditor .rte-ai-review-v2-compare {
        grid-template-columns: 1fr;
    }
    .richtexteditor .rte-ai-review-v2-compare-arrow {
        transform: translate(-50%, -50%) rotate(90deg);
    }
}

/* Disabled batch button: keep the icon at the same dimmed opacity as the
   label so it doesn't pop against the muted text. */
.richtexteditor .rte-ai-review-v2-batch[disabled] .rte-ai-review-v2-action-icon {
    opacity: 0.6;
}

/* Toggle in `is-on` state — subtle blue tint already applied; the eye-off
   glyph inherits it via currentColor, no extra rule needed. */

/* ===========================================================================
 * 2026-05-08 AI Review final polish — scrollbar / dropdown caret /
 * transitions / focus-visible / inner card.
 *
 * - Custom thin scrollbar so the feed scroll thumb doesn't stand out as a
 *   chunky native control inside the otherwise-tight panel.
 * - Custom <select> caret SVG so the type-filter dropdown matches the
 *   button typography and doesn't show the heavy native triangle.
 * - 120 ms transitions on every interactive element so hover / active /
 *   focus changes feel smooth.
 * - Visible focus rings on every button + select via :focus-visible —
 *   keyboard navigation now lights up clearly.
 * - Inner state-card / compare-card on the active item gets tighter
 *   padding + flatter shadows so the expanded view stays compact.
 * ======================================================================= */

/* Thin custom scrollbar inside the feed (Chromium / WebKit). Firefox
   honours scrollbar-width / scrollbar-color via the property below. */
.richtexteditor .rte-ai-review-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(20, 36, 58, 0.18) transparent;
}

.richtexteditor .rte-ai-review-content::-webkit-scrollbar {
    width: 6px;
}

.richtexteditor .rte-ai-review-content::-webkit-scrollbar-track {
    background: transparent;
}

.richtexteditor .rte-ai-review-content::-webkit-scrollbar-thumb {
    background: rgba(20, 36, 58, 0.18);
    border-radius: 999px;
}

.richtexteditor .rte-ai-review-content::-webkit-scrollbar-thumb:hover {
    background: rgba(20, 36, 58, 0.32);
}

/* Custom dropdown caret on the type-filter select. Strips the native
   triangle and stamps a tidy SVG chevron flush to the right edge. */
.richtexteditor .rte-ai-review-filter-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1 6 7 11 1'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 9px 6px !important;
}

/* Smooth transitions on every interactive element so hover/active/focus
   reads as state changes rather than instant flips. */
.richtexteditor .rte-ai-review-control-button,
.richtexteditor .rte-ai-review-filter-select,
.richtexteditor .rte-ai-review-action-button,
.richtexteditor .rte-ai-review-header-button,
.richtexteditor .rte-ai-panel-close-button,
.richtexteditor .rte-ai-review-item.is-condensed {
    transition:
        background-color 120ms ease,
        border-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease,
        transform 120ms ease !important;
}

.richtexteditor .rte-ai-review-item.is-condensed:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) !important;
}

/* Visible focus ring on keyboard navigation only. Avoids the loud blue
   ring on every click while keeping accessibility intact. */
.richtexteditor .rte-ai-review-control-button:focus-visible,
.richtexteditor .rte-ai-review-filter-select:focus-visible,
.richtexteditor .rte-ai-review-action-button:focus-visible,
.richtexteditor .rte-ai-review-header-button:focus-visible,
.richtexteditor .rte-ai-panel-close-button:focus-visible,
.richtexteditor .rte-ai-review-item:focus-visible {
    outline: 0 !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95),
                0 0 0 4px rgba(21, 89, 214, 0.45) !important;
    border-color: rgba(21, 89, 214, 0.45) !important;
}

/* Tighten the active item's inner state card and compare card so the
   expanded view stays inside the compact panel instead of blooming into a
   tall card stack. */
.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-state {
    padding: 8px 10px !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}

.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-state-kicker {
    font-size: 9px !important;
    letter-spacing: 0.08em !important;
}

.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-state-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    margin: 2px 0 !important;
}

.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-state-detail {
    font-size: 11.5px !important;
    line-height: 1.45 !important;
}

.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-compare {
    padding: 8px !important;
    border-radius: 7px !important;
    box-shadow: none !important;
}

.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-compare-title {
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
}

.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-compare-detail {
    font-size: 10.5px !important;
}

.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-before,
.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-after {
    font-size: 11.5px !important;
    padding: 6px 8px !important;
    border-radius: 6px !important;
}

/* Decision buttons inside the active item — same tint conventions as the
   batch buttons in the filter row (green = accept, red = reject). */
.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-item-actions {
    gap: 5px !important;
    margin-top: 8px !important;
}

.richtexteditor .rte-ai-review-item.is-active .rte-ai-review-action-button {
    min-height: 28px !important;
    height: 28px;
    padding: 0 12px !important;
    font-size: 11.5px !important;
    border-radius: 7px !important;
}

/* Subtle empty-state hover affordance: the row says "click to expand". */
.richtexteditor .rte-ai-review-item.is-condensed:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

/* ===================================================================
   2026-05-08 (v20260508t) — final compaction pass on the AI windows
   ===================================================================
   Two earlier passes (v20260508p..s) shrank the Ask AI dialog and AI
   chat panel, but customers still came back with "hard to use".
   Diagnostic: each chat assistant turn was a wall of cards (preview,
   action summary, exchange outcome) followed by a 3-section action
   block (utility / primary / secondary, each with its own header) of
   up to seven buttons. The Ask AI dialog still stacked six apply
   buttons in one row. This pass collapses the chat actions into a
   single inline pill row, hides the duplicated cards, and pins the
   alternative apply paths on both surfaces behind a "More" toggle so
   the default surface shows just Copy + Apply (smart) + Discard.
   =================================================================== */

/* --- Chat assistant message: hide the redundant info cards --- */
.richtexteditor .rte-ai-chat-message-preview,
.richtexteditor .rte-ai-chat-message-action-summary,
.richtexteditor .rte-ai-chat-exchange-outcome {
    display: none !important;
}

/* --- Chat action groups collapse into a single inline button row --- */
.richtexteditor .rte-ai-chat-message-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 6px !important;
    padding: 4px 0 0 !important;
    border-top: 1px dashed rgba(28, 42, 59, 0.08) !important;
}

.richtexteditor .rte-ai-chat-message-action-group {
    display: contents !important;
}

.richtexteditor .rte-ai-chat-message-action-group::before {
    display: none !important;
    content: none !important;
}

.richtexteditor .rte-ai-chat-message-action-group-header,
.richtexteditor .rte-ai-chat-message-action-group-title,
.richtexteditor .rte-ai-chat-message-action-group-badge,
.richtexteditor .rte-ai-chat-message-action-group-detail {
    display: none !important;
}

/* The utility group's "Copy text" button is a redundant duplicate of the
   msgActions-row Copy button rendered above (per-assistant-turn helper).
   Hide it so the user sees Copy only once. */
.richtexteditor .rte-ai-chat-message-actions-row + .rte-ai-chat-message-actions .rte-ai-chat-message-action-group.is-utility .rte-ai-chat-action-button.is-copy {
    display: none !important;
}

/* If after hiding the utility Copy the action group has no visible content,
   keep its `display:contents` rule from leaking the dashed top border. */
.richtexteditor .rte-ai-chat-message-actions:has(.rte-ai-chat-message-action-group:empty:only-child) {
    display: none !important;
}

/* --- Hide alt apply paths (Preview / Insert / Replace doc) by default
       on chat messages. Replace selection stays visible because it's the
       most-used flow when the source was a selection. The "More" toggle
       button reveals them by adding `.is-show-more` to the message. --- */
.richtexteditor .rte-ai-chat-message:not(.is-show-more) .rte-ai-chat-action-button.is-preview,
.richtexteditor .rte-ai-chat-message:not(.is-show-more) .rte-ai-chat-action-button.is-insert,
.richtexteditor .rte-ai-chat-message:not(.is-show-more) .rte-ai-chat-action-button.is-document {
    display: none !important;
}

.richtexteditor .rte-ai-chat-message.is-show-more .rte-ai-chat-message-action-toggle-more {
    display: none !important;
}

/* --- "More" toggle button — same pill shape as the action buttons. --- */
.richtexteditor .rte-ai-chat-message-action-toggle-more {
    margin-left: auto;
    background: transparent !important;
    border-color: transparent !important;
    color: #6b7a8c !important;
}

.richtexteditor .rte-ai-chat-message-action-toggle-more:hover:not([disabled]) {
    background: rgba(28, 42, 59, 0.06) !important;
    border-color: rgba(28, 42, 59, 0.12) !important;
    color: #1c2a3b !important;
}

/* --- Per-message Copy + Regenerate row (msgActions) shares the same
       look as the merged action row below it. Reduces row spacing so
       the two rows visually fuse into one cluster. --- */
.richtexteditor .rte-ai-chat-message-actions-row {
    margin-top: 6px;
    padding: 0;
    border: none;
}

/* --- 2026-05-08 (v20260508u): empty-state collapsed further. The
       prior pass shrank the hero SVG to 96x70 but the empty card still
       took ~150px of feed height before any conversation appeared.
       Now: 64x46 SVG, 8px padding, smaller title — the first thing
       users see on a fresh open is the composer + "Ask anything", not
       a robot illustration. --- */
.richtexteditor .rte-ai-chat-empty-art {
    width: 64px !important;
    height: 46px !important;
    margin: 0 auto 2px !important;
}

.richtexteditor .rte-ai-chat-empty {
    gap: 4px !important;
    padding: 8px 10px !important;
}

.richtexteditor .rte-ai-chat-empty-title {
    font-size: 13px !important;
}

.richtexteditor .rte-ai-chat-empty-detail {
    font-size: 11px !important;
    line-height: 1.4 !important;
}

/* --- Ask AI dialog apply row: hide alt paths until "More" toggled. --- */
.rte-panel-aiassist .demo-ai-apply-row:not(.is-show-more) [data-rte-ai-dialog-action="selection"],
.rte-panel-aiassist .demo-ai-apply-row:not(.is-show-more) [data-rte-ai-dialog-action="document"],
.rte-panel-aiassist .demo-ai-apply-row:not(.is-show-more) [data-rte-ai-dialog-action="insert"],
.rte-panel-aiassist .demo-ai-apply-row:not(.is-show-more) [data-rte-ai-dialog-action="preview"] {
    display: none !important;
}

.rte-panel-aiassist .demo-ai-apply-row.is-show-more .demo-ai-apply-more-toggle {
    display: none !important;
}

.rte-panel-aiassist .demo-ai-apply-row .demo-ai-apply-more-toggle {
    flex: 0 0 auto;
    margin-left: auto;
    background: transparent;
    border-color: transparent;
    color: #6b7a8c;
}

.rte-panel-aiassist .demo-ai-apply-row .demo-ai-apply-more-toggle:hover:not([disabled]) {
    background: rgba(28, 42, 59, 0.06);
    border-color: rgba(28, 42, 59, 0.12);
    color: #1c2a3b;
}

/* When More is collapsed, Discard still pins right (margin-left:auto on
   reject was set by an earlier rule, but the toggle now also has
   margin-left:auto; explicitly clear it on reject so they line up). */
.rte-panel-aiassist .demo-ai-apply-row.is-show-more [data-rte-ai-dialog-action="reject"] {
    margin-left: 0;
}

.rte-panel-aiassist .demo-ai-apply-row:not(.is-show-more) [data-rte-ai-dialog-action="reject"] {
    margin-left: 8px;
}

