:root {
    --bg: #050914;
    --surface: #0b1222;
    --surface-2: #101a31;
    --line: rgba(136, 166, 255, 0.18);
    --text: #f7fbff;
    --muted: #9aa8c7;
    --blue: #1d8fff;
    --cyan: #38d5ff;
    --danger: #ff5470;
    --radius: 8px;
}

/* Keep utility visibility above component display rules. */
[hidden] {
    display: none !important;
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: currentColor;
    stroke-width: 2;
    vertical-align: middle;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-md {
    width: 18px;
    height: 18px;
}

.icon-lg {
    width: 22px;
    height: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 0%, rgba(29, 143, 255, 0.2), transparent 30%),
        linear-gradient(140deg, #050914 0%, #071225 52%, #050914 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.sidebar {
    flex-shrink: 0;
    width: 280px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    border-right: 1px solid var(--line);
    background: rgba(5, 9, 20, 0.78);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 20px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 0 26px rgba(56, 213, 255, 0.36);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav-middle {
    margin-top: auto;
    margin-bottom: auto;
}

.nav-secondary {
    margin-top: 0;
}

.nav a,
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    padding: 11px 12px;
    border-radius: var(--radius);
}

.nav a:hover,
.sidebar-footer a:hover {
    color: var(--text);
    background: rgba(29, 143, 255, 0.12);
}

.nav a.nav-active {
    color: var(--text);
    background: rgba(56, 213, 255, 0.14);
    box-shadow: inset 3px 0 0 var(--cyan);
}

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-count,
.nav-status {
    margin-left: auto;
    flex: 0 0 24px;
}

.nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    height: 18px;
    padding: 3px 7px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.nav-count-gold {
    width: auto;
    min-width: 58px;
    padding: 4px 10px;
    border-color: rgba(176, 142, 53, 0.64);
    background: rgba(176, 142, 53, 0.1);
    color: #f8d26a;
    font-size: 11px;
}

.nav-count-red {
    width: auto;
    min-width: 24px;
    padding: 4px 7px;
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    font-size: 11px;
    margin-left: 4px;
}

.nav-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 18px;
    border-radius: 50%;
}

.nav-status::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.nav-status-on {
    background: transparent;
    box-shadow: none;
}

.nav-status-on::after {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12), 0 0 16px rgba(34, 197, 94, 0.45);
}

.nav-status-off {
    background: transparent;
    box-shadow: none;
}

.nav-status-off::after {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12), 0 0 16px rgba(239, 68, 68, 0.35);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 4px;
    color: var(--muted);
    font-size: 13px;
}

.sidebar-footer-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: var(--radius);
    color: var(--muted);
    transition: background 0.15s, color 0.15s;
}

.sidebar-footer-help:hover {
    background: rgba(29, 143, 255, 0.12);
    color: var(--text);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.user-chip strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d8fff, #38d5ff);
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    box-shadow: 0 0 18px rgba(56, 213, 255, 0.24);
}

.sidebar-footer .logout-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 4px 6px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.sidebar-footer .logout-link:hover {
    background: rgba(29, 143, 255, 0.12);
    color: var(--text);
}

.main {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding: 36px;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
}

.auth-main {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 32px;
    align-items: center;
    padding: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.82);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.login-copy h1,
.hero h1,
.page-header h1 {
    margin: 8px 0 12px;
    font-size: 44px;
    line-height: 1.06;
}

.login-copy p,
.hero p,
.page-header p,
.panel p {
    color: var(--muted);
    line-height: 1.6;
}

.eyebrow {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.form,
.inline-form {
    display: grid;
    gap: 12px;
}

.inline-form {
    grid-template-columns: 1fr 1fr auto;
}

.checkbox-form {
    margin: 0;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 800;
}

.checkbox-label input {
    width: 16px;
    min-height: 16px;
}

label {
    color: var(--muted);
    font-size: 13px;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 9, 20, 0.72);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
}

select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 9, 20, 0.72);
    color: var(--text);
    padding: 12px 14px;
    font: inherit;
}

textarea {
    resize: vertical;
    line-height: 1.5;
}

button,
.button {
    min-height: 46px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--blue), #0cc9ff);
    color: #fff;
    padding: 0 18px;
    font-weight: 800;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.link-button {
    min-height: auto;
    padding: 0;
    background: transparent;
    color: var(--cyan);
    font-weight: 800;
}

.danger-link {
    color: var(--danger);
}

.button-disabled {
    cursor: default;
    color: var(--muted);
    background: rgba(154, 168, 199, 0.14);
}

.button-secondary {
    background: rgba(154, 168, 199, 0.14);
    color: var(--text);
}
.button-icon {
    padding: 6px 10px;
    min-width: 0;
    line-height: 1;
}
.wp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}
.wp-icon-btn.button-disabled { opacity: 0.4; cursor: default; }

