.top-text .page-helpers-btn--top,
.page-helpers-btn--top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    min-width: auto;
    width: auto;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(14, 116, 144, 0.28);
    color: #e0f2fe;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.top-text .page-helpers-btn--top:hover,
.page-helpers-btn--top:hover {
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(14, 116, 144, 0.42);
}

.top-text .page-helpers-btn--top .feather-icon,
.top-text .page-helpers-btn--top svg,
.page-helpers-btn--top .feather-icon,
.page-helpers-btn--top svg {
    width: 14px !important;
    height: 14px !important;
}

body.has-mobile-fab-dock .mobile-app-fab-dock-btn--page-helpers {
    background: linear-gradient(135deg, #22d3ee 0%, #0284c7 100%);
    color: #082f49;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
}

.page-helpers-dialog {
    width: min(980px, calc(100vw - 24px));
    max-width: min(980px, calc(100vw - 24px));
    height: auto;
    max-height: min(90vh, calc(100dvh - 24px));
}

.page-helpers-subtitle {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 0.82rem;
}

.page-helpers-dialog .modal-body.page-helpers-body {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
}

.page-helpers-sidebar,
.page-helpers-editor {
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.45);
    padding: 12px;
    overflow: auto;
}

.page-helpers-sidebar-head,
.page-helpers-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.page-helpers-sidebar-head h3,
.page-helpers-editor-head h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.page-helpers-list,
.page-helpers-items {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    flex: 0 0 auto;
}

.page-helpers-empty {
    margin: 0;
    padding: 12px 8px;
    color: #94a3b8;
    font-size: 0.88rem;
    text-align: center;
}

.page-helpers-card,
.page-helpers-item-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.45);
    color: #e2e8f0;
    padding: 10px 12px;
    cursor: pointer;
}

.page-helpers-card:hover,
.page-helpers-item-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
}

.page-helpers-card.is-active,
.page-helpers-item-card.is-active {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(14, 116, 144, 0.22);
}

.page-helpers-card-title,
.page-helpers-item-title {
    font-weight: 600;
    font-size: 0.92rem;
}

.page-helpers-card-meta,
.page-helpers-item-meta {
    color: #94a3b8;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.page-helpers-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 0 0 auto;
}

.page-helpers-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #cbd5e1;
    font-size: 0.84rem;
}

.page-helpers-form input,
.page-helpers-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.page-helpers-form textarea {
    min-height: 120px;
    max-height: 280px;
    resize: vertical;
    font-family: Consolas, "Segoe UI", monospace;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}

.page-helper-patterns-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-helper-patterns-block > .page-helpers-editor-head {
    color: #cbd5e1;
    font-size: 0.84rem;
}

.page-helper-patterns-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-helper-pattern-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.page-helper-pattern-row input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.page-helper-pattern-remove {
    min-width: 34px;
    height: 34px;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
}

.page-helpers-pattern-summary {
    margin: 0;
    padding-left: 18px;
    color: #94a3b8;
    font-size: 0.86rem;
    line-height: 1.45;
}

.page-helpers-pattern-summary li {
    margin: 2px 0;
}

.page-helper-rich-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.page-helper-rich-label {
    color: #cbd5e1;
    font-size: 0.84rem;
}

.page-helper-item-content-editor {
    min-height: 0;
}

.page-helper-rich-wrap .ql-toolbar.ql-snow {
    border-radius: 10px 10px 0 0;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(2, 6, 23, 0.45);
}

.page-helper-rich-wrap .ql-container.ql-snow {
    min-height: 160px;
    max-height: 320px;
    overflow: auto;
    border-radius: 0 0 10px 10px;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(2, 6, 23, 0.55);
    color: #e2e8f0;
    font-family: "Segoe UI", sans-serif;
    font-size: 0.92rem;
}

.page-helper-rich-wrap .ql-editor {
    min-height: 140px;
}

.page-helper-rich-wrap .ql-editor.ql-blank::before {
    color: #64748b;
    font-style: normal;
}

.page-helpers-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.page-helpers-form-actions .danger-btn,
.page-helpers-form-actions .ghost-btn.page-helpers-danger {
    margin-left: auto;
    color: #fda4af;
}

.page-helpers-hint {
    margin: 0;
    color: #64748b;
    font-size: 0.78rem;
}

.page-helpers-hint strong,
.page-helpers-summary strong {
    color: #e2e8f0;
    font-weight: 600;
}

.page-helpers-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-helpers-guide {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 8px 4px;
}

.page-helpers-guide h3 {
    margin: 0;
    font-size: 1rem;
    color: #e2e8f0;
}

.page-helpers-steps {
    margin: 0;
    padding-left: 18px;
    color: #94a3b8;
    font-size: 0.88rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-helpers-steps strong {
    color: #e2e8f0;
}

.page-helpers-summary {
    margin: 0;
    color: #94a3b8;
    font-size: 0.86rem;
    line-height: 1.45;
}

.page-helpers-empty-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    background: rgba(2, 6, 23, 0.35);
}

.page-helpers-empty-card p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.88rem;
}

.page-helpers-item-action {
    margin-top: 2px;
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 600;
}

#page-helper-new.is-muted {
    opacity: 0.55;
}

