/* Total Agents - Global Styles */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgb(var(--tp-gray-040));
}

::-webkit-scrollbar-thumb {
    background: rgb(var(--tp-gray-200));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--tp-gray-400));
}

/* Transitions */
.transition-all {
    transition: all 0.2s ease-in-out;
}

/* Custom focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: rgb(var(--tp-endorphin-200));
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 50;
    animation: slideIn 0.3s ease-out;
}

.toast-success {
    background-color: rgb(var(--tp-endorphin-300));
    color: white;
}

.toast-error {
    background-color: rgb(var(--tp-red-500));
    color: white;
}

.toast-info {
    background-color: rgb(var(--tp-blue-400));
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Code blocks */
pre {
    background-color: rgb(var(--tp-gray-800));
    color: rgb(var(--tp-gray-100));
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
}

code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

/* Form styles */
.form-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgb(var(--tp-gray-200));
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.form-input:focus {
    border-color: rgb(var(--tp-endorphin-200));
    box-shadow: 0 0 0 3px rgb(var(--tp-endorphin-200) / 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(var(--tp-gray-700));
}

.form-error {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: rgb(var(--tp-red-500));
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background-color: rgb(var(--tp-endorphin-500));
    /* primary modo claro (#00894e) — botões em superfície clara */
    color: #ffffff;
}

.btn-primary:hover {
    background-color: rgb(var(--tp-endorphin-600));
}

.btn-secondary {
    background-color: rgb(var(--tp-gray-040));
    color: rgb(var(--tp-gray-700));
    border: 1px solid rgb(var(--tp-gray-200));
}

.btn-secondary:hover {
    background-color: rgb(var(--tp-gray-100));
}

.btn-danger {
    background-color: rgb(var(--tp-red-500));
    color: white;
}

.btn-danger:hover {
    background-color: rgb(var(--tp-red-600));
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   EDITORIAL DESIGN SYSTEM
   Recursos: lista, formulario, detalhe — visual unificado.
   - Sem cards individuais; superficies continuas com 1px divider
   - Tipografia Inter, labels em uppercase com tracking aberto
   - Accent emerald (do tema midnight) reservado pra hover/active
   - Cantos retos onde possivel (rounded-md so em inputs/buttons)
   - Sem sombra; profundidade vem da hierarquia tipografica
   ============================================================ */

/* Page outer - usado dentro do main-content do dashboard rail */
.ed-page {
    background: #ffffff;
    border: 1px solid rgb(var(--tp-gray-100));
    border-radius: 0;
    overflow-anchor: none;
}

.ed-dashboard-scroll {
    overflow-anchor: none;
    overscroll-behavior: contain;
}

/* Remove lg breathing room so .ed-save-bar (sticky bottom: 0) lands flush at viewport bottom */
@media (min-width: 1024px) {
    .ed-dashboard-scroll {
        padding-bottom: 0;
    }
}

/* Sticky chat assistant beside agent form (behavior/schema). Reasonable height instead of 90vh. */
@media (min-width: 1024px) {
    .ed-form-chat-sticky {
        position: sticky;
        top: 1rem;
        align-self: start;
        height: clamp(420px, 60vh, 600px);
    }
}

html.overflow-hidden,
html.overflow-hidden body {
    overscroll-behavior: none;
}

/* Surface de pagina (painel branco continuo) */
.ed-surface {
    background: #ffffff;
    border: 1px solid rgb(var(--tp-gray-100));
}

/* Page header thin strip */
.ed-page-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgb(var(--tp-gray-100));
    background: #ffffff;
}

.ed-page-header__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgb(var(--tp-gray-500));
    margin-bottom: 0.25rem;
}

.ed-page-header__title {
    font-size: 1.25rem;
    line-height: 1.5rem;
    font-weight: 600;
    color: rgb(var(--tp-gray-900));
    letter-spacing: -0.01em;
}

.ed-page-header__subtitle {
    font-size: 0.8125rem;
    color: rgb(var(--tp-gray-500));
    margin-top: 0.25rem;
}

.ed-page-header__count {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: rgb(var(--tp-gray-500));
    letter-spacing: 0.04em;
}

/* Section divider em form/detail */
.ed-section {
    border-top: 1px solid rgb(var(--tp-gray-100));
    padding: 1.5rem;
    background: #ffffff;
}