.wp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3858e9;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 4px;
    margin-right: 5px;
    letter-spacing: 0.02em;
    line-height: 1.4;
}
.button-danger {
    background: transparent;
    border: 1px solid var(--color-danger, #e53e3e);
    color: var(--color-danger, #e53e3e);
    opacity: 0.6;
    transition: opacity 0.15s;
}
.button-danger:hover { opacity: 1; }

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.button-selected {
    background: rgba(56, 213, 255, 0.18);
    color: var(--cyan);
    border: 1px solid rgba(56, 213, 255, 0.46);
}

.button-selected-danger {
    background: rgba(255, 84, 112, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 84, 112, 0.35);
}

.flash {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(29, 143, 255, 0.12);
}

.flash-error {
    border-color: rgba(255, 84, 112, 0.35);
    background: rgba(255, 84, 112, 0.12);
}

.hero,
.page-header {
    max-width: 1280px;
    margin-bottom: 28px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-card[href] {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.dashboard-card[href]:hover {
    border-color: rgba(56, 213, 255, 0.45);
    background: rgba(56, 213, 255, 0.06);
    transform: translateY(-2px);
}

.clickable-row {
    cursor: pointer;
    transition: background 0.12s;
}

.clickable-row:hover {
    background: rgba(56, 213, 255, 0.06);
}

.metric-card,
.panel,
.table-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.78);
}

.metric-card {
    padding: 22px;
}

.metric-card strong {
    display: block;
    font-size: 32px;
}

.metric-card span {
    color: var(--muted);
}

.dashboard-card {
    display: grid;
    gap: 8px;
}

.dashboard-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-card-head span {
    min-width: 0;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-anomaly-panel {
    margin-top: 18px;
    margin-bottom: 18px;
}

.automation-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.mini-button {
    width: fit-content;
    margin-top: 6px;
    color: var(--cyan);
    font-weight: 800;
}

.panel {
    padding: 24px;
}

.legal-panel {
    max-width: 980px;
    display: grid;
    gap: 14px;
    line-height: 1.7;
}

.legal-panel h2 {
    margin: 10px 0 0;
    font-size: 18px;
}

.legal-panel p {
    margin: 0;
    color: var(--muted);
}

.plan-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: start;
}

.plan-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.compact-panel {
    padding: 16px 18px;
}

.compact-panel p {
    margin-bottom: 0;
}

.panel h2 {
    margin: 0 0 8px;
}

.split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.table-panel {
    overflow: auto;
}

.table-panel .form-actions-right,
.form-actions-right {
    justify-content: flex-end;
    padding: 16px;
}

.site-editorial-versions-panel {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.site-editorial-versions-panel .panel-title-row {
    margin-bottom: 2px;
}

.site-editorial-versions-panel textarea {
    min-height: 320px;
}

/* Seletor de versões: rótulo + pills numa linha organizada */
.jus-version-select {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.jus-version-select-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.jus-version-tab.is-locked {
    border-color: rgba(154, 168, 199, 0.2);
    background: rgba(154, 168, 199, 0.06);
    color: rgba(154, 168, 199, 0.72);
}

/* Cadeado dentro da pill (substitui o antigo texto "· usada") */
.jus-version-lock {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    opacity: 0.65;
}

.jus-version-lock svg {
    display: block;
}

/* Legenda explicando o cadeado, alinhada com o ícone */
.jus-version-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -6px 0 0;
    opacity: 0.85;
}

.jus-version-legend .jus-version-lock {
    margin-left: 0;
}

textarea[readonly] {
    opacity: 0.72;
    cursor: not-allowed;
}

.impulsos-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.impulsos-filter-bar {
    flex: 1;
    margin-bottom: 0;
}

.filter-select-sm {
    max-width: 180px;
}

.filter-select-md {
    max-width: 220px;
}

.impulsos-how-wrapper {
    margin-bottom: 22px;
}

.impulsos-how-panel {
    margin-bottom: 0;
    position: relative;
    padding-right: 70px;
}

.impulsos-how-panel .how-panel-next-step {
    margin-right: 0;
}

.how-panel-dismiss {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    cursor: pointer;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.how-panel-dismiss:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.how-panel-show-link {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 10px;
}

.how-panel-show-link:hover {
    color: var(--cyan);
}

.recovery-view-header {
    align-items: flex-start;
}

.recovery-title-with-badge {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
}

.recovery-title-copy {
    min-width: 0;
}

.recovery-title-copy h1 {
    margin: 4px 0 0;
}

.recovery-actions-grid {
    margin-top: 18px;
}

.table-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cyan);
    font-weight: 800;
}

.table-link-spaced {
    margin-left: 12px;
}

.table-action-form {
    display: inline-flex;
    margin-left: 12px;
    align-items: center;
    gap: 6px;
}

.history-import-status {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.3;
    white-space: normal;
}

.history-import-status.is-success {
    color: var(--success);
}

.history-import-status.is-error {
    color: var(--danger);
}

.inline-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.sites-actions-cell {
    white-space: nowrap;
}

.site-domain-cell strong,
.site-niche-line {
    display: block;
}

.site-niche-line {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}

.compact-form select {
    min-height: 34px;
    padding: 7px 10px;
}

.access-profile-create {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
}

.access-profile-create h2 {
    margin: 4px 0 0;
}

.access-profiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.access-profile-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(154, 168, 199, 0.05);
}

.access-profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.access-profile-head label {
    display: grid;
    gap: 7px;
    min-width: 260px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.access-profile-head input[readonly] {
    opacity: 0.72;
}

.permission-group {
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.permission-group + .permission-group {
    margin-top: 14px;
}

.permission-group h4 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 13px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.permission-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.permission-toggle span {
    position: relative;
    width: 34px;
    height: 18px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.permission-toggle span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: transform 0.16s ease, background 0.16s ease;
}

.permission-toggle input:checked + span {
    background: rgba(56, 213, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(56, 213, 255, 0.42);
}

.permission-toggle input:checked + span::after {
    transform: translateX(16px);
    background: var(--cyan);
}

.permission-toggle input:disabled + span {
    opacity: 0.7;
}

/* ── Integrações por site ──────────────────────────────────── */
.integ-table td,
.integ-table th { vertical-align: middle; }

.integ-site-name { line-height: 1.3; }
.integ-site-name strong { display: block; font-size: 13px; }
.integ-domain { font-size: 11px; color: var(--muted); }

.integ-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}
.integ-badge-on  { color: var(--cyan);   background: rgba(56,213,255,.08); }
.integ-badge-off { color: var(--muted);  background: rgba(148,163,184,.08); }

.integ-adsense-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.integ-state {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
}
.integ-state-ready           { color: #4ade80; background: rgba(74,222,128,.10); }
.integ-state-needs-attention { color: #fbbf24; background: rgba(251,191,36,.10); }
.integ-state-requires-review { color: #f87171; background: rgba(248,113,113,.10); }
.integ-state-getting-ready   { color: var(--muted); background: rgba(148,163,184,.10); }

.integ-suggest {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: #fbbf24;
}
/* ─────────────────────────────────────────────────────────── */

.permission-toggle strong {
    font-weight: 650;
}

.monthly-goals-panel {
    margin: 18px 0;
    padding-top: 16px;
}

.section-heading-compact {
    margin-bottom: 14px;
}

.goal-total-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.goal-total-strip span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(154, 168, 199, 0.05);
    font-size: 12px;
    font-weight: 750;
}

.goal-total-strip strong {
    color: var(--text);
}

.monthly-goals-table td {
    vertical-align: middle;
}

.monthly-goals-table td > strong {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.goal-progress {
    display: grid;
    gap: 7px;
    min-width: 180px;
}

.goal-progress div {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.goal-progress strong {
    color: var(--text);
    font-size: 17px;
}

.goal-progress span {
    color: var(--muted);
    font-size: 12px;
}

.goal-progress em {
    margin-left: auto;
    color: var(--cyan);
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.goal-progress i {
    position: relative;
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.goal-progress i::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--goal-progress, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.jus-generator-panel {
    margin-bottom: 18px;
}

.jus-queue-panel {
    margin-bottom: 18px;
}

.jus-queue-panel .history-head {
    align-items: center;
    padding: 18px 18px 8px;
}

.jus-queue-panel .history-head h2 {
    margin-bottom: 4px;
}

.jus-queue-panel table {
    margin-top: 2px;
}

.jus-page-header {
    display: flex;
    width: 100%;
    max-width: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.jus-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
    padding-right: 18px;
}

.jus-header-actions form {
    margin: 0;
}

.jus-header-button {
    position: relative;
    display: inline-grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border: 1px solid rgba(56, 213, 255, 0.28);
    border-radius: 12px;
    background: rgba(56, 213, 255, 0.1);
    color: var(--cyan);
}

.jus-header-button:hover {
    border-color: rgba(56, 213, 255, 0.55);
    background: rgba(56, 213, 255, 0.16);
}

.jus-gemini-button {
    background:
        linear-gradient(135deg, rgba(92, 124, 255, 0.28), rgba(20, 184, 166, 0.18)),
        rgba(56, 213, 255, 0.08);
}

.jus-generator-form {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr;
    gap: 14px;
}

.jus-generator-form label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

.jus-generator-form button {
    align-self: end;
}

.jus-field-wide {
    grid-column: span 2;
}

.jus-service-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 16px;
    align-items: end;
}

.jus-service-field > label:first-child,
.jus-service-select-row {
    min-width: 0;
}

.jus-service-select-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 10px;
    align-items: end;
}

.jus-service-select-row select {
    height: 44px;
    min-height: 44px;
    padding: 0 14px;
}

.jus-inline-check {
    display: inline-flex !important;
    min-height: 48px;
    grid-template-columns: none !important;
    grid-auto-flow: column;
    align-items: center;
    justify-content: start;
    gap: 8px !important;
    white-space: nowrap;
    color: var(--text);
}

.jus-inline-check input {
    width: 16px;
    height: 16px;
}

.jus-inline-check[hidden] {
    display: none !important;
}

.jus-destination-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 10px;
    align-items: end;
}

.jus-destination-row select {
    height: 44px;
    min-height: 44px;
    padding: 0 14px;
}

.jus-tracking-row {
    display: grid;
    grid-template-columns: minmax(440px, 1fr) minmax(140px, 0.14fr) minmax(150px, 0.15fr) minmax(170px, 0.16fr);
    gap: 14px;
    align-items: end;
}

.jus-generate-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.32fr);
    gap: 14px;
    align-items: stretch;
}

.jus-generate-row textarea {
    min-height: 74px;
    height: 74px;
    resize: vertical;
}

.jus-generate-row button,
.jus-generate-actions {
    height: 74px;
}

.jus-generate-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-self: end;
    align-content: end;
}

.jus-generate-actions button {
    width: 100%;
    height: 33px;
    min-height: 33px;
}

.jus-generate-actions button:first-child {
    height: 33px;
}

.jus-title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
}

.jus-title-line > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.jus-icon-button {
    position: relative;
    display: inline-grid;
    width: 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    align-self: end;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(154, 168, 199, 0.22);
    border-radius: 8px;
    background: rgba(176, 142, 53, 0.98);
    color: #fff;
}

.jus-edit-button {
    background: rgba(154, 168, 199, 0.18);
}

.jus-site-modal {
    max-width: 760px;
}

.jus-services-modal {
    width: min(1040px, 94vw);
    max-height: 90vh;
    overflow: auto;
}

.jus-services-form {
    display: grid;
    gap: 14px;
}

.jus-service-editor-head,
.jus-service-editor-row {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(220px, 0.55fr);
    gap: 12px;
    align-items: center;
}

.jus-service-editor-head {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.jus-service-editor-list {
    display: grid;
    gap: 8px;
    max-height: 54vh;
    overflow: auto;
    padding-right: 4px;
}

.jus-rules-modal {
    width: min(1040px, 94vw);
    height: min(920px, 92vh);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.jus-rules-form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.jus-version-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.jus-version-key {
    display: inline-flex;
    align-items: center;
}

.jus-version-tab,
.jus-version-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(154, 168, 199, 0.2);
    border-radius: 999px;
    background: rgba(154, 168, 199, 0.08);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.jus-version-tab.is-active {
    border-color: rgba(56, 213, 255, 0.46);
    background: rgba(56, 213, 255, 0.12);
    color: var(--cyan);
}

.jus-version-add {
    width: 34px;
    padding: 0;
    color: var(--text);
}

.jus-rules-form label {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    font-weight: 800;
    min-height: 0;
}

.jus-rules-form textarea {
    min-height: 0;
    height: 100%;
    resize: vertical;
    line-height: 1.55;
}

.jus-site-form {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 14px;
}

.jus-site-form label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

.jus-history-panel {
    padding: 18px;
}

.jus-history-panel th:last-child,
.jus-history-panel td:last-child {
    text-align: right;
}

.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.history-head h2 {
    margin: 0;
}

.jus-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.jus-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(176, 142, 53, 0.38);
    border-radius: 8px;
    background: rgba(176, 142, 53, 0.1);
    color: var(--text);
    font-weight: 800;
}

.jus-summary-chip strong,
.jus-site-token {
    display: inline-grid;
    min-width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #b08e35;
    color: #fff;
    font-size: 12px;
    font-weight: 950;
}

.jus-service-line {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.25;
}

.mini-copy-button {
    display: inline-flex;
    width: 36px;
    height: 36px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0;
    border: 1px solid rgba(154, 168, 199, 0.18);
    border-radius: 8px;
    background: rgba(154, 168, 199, 0.1);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
}

.trash-button::before,
.trash-button::after {
    content: none !important;
}

.jus-history-actions .trash-button {
    position: relative;
    background: rgba(154, 168, 199, 0.1);
    color: var(--text);
    border: 1px solid rgba(154, 168, 199, 0.18);
}

.jus-history-actions {
    min-width: 150px;
    gap: 12px;
    justify-content: flex-end;
}

.jus-history-actions .icon-button,
.jus-history-actions .mini-copy-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 8px;
    background: rgba(154, 168, 199, 0.1);
    color: var(--text);
    border: 1px solid rgba(154, 168, 199, 0.18);
}

.jus-score-cell {
    display: inline-flex;
    min-width: 68px;
    align-items: baseline;
    gap: 2px;
    padding: 5px 8px;
    border: 1px solid rgba(56, 213, 255, 0.22);
    border-radius: 8px;
    background: rgba(56, 213, 255, 0.07);
    color: var(--text);
}

.jus-score-cell strong {
    font-size: 17px;
}

.jus-score-cell span {
    color: var(--muted);
    font-size: 11px;
}

.jus-score-cell small {
    margin-left: 6px;
    color: var(--cyan);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.generated-preview {
    display: grid;
    gap: 12px;
}

.generated-meta-fields {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(154, 168, 199, 0.16);
    border-radius: 12px;
    background: rgba(154, 168, 199, 0.06);
}

.generated-quality-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(56, 213, 255, 0.24);
    border-radius: 12px;
    background: rgba(56, 213, 255, 0.07);
}

.generated-quality-card > div {
    display: grid;
    gap: 5px;
}

.generated-quality-card strong {
    color: var(--text);
    font-size: 30px;
    line-height: 1;
}

.generated-quality-card small {
    color: var(--cyan);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.generated-quality-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.generated-meta-row {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.generated-meta-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.generated-meta-row strong {
    min-width: 0;
    color: var(--text);
    font-size: 15px;
    line-height: 1.35;
}

.generated-summary {
    display: grid;
    gap: 8px;
}

.generated-summary .generated-meta-row {
    grid-template-columns: max-content minmax(0, 1fr) auto;
}

.generated-meta-row-heading {
    grid-template-columns: minmax(0, 1fr) auto !important;
}

.generated-summary p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.generated-quality-body {
    display: grid;
    gap: 10px;
}

.quality-toggle {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

.quality-toggle-arrow {
    display: inline-block;
    transition: transform 0.15s ease;
}

.quality-toggle.is-open .quality-toggle-arrow {
    transform: rotate(180deg);
}

.quality-checklist-wrap {
    padding-top: 4px;
}

.quality-checklist {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.checklist-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.checklist-item span {
    color: var(--muted);
}

.checklist-ok {
    color: #3ddc84;
}

.checklist-fail {
    color: #ff6b6b;
}

.generated-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 4px;
}

.generated-preview-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.generated-preview-single {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

.editorial-warning {
    background: rgba(255, 180, 0, 0.1);
    border: 1px solid rgba(255, 180, 0, 0.35);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #e8b800;
    line-height: 1.5;
    margin-top: 4px;
}

/* Callout de UI para links [REVISAR] pendentes — fora do corpo do artigo */
.revisar-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 180, 0, 0.09);
    border: 1px solid rgba(255, 180, 0, 0.32);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #f0c33c;
    line-height: 1.5;
    margin-top: 4px;
}

.revisar-callout svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #f0c33c;
}

.revisar-callout strong { color: #ffd873; font-weight: 800; }

/* Badge inline do [REVISAR] no corpo renderizado */
.revisar-badge {
    display: inline-block;
    background: rgba(255, 180, 0, 0.16);
    border: 1px solid rgba(255, 180, 0, 0.45);
    color: #ffd873;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 999px;
    vertical-align: middle;
    margin: 0 2px;
    white-space: nowrap;
}

.generated-rendered hr {
    border: 0;
    border-top: 1px solid rgba(154, 168, 199, 0.18);
    margin: 18px 0;
}

.modal-view-tabs {
    display: flex;
    gap: 4px;
    border-radius: 6px;
    background: var(--surface-2, rgba(255,255,255,.06));
    padding: 3px;
}

.modal-view-tab {
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--muted);
    transition: background 0.15s, color 0.15s;
}

.modal-view-tab.is-active {
    background: var(--accent, #5a72e4);
    color: #fff;
}

.modal-code-view {
    width: 100%;
    flex: 1 1 0;
    min-height: 280px;
    font-family: monospace;
    font-size: 12px;
    background: var(--surface-2, #111);
    color: var(--text);
    border: 1px solid var(--border, rgba(255,255,255,.1));
    border-radius: 8px;
    padding: 12px;
    resize: none;
    box-sizing: border-box;
}

.generated-preview h3 {
    margin: 10px 0 0;
}

.generated-preview pre {
    max-height: 360px;
    overflow: auto;
    padding: 16px;
    border: 1px solid rgba(154, 168, 199, 0.18);
    border-radius: 12px;
    background: rgba(2, 8, 20, 0.72);
    white-space: pre-wrap;
}

.generated-rendered {
    display: grid;
    max-height: 70vh;
    gap: 12px;
    overflow: auto;
    padding: 34px;
    border: 1px solid rgba(56, 213, 255, 0.18);
    border-radius: 12px;
    background: rgba(2, 8, 20, 0.72);
    color: var(--text);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
}

.generated-rendered h1,
.generated-rendered h2,
.generated-rendered h3,
.generated-rendered p,
.generated-rendered ul {
    margin: 0;
}

.generated-rendered h1 {
    color: var(--text);
    font-size: 34px;
    line-height: 1.16;
}

.generated-rendered h2 {
    margin-top: 16px;
    color: var(--cyan);
    font-size: 24px;
    line-height: 1.25;
}

.generated-rendered h3 {
    color: #7dd3fc;
    font-size: 19px;
}

.generated-rendered p,
.generated-rendered li {
    color: rgba(247, 251, 255, 0.86);
    font-size: 16px;
    line-height: 1.7;
}

.generated-rendered ul,
.generated-rendered ol {
    padding-left: 22px;
}

.generated-rendered a {
    color: var(--cyan);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: rgba(56, 213, 255, 0.45);
    text-underline-offset: 3px;
}

.status-button {
    cursor: pointer;
    font-family: inherit;
}

.jus-publication-modal {
    max-width: 760px;
}

.jus-publication-form {
    display: grid;
    gap: 14px;
}

.jus-publication-form label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

.page-loader,
.global-page-loader {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 8, 20, 0.58);
    backdrop-filter: blur(12px);
}

.page-loader[hidden],
.global-page-loader[hidden] {
    display: none;
}

.page-loader-card {
    display: grid;
    width: min(420px, 92vw);
    justify-items: center;
    gap: 12px;
    padding: 30px;
    border: 1px solid rgba(56, 213, 255, 0.25);
    border-radius: 18px;
    background: rgba(9, 17, 34, 0.9);
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.page-loader-card strong {
    font-size: 20px;
}

.page-loader-card p {
    margin: 0;
    color: var(--muted);
}

.loader-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(154, 168, 199, 0.2);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.mini-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 2px solid rgba(154, 168, 199, 0.28);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: -4px;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.section-title {
    margin: 28px 0 12px;
}

.section-title h2 {
    margin: 0 0 6px;
}

.section-title p {
    margin: 0;
    color: var(--muted);
}

.opportunity-view-header {
    position: relative;
    display: block;
    max-width: none;
    padding-right: 260px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
}

.back-link:hover {
    color: var(--text);
}

.opportunity-header-main {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.opportunity-header-badge {
    margin-top: -12px;
}

.opportunity-header-badge .site-badge {
    min-width: 88px;
    min-height: 64px;
}

.opportunity-header-copy {
    min-width: 0;
}

.opportunity-header-details {
    margin-top: 14px;
}

.opportunity-header-details p {
    margin-bottom: 8px;
}

.opportunity-view-header form {
    position: absolute;
    top: 0;
    right: 0;
    flex-shrink: 0;
}

.opportunity-view-header h1 {
    max-width: 1280px;
}

.view-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -6px 0 18px;
    padding: 10px 0 12px;
    border-bottom: 1px solid rgba(154, 168, 199, 0.08);
    background: transparent;
    backdrop-filter: none;
}

.view-tabs button {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--muted);
    background: rgba(154, 168, 199, 0.08);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.view-tabs button.is-active,
.view-tabs button.view-tab-active,
.view-tabs button:hover {
    color: var(--text);
    border-color: rgba(56, 213, 255, 0.68);
    background: rgba(56, 213, 255, 0.12);
}

.site-config-tabs {
    position: static;
    margin-top: 8px;
}

.view-period-filter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    min-height: 42px;
}

.view-period-filter > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.section-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.keyword-period-filter {
    margin-left: 0;
}

.summary-period-row {
    display: flex;
    justify-content: flex-end;
    margin: 12px 0;
}

.summary-period-row .view-period-filter {
    margin-left: 0;
}

.summary-metrics-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.summary-metrics-head .section-title {
    margin: 0;
}

.view-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    background: rgba(154, 168, 199, 0.08);
    color: var(--muted);
}

.tab-status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.035);
}

.tab-status-red {
    background: #ef4444;
}

.tab-status-orange {
    background: #f59e0b;
}

.tab-status-green {
    background: #22c55e;
}

.view-tab-active {
    border-color: rgba(56, 213, 255, 0.48);
    background: rgba(56, 213, 255, 0.14);
    color: var(--text);
    box-shadow: 0 0 24px rgba(56, 213, 255, 0.08);
}

.tab-panel[hidden] {
    display: none;
}

.tab-panel-active {
    animation: tabFade 140ms ease-out;
    max-width: 100%;
    min-width: 0;
}

.tab-panel[data-tab-panel="keywords"].tab-panel-active {
    display: flex;
    min-height: calc(100vh - 260px);
    flex-direction: column;
}

@keyframes tabFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.meta-row,
.decision-strip,
.score-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.meta-row {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

.ai-summary-card {
    max-width: 100%;
    min-width: 0;
    margin-bottom: 18px;
    padding: 26px;
    border: 1px solid rgba(56, 213, 255, 0.28);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(29, 143, 255, 0.18), rgba(56, 213, 255, 0.06)),
        rgba(11, 18, 34, 0.84);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}

.ai-summary-card h2 {
    margin: 6px 0 10px;
    font-size: 28px;
}

.ai-summary-card p {
    max-width: none;
    color: var(--muted);
}

.source-summary-card,
.empty-state-panel {
    max-width: 100%;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.78);
}