.page-helpers-sidebar-head h3::after {
    content: none;
}

/* Monitor estreito ou vertical: empilha e evita “vazio” entre seções */
@media (max-width: 1100px), (orientation: portrait) {
    .page-helpers-dialog {
        width: min(720px, calc(100vw - 16px));
        max-width: min(720px, calc(100vw - 16px));
        max-height: min(94vh, calc(100dvh - 16px));
    }

    .page-helpers-dialog .modal-body.page-helpers-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        align-items: stretch;
        overflow: auto;
    }

    .page-helpers-sidebar,
    .page-helpers-editor {
        max-height: none;
        overflow: visible;
    }

    .page-helpers-sidebar {
        max-height: 220px;
        overflow: auto;
    }

    .page-helpers-form textarea {
        min-height: 100px;
        max-height: 220px;
    }
}

@media (max-width: 640px) {
    .page-helpers-dialog {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        max-height: calc(100dvh - 12px);
        border-radius: 12px;
    }

    .page-helpers-sidebar {
        max-height: 180px;
    }
}

/* Janela desktop do atalho */
body.page-helper-window-page {
    margin: 0;
    height: 100vh;
    background: #0f172a;
    color: #e2e8f0;
    font-family: "Segoe UI", sans-serif;
    overflow: hidden;
}

.page-helper-window-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.page-helper-window-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    user-select: none;
}

.page-helper-window-drag {
    width: 18px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: grab;
    padding: 0;
}

.page-helper-window-drag span {
    display: block;
    width: 4px;
    height: 16px;
    margin: 0 auto;
    border-radius: 2px;
    background: rgba(226, 232, 240, 0.35);
}

.page-helper-window-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font: 700 14px "Segoe UI", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-helper-window-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
    gap: 0;
}

.page-helper-window-list-col {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.35);
}

.page-helper-window-new {
    margin: 8px 8px 0;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(14, 116, 144, 0.28);
    color: #e0f2fe;
    border-radius: 8px;
    padding: 8px 10px;
    font: 700 12px "Segoe UI", sans-serif;
    cursor: pointer;
}

.page-helper-window-list-col .page-helper-window-list {
    flex: 1;
    min-height: 0;
    border-right: 0;
    background: transparent;
}

.page-helper-window-list {
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    overflow: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(2, 6, 23, 0.35);
}

.page-helper-window-list button {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #e2e8f0;
    padding: 10px 12px;
    cursor: pointer;
    font: 600 13px "Segoe UI", sans-serif;
}

.page-helper-window-list button:hover {
    background: rgba(148, 163, 184, 0.12);
}

.page-helper-window-list button.is-active {
    background: rgba(14, 116, 144, 0.28);
    border-color: rgba(56, 189, 248, 0.35);
}

.page-helper-window-detail {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.page-helper-window-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.page-helper-window-detail-head h3 {
    margin: 0;
    font-size: 15px;
    min-width: 0;
}

.page-helper-window-detail-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.page-helper-window-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-helper-window-field,
.page-helper-window-editor-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.page-helper-window-field input {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: #020617;
    color: #e2e8f0;
    padding: 8px 10px;
    font: 14px "Segoe UI", sans-serif;
}

.page-helper-window-editor-wrap {
    flex: 1;
    min-height: 0;
}

.page-helper-window-editor-wrap .ql-toolbar.ql-snow {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #1e293b;
}

.page-helper-window-editor-wrap .ql-container.ql-snow {
    flex: 1;
    min-height: 120px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0 0 8px 8px;
    background: #020617;
    color: #e2e8f0;
    font: 14px "Segoe UI", sans-serif;
}

.page-helper-window-editor-wrap .ql-editor {
    min-height: 120px;
}

.page-helper-window-editor-wrap .ql-snow .ql-stroke {
    stroke: #e2e8f0;
}

.page-helper-window-editor-wrap .ql-snow .ql-fill {
    fill: #e2e8f0;
}

.page-helper-window-editor-wrap .ql-snow .ql-picker {
    color: #e2e8f0;
}

.page-helper-window-form-actions {
    display: flex;
    gap: 8px;
}

.page-helper-window-form-status {
    margin: 0;
    min-height: 1.2em;
    color: #fca5a5;
    font-size: 12px;
}

.page-helper-window-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
    word-break: break-word;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.7);
    font: 13px/1.5 "Segoe UI", sans-serif;
    color: #e2e8f0;
}

.page-helper-window-content:empty::before {
    content: "Selecione um texto à esquerda.";
    color: #64748b;
}

.page-helper-window-content p {
    margin: 0 0 0.6em;
}

.page-helper-window-content p:last-child {
    margin-bottom: 0;
}

.page-helper-window-content ul,
.page-helper-window-content ol {
    margin: 0 0 0.6em;
    padding-left: 1.25em;
}

.page-helper-window-content img {
    max-width: 100%;
    height: auto;
}

.page-helper-window-content a {
    color: #38bdf8;
}

.page-helper-window-message {
    margin: 24px;
    color: #94a3b8;
}

.page-helper-copy-btn.is-copied {
    background: #059669;
    border-color: #059669;
    color: #fff;
}