.ed-section:first-of-type {
    border-top: none;
}

.ed-section__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgb(var(--tp-gray-500));
    margin-bottom: 1rem;
}

.ed-section__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgb(var(--tp-gray-900));
    margin-bottom: 0.25rem;
}

.ed-section__description {
    font-size: 0.8125rem;
    color: rgb(var(--tp-gray-500));
    margin-bottom: 1rem;
}

/* List rows (no cards, only dividers) */
.ed-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid rgb(var(--tp-gray-040));
    transition: background-color .12s ease;
    text-decoration: none;
    color: inherit;
}

.ed-row:hover {
    background: rgb(var(--tp-gray-010));
}

.ed-row:last-child {
    border-bottom: none;
}

.ed-row__icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(var(--tp-gray-600));
    flex-shrink: 0;
}

.ed-row__title {
    font-size: 0.875rem;
    color: rgb(var(--tp-gray-900));
    font-weight: 500;
    truncate: ellipsis;
}

.ed-row__meta {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: rgb(var(--tp-gray-500));
    letter-spacing: 0.02em;
}

.ed-row__sub {
    font-size: 0.75rem;
    color: rgb(var(--tp-gray-500));
}

/*
 * Data de criacao nas linhas de listagem: so aparece em viewports largas.
 * Em lg (1024-1279px), sidebar (320px) + pastas (240px) + chips/acoes fixos
 * da linha nao deixam folga para a data — sem esta regra a linha estoura o
 * container. O CSS Tailwind precompilado nao tem variantes `xl:*` de display,
 * por isso a classe semantica vive aqui.
 */
.ed-row__date {
    display: none;
}

@media (min-width: 1280px) {
    .ed-row__date {
        display: inline-block;
    }
}

/* Chip (substitui pills coloridas) */
.ed-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 8px;
    border: 1px solid rgb(var(--tp-gray-100));
    background: #ffffff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: rgb(var(--tp-gray-600));
    line-height: 1.4;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
    text-decoration: none;
    white-space: nowrap;
}

.ed-chip:hover {
    border-color: rgb(var(--tp-gray-400));
    background: rgb(var(--tp-gray-010));
}

.ed-chip--active {
    border-color: rgb(var(--tp-gray-900));
    background: rgb(var(--tp-gray-900));
    color: #ffffff;
}

.ed-chip--accent {
    border-color: rgb(var(--tp-endorphin-200));
    background: rgb(var(--tp-endorphin-50));
    color: rgb(var(--tp-endorphin-500));
}

.ed-chip--warn {
    border-color: rgb(var(--tp-amber-200));
    background: rgb(var(--tp-amber-50));
    color: #92400e;
}

.ed-chip--danger {
    border-color: rgb(var(--tp-red-200));
    background: rgb(var(--tp-red-50));
    color: rgb(var(--tp-red-700));
}

.ed-chip--mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.02em;
}

.ed-chip--dot {
    padding-left: 6px;
}

.ed-chip__dot {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.7;
}

/* Inputs flat */
.ed-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid rgb(var(--tp-gray-200));
    border-radius: 4px;
    font-size: 0.875rem;
    color: rgb(var(--tp-gray-900));
    transition: border-color .12s ease;
}

.ed-input:focus {
    outline: none;
    border-color: rgb(var(--tp-gray-900));
}

.ed-input::placeholder {
    color: rgb(var(--tp-gray-400));
}

/* Switch padrao dos forms editoriais.
   Evita depender de variantes peer-checked do Tailwind precompilado. */
.ed-switch {
    position: relative;
    display: inline-flex;
    width: 2.75rem;
    height: 1.5rem;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 999px;
    background: rgb(var(--tp-gray-100));
}

.ed-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid rgb(var(--tp-gray-200));
    border-radius: 999px;
    background: #ffffff;
    transition: transform .15s ease, border-color .15s ease;
}

input:checked+.ed-switch {
    background: rgb(var(--tp-endorphin-300));
}

input:checked+.ed-switch::after,
.ed-switch.ed-switch--active::after {
    transform: translateX(100%);
    border-color: #ffffff;
}