.source-summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.source-summary-grid span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid rgba(154, 168, 199, 0.16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(154, 168, 199, 0.06);
    font-size: 12px;
    font-weight: 800;
}

.source-summary-grid strong {
    color: var(--text);
}

.empty-state-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    min-height: 220px;
}

.empty-state-panel h2 {
    margin: 6px 0 8px;
}

.empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.keyword-planner-shell .table-panel {
    overflow-x: auto;
}

.keyword-planner-table {
    min-width: 1180px;
}

.decision-strip {
    margin-top: 18px;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.priority-high {
    color: #76f7b2;
    border-color: rgba(118, 247, 178, 0.4);
    background: rgba(118, 247, 178, 0.1);
}

.priority-medium {
    color: #ffbf66;
    border-color: rgba(255, 191, 102, 0.38);
    background: rgba(255, 191, 102, 0.1);
}

.priority-low {
    color: var(--muted);
    border-color: rgba(154, 168, 199, 0.28);
    background: rgba(154, 168, 199, 0.08);
}

.compact-table {
    max-height: 460px;
}

.keyword-diagnostic-table {
    flex: 1 1 auto;
    max-height: none;
    min-height: 520px;
}

.opportunity-decision-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    min-width: 0;
}

.decision-card {
    position: relative;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.78);
}

.decision-card-primary {
    border-color: rgba(56, 213, 255, 0.38);
    background: rgba(14, 165, 233, 0.1);
}

.decision-card-wide {
    grid-column: 1 / -1;
}

.decision-card h3 {
    margin: 6px 0 14px;
}

.optimization-selection-form {
    display: grid;
    gap: 16px;
    min-width: 0;
    overflow-x: clip;
    padding-bottom: 92px;
}

.recommendation-list,
.vertical-list {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.recommendation-list li,
.vertical-list li {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(154, 168, 199, 0.14);
    border-radius: var(--radius);
    background: rgba(154, 168, 199, 0.06);
}

.recommendation-list span,
.vertical-list span,
.vertical-list em,
.opportunity-insight span,
.link-suggestion span {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.recommendation-row > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: baseline;
}

.recommendation-row > div strong {
    margin-right: 4px;
}

.recommendation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.toggle-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.toggle-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-choice span {
    position: relative;
    width: 38px;
    height: 22px;
    border: 1px solid rgba(154, 168, 199, 0.24);
    border-radius: 999px;
    background: rgba(154, 168, 199, 0.16);
}

.toggle-choice span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--muted);
    transition: transform 140ms ease, background 140ms ease;
}

.toggle-choice input:checked + span {
    border-color: rgba(56, 213, 255, 0.46);
    background: rgba(56, 213, 255, 0.18);
}

.toggle-choice input:checked + span::after {
    transform: translateX(16px);
    background: var(--cyan);
}

.toggle-choice-card {
    margin-top: 6px;
}

.decision-card-with-toggle {
    padding-right: 132px;
}

.card-top-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
}

.selection-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(56, 213, 255, 0.24);
    border-radius: var(--radius);
    background: rgba(5, 9, 20, 0.92);
    backdrop-filter: blur(12px);
}

.selection-footer span {
    color: var(--muted);
}

.selection-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.optimization-selection-form > .selection-footer {
    position: fixed;
    right: 36px;
    bottom: 18px;
    left: calc(280px + 36px);
    z-index: 30;
}

.selection-footer-generating span,
.inline-processing-card,
.plan-generating-button,
.status-generating-line,
.suggested-change-generating > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-processing-card {
    display: flex;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(56, 213, 255, 0.28);
    border-radius: var(--radius);
    background: rgba(8, 47, 73, 0.24);
}

.inline-processing-card strong {
    display: block;
}

.inline-processing-card p {
    margin: 3px 0 0;
    color: var(--muted);
}

.optimization-selection-form.is-generating [data-plan-submit-button] {
    opacity: 0.82;
    pointer-events: none;
}