input:focus-visible+.ed-switch,
.ed-switch:focus-visible {
    outline: 2px solid rgb(var(--tp-endorphin-100));
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgb(var(--tp-endorphin-200) / .35);
}

.ed-switch.ed-switch--active {
    background: rgb(var(--tp-endorphin-300));
}

input:disabled+.ed-switch {
    opacity: .55;
    cursor: not-allowed;
}

.ed-input--mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8125rem;
}

.ed-th-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgb(var(--tp-gray-500));
}

.ed-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(var(--tp-gray-600));
    margin-bottom: 0.375rem;
}

.ed-help {
    font-size: 0.75rem;
    color: rgb(var(--tp-gray-500));
    margin-top: 0.375rem;
}

/* Buttons */
.ed-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    border: 1px solid rgb(var(--tp-gray-200));
    background: #ffffff;
    color: rgb(var(--tp-gray-900));
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all .12s ease;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.25;
}

.ed-btn:hover {
    border-color: rgb(var(--tp-gray-500));
    background: rgb(var(--tp-gray-010));
}

.ed-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ed-btn--primary {
    background: rgb(var(--tp-endorphin-500));
    /* primary modo claro (#00894e) — botões em superfície clara */
    color: #ffffff;
    border-color: rgb(var(--tp-endorphin-500));
}

.ed-btn--primary:hover {
    background: rgb(var(--tp-endorphin-600));
    /* #006d3d */
    border-color: rgb(var(--tp-endorphin-600));
}

.ed-btn--accent {
    background: rgb(var(--tp-endorphin-50));
    color: rgb(var(--tp-endorphin-500));
    border-color: rgb(var(--tp-endorphin-100));
}

.ed-btn--accent:hover {
    background: rgb(var(--tp-endorphin-100));
    border-color: rgb(var(--tp-endorphin-200));
}

.ed-btn--danger {
    color: rgb(var(--tp-red-700));
    border-color: rgb(var(--tp-red-200));
    background: #ffffff;
}

.ed-btn--danger:hover {
    background: rgb(var(--tp-red-50));
    border-color: rgb(var(--tp-red-400));
}

.ed-btn--ghost {
    border-color: transparent;
    background: transparent;
    color: rgb(var(--tp-gray-600));
}

.ed-btn--ghost:hover {
    background: rgb(var(--tp-gray-040));
    color: rgb(var(--tp-gray-900));
}

.ed-btn--sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
}

.ed-btn--icon {
    padding: 0.375rem;
}

/* Mono label de stat */
.ed-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    border-right: 1px solid rgb(var(--tp-gray-100));
}

.ed-stat:last-child {
    border-right: none;
}

.ed-stat__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgb(var(--tp-gray-500));
}

.ed-stat__value {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgb(var(--tp-gray-900));
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.ed-stat__hint {
    font-size: 0.75rem;
    color: rgb(var(--tp-gray-400));
}

/* Tab strip (sub-nav nas paginas detail) */
.ed-tabs {
    display: flex;
    border-bottom: 1px solid rgb(var(--tp-gray-100));
    padding: 0 1.5rem;
    background: #ffffff;
    gap: 0.25rem;
    overflow-x: auto;
}

.ed-tab {
    /* inline-flex: o preflight do Tailwind poe svg{display:block} — sem flex,
       o icone da aba cai numa linha propria e o texto quebra para baixo */
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 0.875rem;
    font-size: 0.8125rem;
    color: rgb(var(--tp-gray-500));
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .12s, border-color .12s;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
}

.ed-tab:hover {
    color: rgb(var(--tp-gray-900));
}

.ed-tab--active {
    color: rgb(var(--tp-gray-900));
    border-bottom-color: rgb(var(--tp-gray-900));
    font-weight: 500;
}

/* Empty state minimalista */
.ed-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: rgb(var(--tp-gray-500));
}

.ed-empty__icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 0.875rem;
    color: rgb(var(--tp-gray-400));
}

.ed-empty__title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgb(var(--tp-gray-600));
    margin-bottom: 0.25rem;
}

.ed-empty__description {
    font-size: 0.8125rem;
    color: rgb(var(--tp-gray-400));
}

/* Reset/override pra seguranca quando aplicar editorial dentro de container do tema */
.ed-page * {
    box-sizing: border-box;
}


/* ============================================================
   Editorial Form & Detail — single-page layout
   - Sem step wizard; pagina scrollavel com TOC sticky
   - Sections separadas por hairline, sem cards
   - Save bar sticky no rodape
   ============================================================ */

/* Shell de form/detail: main + TOC sticky lateral */
.ed-form-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

@media (min-width: 1024px) {
    .ed-form-shell {
        grid-template-columns: minmax(0, 1fr) 220px;
    }
}

.ed-form-main {
    min-width: 0;
    background: #ffffff;
    padding-bottom: 96px;
}

.ed-form-toc {
    display: none;
    border-left: 1px solid rgb(var(--tp-gray-100));
    padding: 1.5rem 1.25rem;
    background: rgb(var(--tp-gray-010));
}

@media (min-width: 1024px) {
    .ed-form-toc {
        display: block;
        position: sticky;
        top: 0;
        align-self: start;
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
    }
}

.ed-form-toc__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgb(var(--tp-gray-400));
    margin-bottom: 0.875rem;
}

.ed-form-toc__list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ed-form-toc__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    color: rgb(var(--tp-gray-500));
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color .12s ease, border-color .12s ease, background .12s ease;
    cursor: pointer;
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    text-align: left;
    width: 100%;
    line-height: 1.4;
}

.ed-form-toc__item-num {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 10px;
    color: rgb(var(--tp-gray-400));
    letter-spacing: 0.04em;
    min-width: 18px;
}

.ed-form-toc__item:hover {
    color: rgb(var(--tp-gray-900));
    background: rgb(var(--tp-gray-040));
}

.ed-form-toc__item--active {
    color: rgb(var(--tp-gray-900));
    font-weight: 500;
    border-left-color: rgb(var(--tp-endorphin-200));
    background: #ffffff;
}

.ed-form-toc__item--active .ed-form-toc__item-num {
    color: rgb(var(--tp-endorphin-500));
}

/* Section dentro do form/detail (com anchor para TOC) */
.ed-form-section {
    border-top: 1px solid rgb(var(--tp-gray-100));
    padding: 2rem 1.5rem;
    scroll-margin-top: 16px;
    background: #ffffff;
}

.ed-form-section:first-of-type {
    border-top: none;
}

.ed-form-section__num {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgb(var(--tp-gray-400));
    margin-right: 0.5rem;
}

.ed-form-section__label {
    display: flex;
    align-items: baseline;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgb(var(--tp-gray-500));
    margin-bottom: 0.5rem;
}

.ed-form-section__title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: rgb(var(--tp-gray-900));
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.ed-form-section__description {
    font-size: 0.8125rem;
    color: rgb(var(--tp-gray-500));
    margin-bottom: 1.5rem;
    line-height: 1.55;
    max-width: 60ch;
}

.ed-form-section--invalid {
    box-shadow: inset 3px 0 0 rgb(var(--tp-red-400));
}

/* Hairline divider standalone */
.ed-divider {
    height: 1px;
    background: rgb(var(--tp-gray-100));
    border: 0;
    margin: 0;
}

/* Save bar sticky bottom */
.ed-save-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgb(var(--tp-gray-100));
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom, 0);
    overflow-anchor: none;
}

.ed-save-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
}

.ed-save-bar__hint {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: rgb(var(--tp-gray-400));
    letter-spacing: 0.04em;
}

.ed-save-bar__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Textarea editorial */
.ed-textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid rgb(var(--tp-gray-200));
    border-radius: 4px;
    font-size: 0.875rem;
    color: rgb(var(--tp-gray-900));
    transition: border-color .12s ease;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.ed-textarea:focus {
    outline: none;
    border-color: rgb(var(--tp-gray-900));
}

.ed-textarea::placeholder {
    color: rgb(var(--tp-gray-400));
}

.ed-textarea--mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8125rem;
}

/* Select editorial */
.ed-select {
    display: block;
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background-color: #ffffff;
    border: 1px solid rgb(var(--tp-gray-200));
    border-radius: 4px;
    font-size: 0.875rem;
    color: rgb(var(--tp-gray-900));
    transition: border-color .12s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 12px;
    cursor: pointer;
}

.ed-select:focus {
    outline: none;
    border-color: rgb(var(--tp-gray-900));
}