.mini-table th,
.mini-table td {
    padding: 10px 8px;
}

.mini-table-muted-value {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.opportunity-insight,
.link-suggestion {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(154, 168, 199, 0.14);
    border-radius: var(--radius);
    background: rgba(154, 168, 199, 0.06);
}

.link-suggestion-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.link-suggestion-head small {
    line-height: 1.35;
}

.link-suggestion .status-badge {
    color: var(--text);
    font-size: 11px;
}

.copy-line {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
}

.copy-button {
    position: relative;
    width: 30px;
    height: 30px;
    min-height: 30px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid rgba(56, 213, 255, 0.28);
    background: rgba(56, 213, 255, 0.08);
}

.cluster-mindmap {
    position: relative;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 42px minmax(230px, 1.05fr) 42px minmax(180px, 1fr);
    gap: 12px;
    align-items: center;
    margin-top: 18px;
}

.cluster-column {
    display: grid;
    gap: 10px;
}

.cluster-column-title {
    color: var(--cyan);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cluster-node,
.cluster-current-node {
    border: 1px solid rgba(154, 168, 199, 0.16);
    border-radius: var(--radius);
    background: rgba(154, 168, 199, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.cluster-node {
    display: grid;
    gap: 4px;
    padding: 12px;
}

.cluster-node span,
.cluster-current-node span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cluster-node strong,
.cluster-current-node strong {
    overflow-wrap: anywhere;
}

.cluster-node small,
.cluster-current-node small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cluster-node-source {
    border-color: rgba(56, 213, 255, 0.24);
    background: rgba(56, 213, 255, 0.08);
}

.cluster-node-pillar {
    border-color: rgba(255, 190, 48, 0.28);
    background: rgba(255, 190, 48, 0.08);
}

.cluster-node-future {
    position: relative;
    border-color: rgba(67, 232, 161, 0.22);
    background: rgba(67, 232, 161, 0.07);
}

.cluster-node-future::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 50%;
    width: 1px;
    height: 12px;
    background: linear-gradient(180deg, rgba(67, 232, 161, 0), rgba(67, 232, 161, 0.6));
}

.cluster-node-future::after {
    content: "";
    position: absolute;
    top: -17px;
    left: calc(50% - 4px);
    width: 8px;
    height: 8px;
    border-top: 1px solid rgba(67, 232, 161, 0.7);
    border-left: 1px solid rgba(67, 232, 161, 0.7);
    transform: rotate(45deg);
}

.cluster-node-muted {
    opacity: 0.74;
}

.cluster-current-node {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-color: rgba(56, 213, 255, 0.55);
    background: linear-gradient(135deg, rgba(56, 213, 255, 0.17), rgba(67, 232, 161, 0.08));
}

.cluster-current-node strong {
    font-size: 20px;
    line-height: 1.15;
}

.cluster-role-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cluster-role-badge {
    width: fit-content;
    padding: 4px 8px;
    border: 1px solid rgba(56, 213, 255, 0.3);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(56, 213, 255, 0.09);
    font-size: 10px;
    font-weight: 800;
}

.cluster-role-pilar    { border-color: rgba(139, 92, 246, 0.4); color: #a78bfa; background: rgba(139, 92, 246, 0.08); }
.cluster-role-satelite { border-color: rgba(56, 213, 255, 0.3); color: var(--cyan); background: rgba(56, 213, 255, 0.09); }

.role-select {
    padding: 4px 6px;
    font-size: 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
}

.derived-counter, .derived-cost-estimate {
    font-size: 13px;
    color: var(--text-muted);
}

.derived-cost-estimate { color: var(--cyan); }

.cluster-warning {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    color: #f87171;
    cursor: help;
}

.cluster-connector {
    position: relative;
    height: 2px;
    background: linear-gradient(90deg, rgba(56, 213, 255, 0.18), rgba(56, 213, 255, 0.75));
}

.cluster-connector-left::before,
.cluster-connector-right::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 9px;
    height: 9px;
    border-top: 2px solid rgba(56, 213, 255, 0.75);
    border-right: 2px solid rgba(56, 213, 255, 0.75);
}

.cluster-connector-left::before {
    right: -1px;
    transform: translateY(-50%) rotate(45deg);
}

.cluster-connector-right::after {
    right: -1px;
    transform: translateY(-50%) rotate(45deg);
}

.cluster-future-row {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(154, 168, 199, 0.12);
}

.cluster-future-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.cluster-future-grid .cluster-node {
    padding: 10px;
}

.cluster-future-grid .cluster-node span {
    font-size: 9px;
    letter-spacing: 0.1em;
}

.cluster-future-grid .cluster-node strong {
    font-size: 12px;
    line-height: 1.18;
}

.cluster-future-grid .cluster-node small {
    font-size: 10px;
}

@media (max-width: 1180px) {
    .cluster-mindmap {
        grid-template-columns: 1fr;
    }

    .cluster-connector {
        width: 2px;
        height: 28px;
        margin: 0 auto;
        background: linear-gradient(180deg, rgba(56, 213, 255, 0.18), rgba(56, 213, 255, 0.75));
    }

    .cluster-connector-left::before,
    .cluster-connector-right::after {
        right: 50%;
        top: auto;
        bottom: -1px;
        transform: translateX(50%) rotate(135deg);
    }

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

@media (max-width: 720px) {
    .cluster-future-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.content-brief-table td:last-child {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
}

.content-toggle {
    justify-content: flex-start;
}

.content-toggle-only {
    width: fit-content;
}

.cluster-classification {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid rgba(56, 213, 255, 0.26);
    border-radius: 999px;
    background: rgba(56, 213, 255, 0.075);
    color: var(--cyan);
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.cluster-classification-pillar {
    border-color: rgba(125, 92, 255, 0.42);
    background: rgba(125, 92, 255, 0.12);
    color: #c8bcff;
}

.cluster-classification-satellite {
    border-color: rgba(56, 213, 255, 0.3);
    background: rgba(56, 213, 255, 0.085);
    color: var(--cyan);
}

.cluster-classification-sub {
    border-color: rgba(20, 184, 166, 0.34);
    background: rgba(20, 184, 166, 0.1);
    color: #7ce7d7;
}

.cluster-classification-related {
    border-color: rgba(251, 191, 36, 0.36);
    background: rgba(251, 191, 36, 0.1);
    color: #facc6b;
}

.motivation-badge,
.gap-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.motivation-keyword {
    border: 1px solid rgba(34, 197, 94, 0.34);
    background: rgba(34, 197, 94, 0.1);
    color: #8af0a5;
}

.motivation-gap {
    border: 1px solid rgba(56, 213, 255, 0.34);
    background: rgba(56, 213, 255, 0.1);
    color: var(--cyan);
}

.motivation-commercial {
    border: 1px solid rgba(251, 146, 60, 0.38);
    background: rgba(251, 146, 60, 0.11);
    color: #fdba74;
}

.motivation-quick {
    border: 1px solid rgba(244, 114, 182, 0.36);
    background: rgba(244, 114, 182, 0.1);
    color: #f9a8d4;
}

.motivation-related {
    border: 1px solid rgba(251, 191, 36, 0.36);
    background: rgba(251, 191, 36, 0.1);
    color: #facc6b;
}

.gap-direct {
    border: 1px solid rgba(56, 213, 255, 0.34);
    background: rgba(56, 213, 255, 0.075);
    color: #a8edff;
}

.gap-none {
    border: 1px solid rgba(154, 168, 199, 0.2);
    background: rgba(154, 168, 199, 0.06);
    color: var(--muted);
}

.cluster-architecture-table th,
.cluster-architecture-table td {
    vertical-align: middle;
}

.cluster-architecture-table td:last-child {
    min-width: 320px;
    color: var(--muted);
    line-height: 1.45;
    white-space: normal;
}

.cluster-map-compact {
    margin-bottom: 10px;
}

.content-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid rgba(154, 168, 199, 0.22);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.content-status.is-loading {
    color: var(--cyan);
    border-color: rgba(56, 213, 255, 0.36);
    background: rgba(56, 213, 255, 0.08);
}

.content-status.is-loading::before {
    content: "";
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 2px solid rgba(56, 213, 255, 0.28);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.cluster-role-guest { background: rgba(168, 85, 247, 0.15); color: #c084fc; border-color: rgba(168, 85, 247, 0.35); }

.content-status.is-done {
    color: #76f7b2;
    border-color: rgba(118, 247, 178, 0.38);
    background: rgba(118, 247, 178, 0.1);
}

.pautas-batch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.pautas-related-url {
    color: var(--muted);
    font-size: 11px;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.pautas-related-url:hover { opacity: 1; color: var(--cyan); }

.quality-score-block {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(56, 213, 255, 0.07);
    border: 1px solid rgba(56, 213, 255, 0.18);
    border-radius: 10px;
    margin-bottom: 16px;
}
.quality-score-block .eyebrow { font-size: 10px; }
.quality-number { font-size: 32px; font-weight: 900; color: var(--cyan); }

.brief-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    white-space: nowrap;
}

.brief-action-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(56, 213, 255, 0.28);
    border-radius: 10px;
    background: rgba(56, 213, 255, 0.075);
    color: var(--cyan);
    font-size: 11px;
    font-weight: 900;
}

.brief-view-button {
    width: 34px;
    padding: 0;
}

.brief-modal-panel {
    width: min(1280px, calc(100vw - 44px));
    height: min(95vh, 980px);
    max-height: 95vh;
    overflow: auto;
}

.brief-modal-head {
    padding-right: 42px;
}

.brief-modal-head h2 {
    margin: 8px 0 12px;
}

.brief-modal-meta,
.brief-modal-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.brief-modal-toolbar {
    position: sticky;
    top: -26px;
    z-index: 2;
    margin: 20px -4px 22px;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(154, 168, 199, 0.16);
    background: rgba(5, 14, 28, 0.94);
    backdrop-filter: blur(12px);
}

.brief-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.brief-editor-grid label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.brief-editor-grid input,
.brief-editor-grid textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid rgba(154, 168, 199, 0.2);
    border-radius: 12px;
    background: rgba(2, 8, 20, 0.62);
    color: var(--text);
    font: 500 14px/1.55 Inter, system-ui, sans-serif;
}

.brief-editor-grid textarea {
    min-height: 112px;
    resize: vertical;
}

.brief-editor-grid .brief-code-field {
    min-height: 220px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}

.brief-field-wide {
    grid-column: 1 / -1;
}

.app-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    max-width: min(520px, calc(100vw - 48px));
    padding: 14px 16px;
    border: 1px solid rgba(56, 213, 255, 0.34);
    border-radius: 14px;
    background: rgba(3, 12, 27, 0.96);
    color: var(--text);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.content-selection-footer {
    margin-top: 14px;
}

.floating-content-footer {
    position: sticky;
    right: auto;
    bottom: 18px;
    left: auto;
    z-index: 32;
    box-shadow: 0 -12px 26px rgba(3, 7, 18, 0.28);
}

/* Barra flutuante única de "Novas Pautas" (Expansão Horizontal + Guest Posts) */
.floating-action-bar {
    position: fixed;
    right: 36px;
    bottom: 18px;
    left: calc(280px + 36px);
    z-index: 33;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 72px;
    padding: 14px 20px;
    background: rgba(11, 18, 34, 0.96);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 213, 255, 0.22);
    border-radius: 14px;
    box-shadow: 0 -12px 30px rgba(3, 7, 18, 0.35);
}

.floating-action-bar[hidden] { display: none; }

.floating-action-bar-summary {
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
}

.page-tab-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.page-tab-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.inline-icon-form {
    display: inline-flex;
    margin: 0;
}

.page-refresh-button {
    opacity: 0.78;
}

.page-mode-tabs {
    position: static;
    margin: 0 0 16px;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
}

.page-audit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.audit-card {
    min-height: 104px;
    padding: 16px;
    border: 1px solid rgba(154, 168, 199, 0.16);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.72);
}

.audit-card span,
.page-heading-list span,
.page-content-block span,
.suggested-change span:not(.drag-handle):not(.seo-score):not(.block-label-text):not(.status-pill):not(.placement-hint),
.compare-block span:not(.drag-handle):not(.seo-score):not(.block-label-text) {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.audit-card strong {
    display: block;
    color: var(--text);
    line-height: 1.45;
}

.audit-card-head,
.page-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.seo-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid rgba(154, 168, 199, 0.22);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0;
    white-space: nowrap;
}

.seo-score-scale {
    font-size: 9px;
    font-weight: 700;
    opacity: 0.55;
    margin-left: 1px;
}

.audit-card .seo-score,
.page-heading-list .seo-score,
.page-block-head .seo-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    margin: 0;
    line-height: 1;
    text-transform: none;
}

.decision-card > .eyebrow + .page-heading-list {
    margin-top: 12px;
}

.seo-score-good {
    color: #76f7b2;
    border-color: rgba(118, 247, 178, 0.38);
    background: rgba(118, 247, 178, 0.1);
}

.seo-score-medium {
    color: #ffbf66;
    border-color: rgba(255, 191, 102, 0.34);
    background: rgba(255, 191, 102, 0.1);
}

.seo-score-low {
    color: #ff6b8a;
    border-color: rgba(255, 107, 138, 0.34);
    background: rgba(255, 107, 138, 0.1);
}

.page-heading-list,
.page-content-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-heading-list li,
.page-content-block,
.compare-block,
.suggested-change {
    padding: 14px;
    border: 1px solid rgba(154, 168, 199, 0.14);
    border-radius: var(--radius);
    background: rgba(154, 168, 199, 0.055);
}

.page-heading-list li {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.page-content-block p,
.compare-block p {
    margin: 0;
    color: var(--text);
    line-height: 1.65;
}

.page-content-block p {
    font-weight: 300;
}

.page-block-h1,
.page-block-h2,
.page-block-h3 {
    background: rgba(56, 213, 255, 0.07);
}

.page-block-h1 {
    border-color: rgba(118, 247, 178, 0.32);
}

.page-block-h2 {
    border-color: rgba(56, 213, 255, 0.32);
}

.page-block-h3 {
    border-color: rgba(255, 191, 102, 0.3);
}

.page-block-h1 span {
    color: #76f7b2;
}

.page-block-h2 span {
    color: var(--cyan);
}

.page-block-h3 span {
    color: #ffbf66;
}

.page-block-h1 p,
.page-block-h2 p,
.page-block-h3 p {
    font-weight: 800;
}

.page-preview-grid,
.compare-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
    gap: 16px;
}

.page-preview-grid {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 150px;
}

.safe-application-card {
    position: fixed;
    right: 36px;
    bottom: 18px;
    left: calc(280px + 36px);
    z-index: 31;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 24px;
    min-height: 72px;
    padding-block: 14px;
    width: auto;
    background: rgba(11, 18, 34, 0.96);
    backdrop-filter: blur(14px);
}

.safe-application-card p {
    max-width: none;
    margin-bottom: 0;
    overflow: hidden;
    color: #e8f1ff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.safe-application-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.safe-application-actions form {
    display: flex;
    margin: 0;
}

.safe-application-actions .confirm-form {
    flex: 1 1 auto;
    min-width: 0;
}

.safe-application-actions .confirm-form button {
    width: 100%;
    max-width: none;
    background: var(--cyan);
    color: #000;
    font-weight: 600;
}

.safe-application-card button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    max-width: 190px;
    min-height: 42px;
    height: 42px;
    margin: 0;
    padding: 0 14px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.safe-application-card .button-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.safe-application-card [data-confirm-enhance-pending] {
    background: rgba(56, 213, 255, 0.12);
    border-color: rgba(56, 213, 255, 0.28);
    color: rgba(56, 213, 255, 0.7);
    white-space: nowrap;
    width: auto;
    min-width: max-content;
    padding-left: 16px;
    padding-right: 16px;
}

.ai-enhance-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: 6px;
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 800;
}

.ai-enhance-status.is-ready {
    color: var(--success);
}

.ai-enhance-status.is-error {
    color: var(--danger, #f87171);
    font-weight: 700;
}

/* Bloco com erro de geração: borda vermelha, badge visível */
.suggested-change.has-gen-error {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.06);
}

/* AJUSTE 1: após publicação (data-plan-implemented), todos os controles ficam readonly */
[data-plan-implemented] .toggle-choice input[type="checkbox"] {
    pointer-events: none;
    opacity: 0.45;
}
[data-plan-implemented] [data-plan-toggle-form] {
    pointer-events: none;
    opacity: 0.55;
}
/* Botões aprovar/rejeitar da aba Briefing também ficam desabilitados */
[data-plan-implemented] [data-action-form] button {
    pointer-events: none;
    opacity: 0.4;
    cursor: default;
}

.compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.suggested-change {
    margin-bottom: 12px;
    border-color: rgba(56, 213, 255, 0.28);
    background: rgba(56, 213, 255, 0.07);
}

.page-order-board {
    display: grid;
    gap: 12px;
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 8px;
    color: var(--muted);
    border: 1px solid rgba(56, 213, 255, 0.28);
    border-radius: 8px;
    background: rgba(56, 213, 255, 0.08);
    vertical-align: middle;
    cursor: grab;
}

.sortable-block-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-bottom: 8px;
}

.sortable-block-head > span:last-child,
.sortable-block-head .block-label-text {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}

.sortable-block-head .seo-score {
    line-height: 1;
    align-self: center;
    margin-top: 0;
    margin-bottom: 0;
}

.sortable-block-head .drag-handle {
    flex-shrink: 0;
    align-self: center;
    margin-right: 0;
    width: 26px;
    height: 26px;
}

.drag-handle-current {
    width: 26px;
    height: 26px;
    margin-right: 0;
    opacity: 0.78;
    background: rgba(163, 179, 209, 0.07);
    border-color: rgba(163, 179, 209, 0.22);
}

.drag-handle:hover {
    color: var(--cyan);
    border-color: rgba(56, 213, 255, 0.58);
    background: rgba(56, 213, 255, 0.14);
}

.drag-tip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(56, 213, 255, 0.3);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(56, 213, 255, 0.08);
    font-size: 13px;
    font-weight: 800;
}

[data-sortable-item] {
    transition: border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

[data-sortable-item].is-dragging {
    opacity: 0.55;
    border-color: rgba(56, 213, 255, 0.75);
    transform: scale(0.995);
}

[data-sortable-actions].is-saving-order {
    outline: 1px dashed rgba(56, 213, 255, 0.36);
    outline-offset: 6px;
}

[data-sortable-actions].order-saved {
    outline: 1px solid rgba(118, 247, 178, 0.45);
    outline-offset: 6px;
}

[data-sortable-actions].order-error {
    outline: 1px solid rgba(255, 84, 112, 0.45);
    outline-offset: 6px;
}

.current-page-block {
    border-color: rgba(163, 179, 209, 0.22);
    background: rgba(163, 179, 209, 0.045);
    opacity: 0.82;
}

.current-page-block span {
    color: var(--muted);
}

.muted-current-block {
    opacity: 0.68;
}

.placement-hint {
    display: block;
    margin-top: 7px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 700;
}

.embedded-plan-panel {
    margin-bottom: 14px;
}

.suggested-change-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.suggested-change-head > div {
    min-width: 0;
}

.suggested-change-head strong {
    display: block;
    margin-bottom: 7px;
}

.suggested-change-head .drag-handle + span,
.action-head .drag-handle + .eyebrow {
    display: inline-flex;
    vertical-align: middle;
}

.suggested-change-head .status-pill {
    display: inline-flex;
    margin: 0;
    font-style: normal;
}

.suggested-change-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.suggested-change-titleline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.suggested-change-titleline strong {
    margin-bottom: 0;
}

.plan-action-toggle {
    margin-top: 2px;
}

.page-preview-grid > div > .eyebrow {
    display: block;
    margin-bottom: 12px;
}

.page-preview-grid aside button + button {
    margin-top: 12px;
}

.page-preview-grid aside button {
    margin-right: 10px;
    margin-bottom: 10px;
}

.compare-grid > div {
    display: grid;
    align-content: start;
    gap: 12px;
}

.suggested-change pre {
    margin: 10px 0 0;
    white-space: pre-wrap;
    color: var(--text);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.copy-button.copy-done {
    border-color: rgba(118, 247, 178, 0.45);
    background: rgba(118, 247, 178, 0.12);
}

.cluster-map {
    display: grid;
    gap: 10px;
}

.cluster-map strong {
    padding: 13px;
    border: 1px solid rgba(56, 213, 255, 0.36);
    border-radius: var(--radius);
    color: var(--cyan);
    background: rgba(56, 213, 255, 0.08);
}

.cluster-map span {
    margin-left: 18px;
    padding: 10px 12px;
    border-left: 2px solid rgba(56, 213, 255, 0.35);
    background: rgba(154, 168, 199, 0.05);
}

.final-decision {
    margin-top: 18px;
}

.decision-checks {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.decision-checks span {
    padding: 12px;
    border: 1px solid rgba(118, 247, 178, 0.28);
    border-radius: var(--radius);
    color: #dfffee;
    background: rgba(118, 247, 178, 0.08);
}

.section-heading,
.page-header-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    max-width: none;
}

.page-header-row > div:first-child {
    min-width: 0;
}

.page-header-row .metrics-update-label {
    margin-left: auto;
}

.section-heading {
    margin: 28px 0 12px;
}

.section-heading h2 {
    margin: 0 0 6px;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.thin-count {
    color: var(--muted);
    font-weight: 300;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0 0 16px;
}

.filter-pagination-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
}

.filter-pagination-row .filters-bar,
.filter-pagination-row .pagination,
.filter-pagination-row .list-period-filter {
    margin: 0;
}

.list-period-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 0 auto;
}

.list-period-filter > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.filters-bar select {
    width: auto;
    min-width: 165px;
    min-height: 46px;
}

.filters-bar .filter-search {
    width: min(280px, 24vw);
    min-width: 220px;
    min-height: 46px;
}

.filters-bar .filter-clear-icon {
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
}

.filters-bar button,
.filters-bar .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    height: 46px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
}