/* Fieldset (sub-bloco compacto dentro de section) */
.ed-fieldset {
    padding: 1rem 0;
    border-top: 1px dashed rgb(var(--tp-gray-040));
}

.ed-fieldset:first-child {
    padding-top: 0;
    border-top: none;
}

.ed-fieldset__legend {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(var(--tp-gray-900));
    margin-bottom: 0.625rem;
}

/* Field grid 2/3 colunas (campos lado-a-lado) */
.ed-form-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.ed-form-grid-3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .ed-form-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ed-form-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Radio card flat (escolha exclusiva) */
.ed-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid rgb(var(--tp-gray-100));
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}

.ed-radio-card:hover {
    border-color: rgb(var(--tp-gray-400));
    background: rgb(var(--tp-gray-010));
}

.ed-radio-card--checked {
    border-color: rgb(var(--tp-gray-900));
    background: rgb(var(--tp-gray-010));
}

.ed-radio-card__indicator {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid rgb(var(--tp-gray-200));
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
}

.ed-radio-card--checked .ed-radio-card__indicator {
    border-color: rgb(var(--tp-gray-900));
}

.ed-radio-card--checked .ed-radio-card__indicator::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    background: rgb(var(--tp-gray-900));
}

.ed-radio-card__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(var(--tp-gray-900));
    line-height: 1.4;
}

.ed-radio-card__description {
    font-size: 0.75rem;
    color: rgb(var(--tp-gray-500));
    margin-top: 0.25rem;
    line-height: 1.45;
}

/* Detail (read-only): meta grid de key/value mono */
.ed-detail-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

@media (min-width: 1024px) {
    .ed-detail-shell {
        grid-template-columns: minmax(0, 1fr) 220px;
    }
}

.ed-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0;
    padding: 1rem 1.5rem;
    background: rgb(var(--tp-gray-010));
    border-bottom: 1px solid rgb(var(--tp-gray-100));
}

.ed-detail-meta__item {
    padding: 0.5rem 1rem 0.5rem 0;
    border-right: 1px solid rgb(var(--tp-gray-100));
}

.ed-detail-meta__item:last-child {
    border-right: none;
}

.ed-detail-meta__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgb(var(--tp-gray-400));
    margin-bottom: 0.25rem;
}

.ed-detail-meta__value {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    color: rgb(var(--tp-gray-900));
    word-break: break-word;
}

/* Callouts (substitui boxes coloridos saturados) */
.ed-callout {
    border: 1px solid rgb(var(--tp-gray-100));
    background: rgb(var(--tp-gray-010));
    padding: 0.875rem 1rem;
    border-left: 3px solid rgb(var(--tp-gray-400));
    border-radius: 0;
    font-size: 0.8125rem;
    color: rgb(var(--tp-gray-600));
    line-height: 1.5;
}

.ed-callout__title {
    font-weight: 600;
    color: rgb(var(--tp-gray-900));
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.ed-callout--info {
    background: rgb(var(--tp-gray-010));
    border-left-color: rgb(var(--tp-gray-500));
}

.ed-callout--success {
    background: rgb(var(--tp-endorphin-50));
    border-color: rgb(var(--tp-endorphin-100));
    border-left-color: rgb(var(--tp-endorphin-200));
    color: rgb(var(--tp-endorphin-600));
}

.ed-callout--success .ed-callout__title {
    color: rgb(var(--tp-endorphin-500));
}

.ed-callout--warn {
    background: rgb(var(--tp-amber-50));
    border-color: rgb(var(--tp-amber-100));
    border-left-color: rgb(var(--tp-amber-800));
    color: #78350f;
}

.ed-callout--warn .ed-callout__title {
    color: #92400e;
}

.ed-callout--danger {
    background: rgb(var(--tp-red-50));
    border-color: rgb(var(--tp-red-100));
    border-left-color: rgb(var(--tp-red-500));
    color: rgb(var(--tp-red-800));
}

.ed-callout--danger .ed-callout__title {
    color: rgb(var(--tp-red-700));
}

/* Field error / help */
.ed-input--error,
.ed-textarea--error,
.ed-select--error {
    border-color: rgb(var(--tp-red-500));
}

.ed-error {
    font-size: 0.75rem;
    color: rgb(var(--tp-red-700));
    margin-top: 0.375rem;
}