.type-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.type-tab {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(154, 168, 199, 0.08);
    font-weight: 800;
}

.type-tab-active {
    color: var(--text);
    border-color: rgba(56, 213, 255, 0.42);
    background: rgba(56, 213, 255, 0.12);
}

.title-prefix {
    color: var(--muted);
    font-weight: 300;
}

.title-focus {
    font-weight: 900;
}

.keyword-strip {
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: min(100%, 980px);
    margin-top: 8px;
    white-space: nowrap;
}

.period-select {
    min-height: 34px;
    padding: 0 30px 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background-color: rgba(154, 168, 199, 0.08);
    font-size: 13px;
    font-weight: 800;
}

.period-select.period-chip-active {
    color: var(--text);
    border-color: rgba(56, 213, 255, 0.68);
    background-color: rgba(56, 213, 255, 0.14);
}

.filter-pagination-row .list-period-filter {
    justify-self: center;
}

.filter-pagination-row .pagination {
    justify-self: end;
}

.metrics-update-label {
    align-self: end;
    justify-self: end;
    padding: 8px 12px;
    border: 1px solid rgba(56, 213, 255, 0.2);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(56, 213, 255, 0.06);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.keyword-strip-label,
.opportunity-line-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.keyword-pill {
    display: inline-flex;
    max-width: min(100%, 520px);
    padding: 3px 8px;
    border: 1px solid rgba(56, 213, 255, 0.24);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(56, 213, 255, 0.08);
    font-size: 11px;
    font-weight: 800;
    overflow: visible;
}

.keyword-pill-main {
    color: #fff;
    border-color: rgba(56, 213, 255, 0.48);
}

.inline-modal-button {
    flex-shrink: 0;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cyan);
    font-weight: 900;
}

.property-card-active {
    border-color: rgba(74, 222, 128, 0.42);
    background: rgba(74, 222, 128, 0.08);
}

.property-card input:disabled {
    opacity: 0.8;
}

.property-badge {
    width: fit-content;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    font-size: 11px;
    font-weight: 900;
}

.active-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(56, 213, 255, 0.08);
    color: var(--muted);
}

.active-filter a {
    color: var(--cyan);
    font-weight: 800;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
}

.list-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.list-bottom-row .pagination {
    margin: 0;
}

.list-bottom-row .per-page-form {
    flex-shrink: 0;
}

.list-bottom-row .per-page-label select {
    max-width: 70px;
}

.table-panel + .pagination {
    margin: 14px 0 0;
}

.pagination-link,
.pagination-gap {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(154, 168, 199, 0.08);
    font-weight: 800;
}

.pagination-active {
    color: var(--text);
    border-color: rgba(56, 213, 255, 0.42);
    background: rgba(56, 213, 255, 0.14);
}

#opportunities-table,
#optimizations-table {
    width: 100%;
}

#opportunities-table th:last-child,
#optimizations-table th:last-child {
    text-align: center;
}

.keyword-all-link {
    font-size: 11px;
}

.inline-generate-form {
    display: grid;
    grid-template-columns: minmax(140px, 180px) auto;
    align-items: end;
    gap: 10px;
    min-width: min(100%, 420px);
}

.inline-generate-form label {
    margin: 0;
}

.inline-generate-form input[type="number"] {
    min-height: 44px;
}

.inline-generate-form .inline-generate-status {
    grid-column: 1 / -1;
    min-height: 18px;
    color: var(--muted);
    font-size: 12px;
}

.inline-generate-status.is-success {
    color: var(--green);
}

.inline-generate-status.is-error {
    color: var(--danger);
}

.url-cell {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.opportunity-url {
    display: block;
    max-width: 760px;
    margin-top: 7px;
    color: var(--cyan);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-url-link {
    cursor: copy;
}

.copy-url-link.copy-done {
    color: var(--success);
}

.properties-form {
    display: grid;
    gap: 18px;
}

.editor-form {
    display: grid;
    gap: 18px;
    max-width: 980px;
}

.editor-form label {
    display: grid;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.actions-grid {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.action-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.78);
    padding: 18px;
}

.action-approved {
    border-color: rgba(56, 213, 255, 0.5);
    background: rgba(29, 143, 255, 0.12);
}

.action-rejected {
    opacity: 0.62;
}

.action-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.action-head h3 {
    margin: 5px 0 0;
}

.action-head strong {
    color: var(--cyan);
}

.recovery-action-side {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.recovery-card-toggle {
    margin-top: 0;
    white-space: nowrap;
}

.action-card pre {
    margin: 16px 0;
    padding: 14px;
    overflow: auto;
    white-space: pre-wrap;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 9, 20, 0.72);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.55;
}

.action-form,
.confirm-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.status-approved {
    color: var(--cyan);
    border-color: rgba(56, 213, 255, 0.44);
    background: rgba(56, 213, 255, 0.1);
}

.status-rejected {
    color: var(--danger);
    border-color: rgba(255, 84, 112, 0.35);
    background: rgba(255, 84, 112, 0.08);
}

.confirm-form {
    margin: 16px 0;
}

.score-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-top: 16px;
    color: var(--muted);
}

.score-row strong {
    color: var(--cyan);
    font-size: 22px;
}

.property-card {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(11, 18, 34, 0.78);
    cursor: pointer;
}

.property-card input {
    width: 18px;
    min-height: 18px;
}

.property-card span {
    display: grid;
    gap: 5px;
}

.property-card small,
.empty-state {
    color: var(--muted);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

td small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.site-code-cell {
    width: 1%;
    max-width: 150px;
    white-space: nowrap;
}

.site-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    max-width: 140px;
    min-height: 48px;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--site-badge-bg, #0EA5E9);
    color: var(--site-badge-text, #fff);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.site-badge strong,
.site-badge small {
    display: block;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-badge strong {
    font-size: 24px;
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: 0;
    text-align: center;
}

.site-badge small {
    margin-top: 4px;
    color: inherit;
    font-size: 7px;
    font-weight: 650;
    line-height: 1.1;
    opacity: 0.86;
    text-align: center;
}

.uppercase-input {
    text-transform: uppercase;
}

.actions-cell {
    min-width: 330px;
    text-align: right;
    vertical-align: middle;
}

.action-buttons {
    display: flex;
    gap: 22px;
    align-items: center;
    justify-content: space-between;
}

.chart-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: rgba(56, 213, 255, 0.09);
    border: 1px solid rgba(56, 213, 255, 0.28);
}

.icon-actions {
    display: flex;
    justify-content: flex-end;
    gap: 22px;
    align-items: center;
    min-width: 300px;
    white-space: nowrap;
}

.icon-actions-wide {
    min-width: 370px;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cyan);
    font-weight: 400;
}

.ignore-action {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.open-link {
    position: relative;
}

.icon-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: var(--radius);
}

.reload-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 213, 255, 0.09);
    border: 1px solid rgba(56, 213, 255, 0.28);
}

.reload-button.disabled {
    background: rgba(154, 168, 199, 0.08);
    border-color: var(--line);
}

.reload-button.disabled .icon {
    opacity: 0.55;
}

.undo-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(154, 168, 199, 0.08);
    border: 1px solid var(--line);
}

.muted-link {
    color: var(--muted);
}

.muted-text {
    color: var(--muted);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(82px, 1fr));
    gap: 6px;
    min-width: 190px;
}

.current-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    gap: 6px;
    min-width: 292px;
}

.current-metrics span {
    display: grid;
    gap: 2px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(154, 168, 199, 0.06);
    font-size: 12px;
}

.current-metrics strong {
    color: var(--muted);
    font-size: 11px;
}

.combined-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    gap: 6px;
    min-width: 390px;
}

.combined-metrics > span {
    display: grid;
    grid-template-rows: auto auto;
    gap: 4px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(154, 168, 199, 0.06);
    font-size: 12px;
}

.combined-metrics em {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-style: normal;
    font-weight: 900;
}

.combined-metrics strong {
    color: var(--muted);
    font-size: 11px;
}

.summary-metrics-panel {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.summary-metrics-panel .section-title {
    margin-bottom: 0;
}

.summary-metrics-panel .combined-metrics {
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.summary-metrics-panel .combined-metrics > span {
    min-height: 74px;
    padding: 12px;
}

.summary-metrics-panel .combined-metrics em {
    font-size: 18px;
}

.metric-result {
    display: inline-flex;
    width: fit-content;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 900;
}

.metric-result.positive {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.32);
    background: rgba(74, 222, 128, 0.08);
}

.metric-result.negative {
    color: var(--danger);
    border-color: rgba(255, 84, 112, 0.28);
    background: rgba(255, 84, 112, 0.06);
}

#opportunities-table th:nth-child(2),
#opportunities-table td:nth-child(2) {
    width: 36%;
}

#opportunities-table th:nth-child(4),
#opportunities-table td:nth-child(4) {
    width: 118px;
}

#opportunities-table th:nth-child(5),
#opportunities-table td:nth-child(5) {
    width: 90px;
}

#opportunities-table th:nth-child(6),
#opportunities-table td:nth-child(6),
#optimizations-table th:last-child,
#optimizations-table td:last-child {
    width: 1%;
}

.business-result-card {
    display: inline-grid;
    gap: 3px;
    min-width: 106px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(154, 168, 199, 0.06);
}

.business-result-card span,
.business-result-card small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.business-result-card strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 950;
    white-space: nowrap;
}

@media (max-width: 2500px) {
    #opportunities-table th,
    #opportunities-table td,
    #optimizations-table th,
    #optimizations-table td {
        padding-left: 12px;
        padding-right: 12px;
    }

    #opportunities-table th:nth-child(2),
    #opportunities-table td:nth-child(2) {
        width: 34%;
    }

    #opportunities-table .opportunity-url,
    #optimizations-table .opportunity-url {
        max-width: 660px;
    }

    #opportunities-table .actions-cell,
    #optimizations-table .actions-cell {
        min-width: 0;
        width: 88px;
    }

    #optimizations-table .actions-cell {
        width: 132px;
    }

    #opportunities-table .icon-actions,
    #optimizations-table .icon-actions {
        min-width: 0;
        gap: 12px;
    }

    #opportunities-table .icon-actions form,
    #optimizations-table .icon-actions form {
        display: inline-flex;
        align-items: center;
        margin: 0;
    }

    #optimizations-table .icon-actions-wide {
        min-width: 0;
    }

    #opportunities-table .action-label,
    #optimizations-table .action-label {
        display: none;
    }

    #opportunities-table .icon-link,
    #optimizations-table .icon-link {
        width: 36px;
        height: 36px;
        justify-content: center;
        gap: 0;
        border: 1px solid rgba(56, 213, 255, 0.28);
        border-radius: var(--radius);
        background: rgba(56, 213, 255, 0.09);
    }

    #opportunities-table .ignore-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 0;
        color: var(--muted);
        border-color: var(--line);
        background: rgba(154, 168, 199, 0.06);
    }

    #opportunities-table .combined-metrics,
    #optimizations-table .combined-metrics {
        grid-template-columns: repeat(4, minmax(72px, 1fr));
        min-width: 320px;
    }

    #opportunities-table .combined-metrics > span,
    #optimizations-table .combined-metrics > span {
        padding: 7px 7px;
    }

    #opportunities-table .combined-metrics em,
    #optimizations-table .combined-metrics em {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 3px;
    }

    #opportunities-table .metric-result,
    #optimizations-table .metric-result {
        margin-left: 0;
    }

    .filter-pagination-row {
        gap: 12px;
    }

    .filter-pagination-row .filters-bar {
        min-width: 0;
    }

    .filter-pagination-row .pagination {
        min-width: 0;
    }

    .filter-pagination-row .pagination-link,
    .filter-pagination-row .pagination-gap {
        min-width: 32px;
        min-height: 32px;
        padding: 0 9px;
    }
}

@media (max-width: 2560px) {
    .sites-table .sites-actions-cell {
        text-align: right;
    }

    .sites-table .table-link,
    .sites-table .link-button {
        width: 34px;
        height: 34px;
        justify-content: center;
        gap: 0;
        padding: 0;
        border: 1px solid rgba(56, 213, 255, 0.28);
        border-radius: 8px;
        background: rgba(56, 213, 255, 0.08);
    }

    .sites-table .table-link-spaced,
    .sites-table .table-action-form {
        margin-left: 8px;
    }

    .sites-table .action-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    #opportunities-table .metric-result.muted-text,
    #optimizations-table .metric-result.muted-text {
        min-width: 34px;
        justify-content: center;
        font-size: 0;
    }

    #opportunities-table .metric-result.muted-text::after,
    #optimizations-table .metric-result.muted-text::after {
        content: "---";
        font-size: 11px;
    }
}

@media (max-width: 1500px) {
    .access-profiles {
        grid-template-columns: 1fr;
    }
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.metric-chart {
    min-height: 150px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(154, 168, 199, 0.06);
}

.metric-chart strong {
    font-size: 13px;
}

.metric-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-chart-head span {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 900;
}

.metric-line-chart svg {
    width: 100%;
    min-height: 108px;
    overflow: visible;
}

.chart-grid-line {
    fill: none;
    stroke: rgba(154, 168, 199, 0.12);
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-event-marker {
    fill: var(--warning);
    stroke: var(--bg);
    stroke-width: 2;
}

.search-console-chart {
    position: relative;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(5, 9, 20, 0.36);
}

.search-chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.search-chart-toolbar > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.chart-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-toggle {
    --chart-color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--chart-color);
    background: rgba(154, 168, 199, 0.07);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.chart-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chart-toggle span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.chart-toggle:has(input:checked) {
    color: var(--chart-color);
    border-color: var(--chart-color);
    background: color-mix(in srgb, var(--chart-color) 18%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chart-color) 34%, transparent);
}

.chart-toggle.chart-clicks {
    --chart-color: #4f8cff;
}

.chart-toggle.chart-impressions {
    --chart-color: #7c4dff;
}

.chart-toggle.chart-ctr {
    --chart-color: #34d399;
}

.chart-toggle.chart-position {
    --chart-color: #fbbf24;
}

.search-chart-canvas {
    position: relative;
}

.search-console-chart svg {
    width: 100%;
    min-height: 260px;
    overflow: visible;
}

.search-chart-hit-area {
    fill: transparent;
    cursor: crosshair;
}

.search-chart-grid {
    fill: none;
    stroke: rgba(154, 168, 199, 0.13);
    stroke-width: 1;
}

.search-chart-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-chart-line.chart-clicks {
    stroke: #4f8cff;
}

.search-chart-line.chart-impressions {
    stroke: #7c4dff;
}

.search-chart-line.chart-ctr {
    stroke: #34d399;
}

.search-chart-line.chart-position {
    stroke: #fbbf24;
}

.search-chart-event line {
    stroke: rgba(251, 191, 36, 0.26);
    stroke-width: 1;
    stroke-dasharray: 4 5;
}

.search-chart-event circle {
    fill: var(--warning);
    stroke: var(--bg);
    stroke-width: 3;
}

.search-chart-persistent-marker {
    pointer-events: none;
}

.search-chart-marker-pulse {
    fill: rgba(251, 191, 36, 0.16);
    stroke: rgba(251, 191, 36, 0.36);
    stroke-width: 1;
}

.search-chart-marker-dot {
    fill: var(--warning);
    stroke: var(--bg);
    stroke-width: 3;
}

.search-chart-persistent-marker.has-note:not(.has-event) .search-chart-marker-pulse {
    fill: rgba(56, 213, 255, 0.16);
    stroke: rgba(56, 213, 255, 0.42);
}

.search-chart-persistent-marker.has-note:not(.has-event) .search-chart-marker-dot {
    fill: var(--cyan);
}

.search-chart-persistent-marker.has-event.has-note .search-chart-marker-pulse {
    fill: rgba(34, 197, 94, 0.16);
    stroke: rgba(34, 197, 94, 0.44);
}

.search-chart-persistent-marker.has-event.has-note .search-chart-marker-dot {
    fill: #22c55e;
}

.search-chart-hover-line {
    stroke: rgba(226, 236, 255, 0.32);
    stroke-width: 1;
    stroke-dasharray: 3 4;
}

.search-chart-hover-dot {
    fill: var(--bg);
    stroke-width: 3;
}

.search-chart-hover-dot.chart-clicks {
    stroke: #4f8cff;
}

.search-chart-hover-dot.chart-impressions {
    stroke: #7c4dff;
}

.search-chart-hover-dot.chart-ctr {
    stroke: #34d399;
}

.search-chart-hover-dot.chart-position {
    stroke: #fbbf24;
}

.search-chart-tooltip {
    position: absolute;
    z-index: 5;
    width: min(280px, calc(100% - 24px));
    padding: 12px 14px;
    border: 1px solid rgba(154, 168, 199, 0.24);
    border-radius: 8px;
    color: var(--text);
    background: rgba(9, 16, 31, 0.98);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
    pointer-events: none;
}

.search-chart-tooltip > strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
}

.chart-tooltip-row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 9px;
    margin: 8px 0;
    color: var(--muted);
    font-size: 13px;
}

.chart-tooltip-row span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.chart-tooltip-row strong {
    color: var(--muted);
    font-size: 13px;
}

.chart-tooltip-row em {
    color: var(--text);
    font-style: normal;
    font-weight: 900;
}

.chart-tooltip-row.chart-clicks {
    color: #4f8cff;
}

.chart-tooltip-row.chart-impressions {
    color: #7c4dff;
}

.chart-tooltip-row.chart-ctr {
    color: #34d399;
}

.chart-tooltip-row.chart-position {
    color: #fbbf24;
}

.chart-tooltip-event,
.chart-tooltip-note {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid rgba(154, 168, 199, 0.16);
    color: var(--warning);
    font-size: 12px;
    line-height: 1.35;
}

.chart-tooltip-note {
    color: var(--cyan);
}

.search-chart-tooltip small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
}

.publish-action-form {
    display: inline-flex;
    align-items: end;
    gap: 10px;
}

.inline-date-field {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.inline-date-field input {
    height: 42px;
    min-width: 190px;
}

.chart-bars {
    min-height: 96px;
    display: flex;
    align-items: end;
    gap: 5px;
}

.chart-bars span {
    width: 100%;
    min-width: 5px;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, var(--cyan), rgba(29, 143, 255, 0.28));
}

.result-chip {
    display: grid;
    gap: 2px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 12px;
}

.result-chip strong {
    color: var(--text);
    font-size: 11px;
}

.result-chip.positive {
    border-color: rgba(56, 213, 255, 0.35);
    color: var(--cyan);
    background: rgba(56, 213, 255, 0.08);
}

.result-chip.negative {
    border-color: rgba(255, 84, 112, 0.25);
    color: var(--danger);
    background: rgba(255, 84, 112, 0.06);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tag {
    display: inline-flex;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 800;
}

.tag-link {
    color: var(--cyan);
}

.integration-status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.reason-chip {
    display: inline-flex;
    width: fit-content;
    margin: 0 3px;
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 400;
    line-height: 1.35;
    white-space: nowrap;
}

.opportunity-reasons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 6px;
    margin-top: 3px;
    line-height: 1.65;
}

.opportunity-reasons .reason-chip,
.reason-chip.reason-commercial,
.reason-chip.reason-ctr,
.reason-chip.reason-position {
    font-weight: 400;
}

.th-with-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    cursor: help;
}

.info-tooltip:hover,
.info-tooltip:focus {
    color: var(--cyan);
}

.info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 40;
    width: 260px;
    padding: 10px 12px;
    border: 1px solid rgba(56, 213, 255, 0.24);
    border-radius: 8px;
    background: rgba(6, 12, 24, 0.98);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    white-space: normal;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.info-tooltip:hover::after,
.info-tooltip:focus::after {
    opacity: 1;
    transform: translateY(0);
}

.link-detection-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.link-detection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.link-detection-status > span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(255, 84, 112, 0.12);
}

.link-detection-status.is-detected {
    color: #5dffac;
}

.link-detection-status.is-detected > span {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.button-small {
    min-height: 34px;
    padding: 8px 12px;
    font-size: 12px;
}

.reason-commercial {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.38);
    background: rgba(74, 222, 128, 0.1);
}

.reason-ctr {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.38);
    background: rgba(251, 191, 36, 0.1);
}

.reason-position {
    color: var(--cyan);
    border-color: rgba(56, 213, 255, 0.42);
    background: rgba(56, 213, 255, 0.1);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 2px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
}

.status-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.status-meta {
    display: block;
    margin-top: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.status-button.status-badge {
    height: 28px;
    min-height: 28px;
}

.status-success {
    color: #76f7b2;
    border-color: rgba(118, 247, 178, 0.38);
    background: rgba(118, 247, 178, 0.09);
}

.status-warning {
    color: #ffbf66;
    border-color: rgba(255, 191, 102, 0.38);
    background: rgba(255, 191, 102, 0.09);
}

.status-info {
    color: var(--cyan);
    border-color: rgba(56, 213, 255, 0.38);
    background: rgba(56, 213, 255, 0.09);
}

.status-error {
    color: #ff8b8b;
    border-color: rgba(239, 68, 68, 0.42);
    background: rgba(239, 68, 68, 0.1);
}

.status-neutral {
    color: var(--muted);
    border-color: var(--line);
    background: rgba(154, 168, 199, 0.08);
}

.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(2, 6, 15, 0.78);
    backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-panel {
    position: relative;
    width: min(1280px, 100%);
    height: 90vh;
    max-height: 90vh;
    overflow: auto;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #071225;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.modal-dynamic-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.modal-panel h2 {
    margin: 8px 0 8px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    background: rgba(154, 168, 199, 0.14);
    font-size: 24px;
    line-height: 1;
}

.modal-metrics {
    margin: 20px 0;
}

.modal-url-period {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 12px 0 18px;
}

.modal-url-period > div:first-child {
    min-width: 0;
}

.period-chips {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.period-chips span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.period-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(154, 168, 199, 0.18);
    border-radius: 999px;
    background: rgba(154, 168, 199, 0.08);
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.period-chip-active {
    border-color: rgba(34, 211, 238, 0.55);
    background: rgba(14, 165, 233, 0.2);
    color: var(--text);
}

.icon-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(154, 168, 199, 0.18);
    border-radius: 999px;
    background: rgba(154, 168, 199, 0.08);
    color: var(--muted);
    text-decoration: none;
    position: relative;
}

.icon-toggle-active {
    border-color: rgba(34, 211, 238, 0.55);
    background: rgba(14, 165, 233, 0.2);
    color: var(--text);
}

.icon-toggle[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: #0b1220;
    border: 1px solid rgba(154, 168, 199, 0.25);
    color: var(--text);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 5;
}

.assessment-row td {
    border-top: none;
    padding-top: 0;
    margin-top: 8px;
    padding-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
}

.assessment-row .assessment-text {
    display: inline-block;
    margin-top: 8px;
}

.muted-note {
    color: var(--muted);
    font-size: 12px;
}

.per-page-form {
    display: inline-flex;
}

.per-page-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.per-page-label select {
    min-height: 30px;
}

.assessment-row .assessment-icon {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 6px;
    color: #22d3ee;
}

.assessment-row.is-ai-ready .assessment-text {
    color: var(--text);
}

.assessment-row.is-ai-fallback .assessment-icon {
    color: var(--muted);
}

.modal-table {
    max-height: 300px;
}

.modal-keyword-table {
    flex: 1 1 320px;
    max-height: none;
    min-height: 260px;
}

.sort-header {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-transform: inherit;
}

.sort-arrows {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.sort-arrows i {
    display: block;
    width: 0;
    height: 0;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    opacity: 0.42;
}

.sort-arrows i:first-child {
    border-bottom: 5px solid currentColor;
}

.sort-arrows i:last-child {
    border-top: 5px solid currentColor;
}

.sort-header.sort-active {
    color: var(--accent);
}

.sort-header.sort-asc .sort-arrows i:first-child,
.sort-header.sort-desc .sort-arrows i:last-child {
    opacity: 1;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

@media (max-width: 860px) {
    .app-shell,
    .login-panel {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
        min-height: auto;
        overflow: visible;
    }

    .main {
        padding: 24px;
    }

    .optimization-selection-form {
        padding-bottom: 0;
    }

    .optimization-selection-form > .selection-footer {
        position: sticky;
        right: auto;
        bottom: 0;
        left: auto;
    }

    .floating-content-footer,
    .safe-application-card,
    .floating-action-bar {
        position: sticky;
        right: auto;
        bottom: 0;
        left: auto;
        width: auto;
    }

    .metric-grid,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .modal-url-period {
        align-items: flex-start;
        flex-direction: column;
    }

    .period-chips {
        justify-content: flex-start;
    }

    .login-panel {
        padding: 28px;
    }

    .login-copy h1,
    .hero h1,
    .page-header h1 {
        font-size: 34px;
    }

    .opportunity-view-header {
        padding-right: 0;
    }

    .opportunity-view-header form {
        position: static;
        margin-top: 14px;
    }
}

/* ── Tooltip JS Module ─────────────────────────────────────────────────────── */
.js-tooltip {
    position: absolute;
    z-index: 9999;
    max-width: 300px;
    padding: 8px 12px;
    background: var(--surface-3, #1e2130);
    color: var(--text, #e2e8f0);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    white-space: normal;
    word-break: break-word;
}
.js-tooltip[hidden] { display: none; }
.js-tooltip[data-pos="above"]::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom: none;
    border-top-color: var(--border, rgba(255,255,255,0.1));
}
.js-tooltip[data-pos="below"]::before {
    content: '';
    position: absolute;
    top: -5px; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent;
    border-top: none;
    border-bottom-color: var(--border, rgba(255,255,255,0.1));
}

/* ── SEO Score Breakdown Popover ─────────────────────────────────────────────── */
.seo-score[data-score-breakdown] {
    cursor: help;
    border-color: rgba(56, 213, 255, 0.28);
}

.score-popover {
    position: absolute;
    z-index: 9999;
    width: 280px;
    padding: 12px 14px;
    background: var(--surface-3, #1e2130);
    color: var(--text, #e2e8f0);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.45;
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}

.score-popover[hidden] { display: none; }

.score-popover-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.score-popover-row { margin-bottom: 10px; }
.score-popover-row:last-of-type { margin-bottom: 8px; }

.score-popover-row-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 4px;
}

.score-popover-row-head span { color: var(--text); font-weight: 600; }
.score-popover-row-head strong { color: var(--cyan); font-weight: 800; white-space: nowrap; }

.score-popover-bar {
    height: 4px;
    border-radius: 999px;
    background: rgba(154, 168, 199, 0.15);
    overflow: hidden;
}

.score-popover-bar span {
    display: block;
    height: 100%;
    background: var(--cyan, #38d5ff);
    border-radius: 999px;
}

.score-popover-detail {
    margin: 6px 0 0;
    padding-left: 16px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.score-popover-note {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 11px;
    color: var(--muted);
    opacity: 0.85;
    font-style: italic;
}

/* ── Help Icon ("?") ─────────────────────────────────────────────────────────── */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;   /* impede esticamento em contextos inline/flex */
    border-radius: 50%;
    background: rgba(120,120,130,0.10);
    border: 1px solid rgba(120,120,130,0.25);
    color: var(--text-muted, #9ca3af);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
    margin-left: 4px;
    padding: 0;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.help-icon:hover, .help-icon:focus {
    background: rgba(120,120,130,0.2);
    color: var(--text-secondary, #6b7280);
    outline: none;
    box-shadow: 0 0 0 2px rgba(120,120,130,0.25);
}

/* ── Página /ajuda ───────────────────────────────────────────────────────────── */
.ajuda-header { margin-bottom: 24px; }
.ajuda-header h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.ajuda-header p { color: var(--text-muted); font-size: 14px; margin: 0; }

.ajuda-search-wrap { position: relative; max-width: 480px; margin-bottom: 32px; }
.ajuda-search {
    width: 100%; padding: 10px 14px 10px 38px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 14px;
}
.ajuda-search:focus { outline: none; border-color: var(--indigo, #818cf8); }
.ajuda-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; width: 16px; height: 16px;
}

.faq-category { margin-bottom: 32px; }
.faq-category-title {
    font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    margin: 0 0 12px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.faq-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.faq-item[hidden] { display: none; }
.faq-q {
    width: 100%; text-align: left; padding: 14px 16px;
    background: var(--surface-2); border: none; color: var(--text);
    font-size: 14px; font-weight: 500; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    transition: background 0.15s;
}
.faq-q:hover { background: var(--surface-3, #1e2130); }
.faq-q[aria-expanded="true"] { background: var(--surface-3, #1e2130); }
.faq-chevron {
    flex-shrink: 0; width: 16px; height: 16px; color: var(--text-muted);
    transition: transform 0.2s;
}
.faq-q[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }
.faq-a {
    padding: 0 16px; max-height: 0; overflow: hidden;
    font-size: 14px; line-height: 1.65; color: var(--text-muted);
    transition: max-height 0.25s ease, padding 0.25s ease;
}
.faq-a.open { max-height: 600px; padding: 12px 16px 16px; }
.faq-a a { color: var(--cyan, #38d5ff); text-decoration: underline; }

.faq-empty { color: var(--text-muted); font-size: 14px; padding: 16px 0; display: none; }
.faq-empty.visible { display: block; }

.ajuda-chat-banner {
    margin-top: 40px; padding: 20px 24px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; display: flex; align-items: center; gap: 16px;
}
.ajuda-chat-banner p { margin: 0 0 12px; font-size: 14px; color: var(--text-muted); }
.ajuda-chat-banner strong { color: var(--text); font-size: 15px; }

/* ── Chat /ajuda/chat ────────────────────────────────────────────────────────── */
.chat-shell {
    display: flex; flex-direction: column;
    height: calc(100vh - 80px); max-width: 760px; margin: 0 auto;
}
.chat-messages {
    flex: 1; overflow-y: auto; padding: 24px 0;
    display: flex; flex-direction: column; gap: 16px;
}
.chat-msg { display: flex; gap: 12px; align-items: flex-start; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    background: var(--surface-3, #1e2130); color: var(--text-muted);
}
.chat-msg.user .chat-avatar { background: rgba(99,102,241,0.2); color: var(--indigo, #818cf8); }
.chat-bubble {
    max-width: 75%; padding: 12px 16px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; font-size: 14px; line-height: 1.6; color: var(--text);
}
.chat-msg.user .chat-bubble {
    background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3);
}
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble p:last-child { margin: 0; }
.chat-thinking { color: var(--text-muted); font-size: 13px; font-style: italic; }

.chat-input-area {
    padding: 16px 0; border-top: 1px solid var(--border);
    display: flex; gap: 8px; align-items: flex-end;
}
.chat-textarea {
    flex: 1; resize: none; min-height: 44px; max-height: 140px;
    padding: 10px 14px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 14px; line-height: 1.5;
    font-family: inherit;
}
.chat-textarea:focus { outline: none; border-color: var(--indigo, #818cf8); }
.chat-send {
    flex-shrink: 0; height: 44px; padding: 0 18px;
    background: var(--indigo, #818cf8); border: none; border-radius: 8px;
    color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: opacity 0.15s;
}
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Pedidores: catálogo serviços × produtos */
.pedidores-svc-head,
.jus-service-editor-list.pedidores-svc-list .jus-service-editor-row {
    grid-template-columns: 1fr 120px 56px;
}
/* wrapper da página /pedidores — ocupa o espaço restante do .main */
.pedidores-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* painéis que devem crescer até preencher a tela */
.pedidores-page [data-tab-panel].tab-panel-active,
.pedidores-page [data-tab-panel]:not([hidden]) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.pedidores-svc-panel {
    /* herdado do seletor acima */
}

.pedidores-svc-panel .jus-services-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* painel da lista de pedidores */
.pedidores-list-panel {
    overflow: hidden;
}

.pedidores-list-panel .mini-table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.pedidores-svc-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

.pedidores-svc-search {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--surface-2, rgba(255,255,255,0.05));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
}

.pedidores-svc-search:focus {
    outline: none;
    border-color: var(--cyan);
}
