/**
 * Stet shared UI components. Uses tokens only.
 */

/* Buttons */

.stet-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--stet-font-sans);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.4;
    padding: 11px 20px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.stet-btn:focus-visible {
    outline: 2px solid var(--stet-accent);
    outline-offset: 2px;
}

.stet-btn--small {
    font-size: 12px;
    padding: 7px 14px;
}

.stet-btn--primary {
    background: var(--stet-accent);
    color: var(--stet-accent-ink);
}

.stet-btn--primary:hover {
    filter: brightness(1.05);
}

.stet-btn--secondary {
    background: var(--stet-chip);
    border-color: var(--stet-line);
    color: var(--stet-ink);
}

.stet-btn--secondary:hover {
    background: var(--stet-surface-muted, #f5f5f4);
    border-color: var(--stet-muted);
}

.stet-btn--ghost {
    background: transparent;
    border-color: var(--stet-line);
    color: var(--stet-soft);
}

.stet-btn--ghost:hover {
    border-color: var(--stet-muted);
    color: var(--stet-ink);
}

.stet-btn--text {
    background: transparent;
    color: var(--stet-accent);
    padding: 0;
    text-decoration-skip-ink: auto;
}

.stet-btn--text:hover:not(:disabled) {
    text-decoration: underline;
}

:root[data-stet-theme="dark"] .stet-topbar__link {
    color: var(--stet-soft);
}

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

.stet-btn[hidden],
#stet-publish-submit[hidden],
#stet-topbar-save[hidden],
#stet-topbar-details-secondary[hidden] {
    display: none !important;
}

/* Switch */

.stet-switch {
    appearance: none;
    background: var(--stet-line);
    border: none;
    border-radius: var(--stet-radius-pill);
    box-sizing: border-box;
    cursor: pointer;
    display: inline-block;
    flex-shrink: 0;
    font-size: 0;
    height: 22px;
    line-height: 1;
    min-height: 22px;
    min-width: 38px;
    padding: 0;
    position: relative;
    transition: background 0.2s;
    width: 38px;
}

.stet-switch::after {
    background: var(--stet-canvas);
    border-radius: var(--stet-radius-pill);
    box-shadow: var(--stet-shadow-lift);
    content: "";
    height: 18px;
    left: 2px;
    position: absolute;
    top: 2px;
    transition: transform 0.2s;
    width: 18px;
}

.stet-switch[aria-checked="true"],
.stet-switch.is-on {
    background: var(--stet-accent);
}

.stet-switch[aria-checked="true"]::after,
.stet-switch.is-on::after {
    transform: translateX(16px);
}

.stet-switch:focus-visible {
    outline: 2px solid var(--stet-accent);
    outline-offset: 2px;
}

/* Segmented control */

.stet-segmented {
    background: var(--stet-chip);
    border-radius: var(--stet-radius-md);
    display: inline-flex;
    gap: 0;
    padding: 3px;
}

.stet-segmented__btn {
    appearance: none;
    background: transparent;
    border: none;
    border-radius: var(--stet-radius-sm);
    color: var(--stet-muted);
    cursor: pointer;
    font-family: var(--stet-font-sans);
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 14px;
    text-transform: capitalize;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.stet-segmented__btn[aria-pressed="true"],
.stet-segmented__btn.is-active {
    background: var(--stet-canvas);
    box-shadow: var(--stet-shadow-lift);
    color: var(--stet-ink);
}

.stet-segmented__btn:focus-visible {
    outline: 2px solid var(--stet-accent);
    outline-offset: 1px;
}

.stet-segmented__btn:disabled,
.stet-segmented__btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.62;
}

.stet-segmented__btn:disabled.is-active,
.stet-segmented__btn[aria-disabled="true"].is-active {
    background: transparent;
    box-shadow: none;
    color: var(--stet-muted);
}

.stet-segmented__btn--soon {
    align-items: center;
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.15;
    padding: 5px 12px;
}

.stet-segmented__btn-meta {
    color: var(--stet-muted);
    font-family: var(--stet-font-mono);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.stet-segmented--providers .stet-segmented__btn-text {
    line-height: 1.2;
}

/* Mono label */

.stet-mono {
    color: var(--stet-muted);
    font-family: var(--stet-font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.stet-mono--ink {
    color: var(--stet-ink);
}

.stet-mono--ok {
    color: var(--stet-ok);
}

.stet-mono--small {
    font-size: 10.5px;
    letter-spacing: 0.1em;
}

.stet-mono--accent {
    color: var(--stet-accent);
}

/* Inset field */

.stet-inset {
    background: var(--stet-chip);
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--stet-ink);
    font-family: var(--stet-font-serif);
    font-size: 14px;
    line-height: 1.5;
    padding: 10px 11px;
    width: 100%;
}

.stet-inset--mono {
    font-family: var(--stet-font-mono);
    font-size: 13px;
}

.stet-inset:focus {
    border-color: var(--stet-accent);
    outline: none;
}

.stet-inset[readonly],
.stet-inset--readonly {
    cursor: default;
}

/* Top bar */

.stet-topbar {
    align-items: center;
    background: var(--stet-canvas);
    border-bottom: 1px solid var(--stet-line-soft);
    display: grid;
    gap: 12px 16px;
    grid-template-columns: 1fr auto 1fr;
    padding: 16px 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.stet-topbar__wordmark {
    align-items: center;
    color: var(--stet-ink);
    display: inline-flex;
    font-family: var(--stet-font-display);
    font-size: 22px;
    font-style: italic;
    font-weight: 500;
    gap: 8px;
    justify-self: start;
    letter-spacing: -0.01em;
    line-height: 1;
    text-decoration: none;
}

.stet-topbar__wordmark-text {
    font: inherit;
    font-style: inherit;
    letter-spacing: inherit;
}

.stet-topbar__beta {
    border: 1px solid var(--stet-line-soft);
    border-radius: 999px;
    color: var(--stet-muted);
    font-family: var(--stet-font-sans);
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 3px 7px;
}

.stet-topbar__nav {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    justify-content: center;
    justify-self: center;
}

.stet-topbar__link {
    align-items: center;
    border-bottom: 1.5px solid transparent;
    color: var(--stet-muted);
    display: inline-flex;
    font-family: var(--stet-font-sans);
    font-size: 12.5px;
    letter-spacing: 0.02em;
    line-height: 1.2;
    min-height: 1.2em;
    padding-bottom: 3px;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.stet-topbar__link:hover {
    color: var(--stet-ink);
}

.stet-topbar__link.is-active {
    border-bottom-color: var(--stet-accent);
    color: var(--stet-ink);
}

.stet-topbar__trailing {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: flex-end;
    justify-self: end;
    min-width: 108px;
}

.stet-topbar__menu {
    position: relative;
}

.stet-topbar__menu-trigger {
    cursor: pointer;
    list-style: none;
}

.stet-topbar__menu-trigger::-webkit-details-marker {
    display: none;
}

.stet-topbar__menu-panel {
    background: var(--stet-canvas);
    border: 1px solid var(--stet-line-soft);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 168px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 100;
}

:root[data-stet-theme="dark"] .stet-topbar__menu-panel {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.stet-topbar__menu-item {
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--stet-ink);
    cursor: pointer;
    font-family: var(--stet-font-sans);
    font-size: 13px;
    padding: 8px 12px;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.stet-topbar__menu-item:hover:not(:disabled) {
    background: var(--stet-chip);
}

.stet-topbar__menu-item:disabled {
    color: var(--stet-muted);
    cursor: default;
}

.stet-topbar__menu-item[hidden] {
    display: none;
}

.stet-topbar__menu-divider {
    border: none;
    border-top: 1px solid var(--stet-border);
    margin: 4px 0;
}

.stet-topbar__plus {
    align-items: center;
    appearance: none;
    background: var(--stet-canvas);
    border: 1px solid var(--stet-line);
    border-radius: 7px;
    color: var(--stet-ink);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-family: var(--stet-font-sans);
    font-size: 18px;
    font-weight: 400;
    height: 32px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
    width: 32px;
}

.stet-topbar__plus:hover,
.stet-topbar__plus:focus-visible {
    border-color: var(--stet-muted);
    color: var(--stet-ink);
}

.stet-topbar__plus:focus-visible {
    outline: 2px solid var(--stet-accent);
    outline-offset: 2px;
}

.stet-panel-lifecycle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--stet-border);
}

@media (max-width: 1099px) {
    .stet-topbar {
        gap: 12px;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        padding: 14px 20px;
    }

    .stet-topbar__wordmark,
    .stet-topbar__leading {
        grid-column: 1;
        grid-row: 1;
    }

    .stet-topbar__trailing {
        grid-column: 2;
        grid-row: 1;
        gap: 10px;
        min-width: 0;
    }

    .stet-topbar__nav {
        flex-wrap: nowrap;
        gap: clamp(12px, 3vw, 20px);
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: center;
    }

    .stet-topbar__trailing #stet-topbar-save,
    .stet-topbar__trailing #stet-topbar-details-secondary {
        display: none !important;
    }
}

/* Public frontend strip (replaces WordPress admin bar) */

.stet-topbar--public {
    background: color-mix(in srgb, var(--stet-accent) 6%, var(--stet-app));
    border-bottom: 2px solid var(--stet-line);
    padding: 10px 34px;
}

.stet-topbar__leading {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 16px;
    justify-self: start;
    min-width: 0;
}

.stet-topbar__public-indicator {
    color: var(--stet-muted);
    display: flex;
    flex-direction: column;
    font-size: 10px;
    gap: 2px;
    letter-spacing: 0.04em;
    line-height: 1.2;
    max-width: 9rem;
}

.stet-topbar__public-indicator-primary {
    color: var(--stet-ink);
    font-size: 11px;
}

.stet-topbar__public-indicator-secondary {
    font-size: 10px;
}

.stet-topbar__public-user {
    color: var(--stet-muted);
    font-size: 12px;
}

.stet-topbar__public-logout {
    color: var(--stet-soft);
    font-family: var(--stet-font-sans);
    font-size: 12px;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.stet-topbar__public-logout:hover {
    color: var(--stet-accent);
}

@media (max-width: 1099px) {
    .stet-topbar--public {
        padding: 10px 20px;
    }

    .stet-topbar--public .stet-topbar__public-indicator {
        max-width: 7rem;
    }
}

@media (max-width: 640px) {
    .stet-topbar--public .stet-topbar__public-indicator-secondary {
        display: none;
    }
}

.stet-settings-tabs {
    display: flex;
    gap: 8px;
    margin: 24px 0 20px;
}

.stet-settings-tabs__btn {
    appearance: none;
    background: var(--stet-chip);
    border: 1px solid var(--stet-line-soft);
    border-radius: var(--stet-radius-pill);
    color: var(--stet-muted);
    cursor: pointer;
    font-family: var(--stet-font-sans);
    font-size: 13px;
    padding: 8px 16px;
}

.stet-settings-tabs__btn.is-active {
    background: var(--stet-ink);
    border-color: var(--stet-ink);
    color: var(--stet-canvas);
}

.stet-modal--email-preview {
    max-width: 540px;
}

.stet-email-preview-body {
    border: 1px solid var(--stet-line-soft);
    margin: 12px 0;
    max-height: 320px;
    overflow: auto;
    padding: 16px;
}

.stet-email-preview-note--error {
    color: var(--stet-danger, #b42318);
}

.stet-categories-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.stet-categories-list__item {
    align-items: center;
    border-bottom: 1px solid var(--stet-line-soft);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 8px 0;
}

.stet-categories-list__item:last-child {
    border-bottom: 0;
}

.stet-categories-list__main {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 10px;
    min-width: 0;
}

.stet-categories-list__name {
    flex: 1;
    min-width: 0;
}

.stet-categories-list__count {
    color: var(--stet-muted);
    flex-shrink: 0;
    font-family: var(--stet-font-mono);
    font-size: 12px;
}

.stet-categories-list__actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.stet-categories-list__confirm {
    color: var(--stet-muted);
    font-size: 13px;
}

.stet-categories-list__edit-input {
    flex: 1;
    min-width: 0;
}

.stet-categories-list__edit-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.stet-categories-status {
    font-size: 13px;
    margin: 12px 0 0;
}

.stet-categories-status.is-error {
    color: var(--stet-danger, #b42318);
}

.stet-sortable-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.stet-sortable-list__item {
    align-items: center;
    border-bottom: 1px solid var(--stet-line-soft);
    display: flex;
    gap: 10px;
    padding: 8px 0;
}

.stet-sortable-list__item:last-child {
    border-bottom: 0;
}

.stet-sortable-list__item.is-dragging {
    opacity: 0.45;
}

.stet-sortable-list__handle {
    color: var(--stet-muted);
    cursor: grab;
    flex-shrink: 0;
    font-family: var(--stet-font-mono);
    font-size: 14px;
    line-height: 1;
    user-select: none;
}

.stet-sortable-list__handle:active {
    cursor: grabbing;
}

.stet-sortable-list__item .stet-settings-checkbox {
    flex: 1;
    margin: 0;
}


.stet-wp-admin-link {
    align-items: center;
    color: var(--stet-muted);
    display: inline-flex;
    flex-shrink: 0;
    justify-content: center;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}

.stet-wp-admin-link:hover {
    color: var(--stet-accent);
}

.stet-wp-admin-link:focus-visible {
    outline: 2px solid var(--stet-accent);
    outline-offset: 2px;
}

.stet-wp-admin-link--topbar {
    border-radius: 7px;
    height: 32px;
    width: 32px;
}

.stet-wp-admin-link--topbar:hover {
    background: var(--stet-chip);
}

.stet-wp-admin-link--strip {
    height: 28px;
    width: 28px;
}

.stet-wp-admin-link__icon {
    display: block;
}

.stet-footer-link-fields {
    display: grid;
    gap: 10px;
    width: min(100%, 360px);
}

.stet-footer-preview {
    background: var(--stet-app);
    border: 1px solid var(--stet-line-soft);
    border-radius: 6px;
    color: var(--stet-muted);
    font-size: 0.85rem;
    padding: 16px 18px;
    width: min(100%, 360px);
}

.stet-footer-preview__line {
    margin: 0;
}

.stet-footer-preview__link {
    margin: 8px 0 0;
}

.stet-footer-preview__link span {
    color: var(--stet-soft);
    font-family: var(--stet-font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stet-footer-preview__embeds {
    margin-bottom: 12px;
}

.stet-footer-embed-preview__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: center;
}

.stet-footer-embed-preview__chip {
    background: var(--stet-chip);
    border-radius: 4px;
    color: var(--stet-soft);
    font-family: var(--stet-font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    padding: 4px 8px;
    text-transform: uppercase;
}

.stet-footer-embed-slots {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.stet-footer-embed-slot {
    align-items: flex-start;
    display: grid;
    gap: 8px;
    grid-template-columns: auto 1fr;
}

.stet-footer-embed-slot.is-disabled .stet-footer-embed-slot__input {
    opacity: 0.55;
}

.stet-footer-embed-slot .stet-sortable-list__handle {
    margin-top: 4px;
}

.stet-footer-embed-slot__body {
    display: grid;
    gap: 8px;
}

.stet-footer-embed-slot__toggle {
    margin: 0;
}

.stet-footer-embed-slot__input {
    background: var(--stet-chip);
    font-family: var(--stet-font-mono);
    font-size: 12px;
    line-height: 1.45;
    min-height: 72px;
    resize: vertical;
    width: 100%;
}

.stet-footer-embed-slot__pick {
    justify-self: start;
}

.stet-fee-modal {
    align-items: center;
    background: rgba(20, 17, 12, 0.35);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 4vh 16px;
    position: fixed;
    z-index: 100000;
}

:root[data-stet-theme="dark"] .stet-fee-modal {
    background: rgba(0, 0, 0, 0.55);
}

.stet-fee-modal__frame {
    background: #fff;
    border: 0;
    border-radius: var(--stet-radius, 4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    height: 100%;
    max-height: 760px;
    max-width: 1040px;
    width: 100%;
}

.stet-teaser-preview {
    margin: 12px auto 0;
    text-align: center;
}

.stet-teaser-preview__title {
    color: var(--stet-ink);
    font-weight: 600;
    margin: 0 0 8px;
}

.stet-teaser-preview__body {
    margin: 0 0 8px;
}

.stet-teaser-preview__link {
    color: var(--stet-soft);
    font-family: var(--stet-font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    margin: 0;
    text-transform: uppercase;
}

.stet-teaser-preview__note {
    margin: 10px 0 0;
}

.stet-audience-credentials-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.stet-audience-credentials-actions__hint {
    margin: 0;
}

.stet-look-preview {
    background: var(--stet-app);
    border: 1px solid var(--stet-line-soft);
    border-radius: 6px;
    color: var(--stet-soft);
    padding: 16px 18px;
    width: min(100%, 360px);
}

.stet-look-preview[data-stet-theme="light"],
.stet-look-preview:not([data-stet-theme]) {
    --stet-app: #f2f1ee;
    --stet-canvas: #fbfbf9;
    --stet-ink: #1f1d1a;
    --stet-soft: #524e48;
    --stet-muted: #847f76;
    --stet-line: #e2e0db;
    --stet-line-soft: #eeece8;
    --stet-accent: #b25733;
    --stet-chip: #e8e6e1;
}

.stet-look-preview[data-stet-theme="light"][data-stet-palette="warm"],
.stet-look-preview:not([data-stet-theme])[data-stet-palette="warm"] {
    --stet-app: #f1eadc;
    --stet-canvas: #fbf8f1;
    --stet-ink: #211c15;
    --stet-soft: #564d40;
    --stet-muted: #8c8474;
    --stet-line: #e4dbc9;
    --stet-line-soft: #efe8d9;
    --stet-chip: #ede4d2;
}

.stet-look-preview[data-stet-theme="light"][data-stet-palette="cool"],
.stet-look-preview:not([data-stet-theme])[data-stet-palette="cool"] {
    --stet-app: #e8ecef;
    --stet-canvas: #f7f9fb;
    --stet-ink: #1a1f24;
    --stet-soft: #4a5560;
    --stet-muted: #6b7580;
    --stet-line: #d4dce4;
    --stet-line-soft: #e8edf2;
    --stet-chip: #e2e8ee;
}

.stet-look-preview[data-stet-theme="light"][data-stet-palette="rose"],
.stet-look-preview:not([data-stet-theme])[data-stet-palette="rose"] {
    --stet-app: #f0e6e4;
    --stet-canvas: #faf6f4;
    --stet-ink: #2a1f1c;
    --stet-soft: #5c4a44;
    --stet-muted: #8a756c;
    --stet-line: #e6d8d3;
    --stet-line-soft: #f0e8e4;
    --stet-chip: #ede4e0;
}

.stet-look-preview[data-stet-theme="dark"] {
    --stet-app: #13110c;
    --stet-canvas: #1c1913;
    --stet-ink: #ece5d5;
    --stet-soft: #c9c0ae;
    --stet-muted: #a39a88;
    --stet-line: #2c281f;
    --stet-line-soft: #252118;
    --stet-accent: #d98a5e;
    --stet-chip: #272219;
}

.stet-look-preview__meta {
    color: var(--stet-muted);
    font-family: var(--stet-font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    margin: 0 0 12px;
    text-transform: uppercase;
}

.stet-look-preview__title {
    color: var(--stet-ink);
    font-family: var(--stet-font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 10px;
}

.stet-look-preview__body {
    color: var(--stet-soft);
    font-family: var(--stet-body);
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}

.stet-settings-row__copy--quiet {
    color: var(--stet-muted);
    font-size: 0.85rem;
    margin-top: 6px;
}

.stet-settings-save-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.stet-settings-autosave {
    color: var(--stet-muted);
    font-family: var(--stet-font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stet-settings-autosave.is-saving {
    color: var(--stet-soft);
}

.stet-settings-autosave.is-saved {
    color: var(--stet-ok);
}

.stet-settings-autosave.is-error {
    color: var(--stet-accent);
}

/* Card / panel */

.stet-card {
    background: var(--stet-canvas);
    border-radius: var(--stet-radius-xl);
    box-shadow: var(--stet-shadow-modal);
    padding: 40px 38px;
}

.stet-panel-section {
    margin-bottom: var(--stet-space-5);
}

.stet-panel-section__label {
    margin-bottom: var(--stet-space-2);
}

/* Group heading + divider between successive settings groups within a tab.
   The first group in each panel uses a plain .stet-panel-section__label, so
   the rule adds separation between groups without a stray line under the tabs. */
.stet-settings-group-head {
    border-top: 1px solid var(--stet-line-soft);
    margin: 34px 0 16px;
    padding-top: 26px;
}

/* A group heading that opens a tab panel (e.g. Advanced → SEO defaults) should
   not draw a divider directly under the tab bar. */
.stet-settings-panel > .stet-settings-group-head:first-child {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

/* Collapsible variant of the group heading above (Settings → Advanced),
   so a dense tab can be skimmed by section without hiding anything by
   default: every group renders open, same as before. */
.stet-settings-group-disclosure {
    border-top: 1px solid var(--stet-line-soft);
    margin: 34px 0 16px;
    padding-top: 26px;
}

.stet-settings-panel > .stet-settings-group-disclosure:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.stet-settings-group-disclosure > summary {
    cursor: pointer;
    margin-bottom: 16px;
}

/* Modal */

:root[data-stet-theme="dark"] .stet-modal-backdrop {
    background: rgba(0, 0, 0, 0.58);
}

.stet-modal-backdrop {
    align-items: center;
    background: rgba(20, 17, 12, 0.32);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 100000;
}

.stet-modal-backdrop[hidden] {
    display: none;
}

.stet-modal {
    background: var(--stet-canvas);
    border-radius: var(--stet-radius-xl);
    box-shadow: var(--stet-shadow-modal);
    max-width: 420px;
    padding: 32px 28px;
    text-align: center;
    width: calc(100% - 32px);
}

.stet-modal--settings {
    max-width: 480px;
    text-align: left;
}

.stet-modal__title {
    color: var(--stet-ink);
    font-family: var(--stet-font-display);
    font-size: 25px;
    font-weight: 500;
    line-height: 1.2;
    margin: 20px 0 10px;
}

.stet-modal__copy {
    color: var(--stet-soft);
    font-family: var(--stet-font-serif);
    font-size: 15.5px;
    line-height: 1.55;
    margin: 0 0 26px;
}

.stet-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.stet-modal__footer {
    border-top: 1px solid var(--stet-line-soft);
    margin-top: 22px;
    padding-top: 18px;
}

/* Slide-over */

.stet-slide-backdrop {
    background: rgba(20, 17, 12, 0.25);
    inset: 0;
    position: fixed;
    z-index: 99998;
}

.stet-slide-backdrop[hidden] {
    display: none;
}

.stet-slide-over {
    background: var(--stet-canvas);
    border-left: 1px solid var(--stet-line);
    box-shadow: var(--stet-shadow-slide);
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: 100%;
    overflow-y: auto;
    padding: 30px 28px;
    position: fixed;
    right: 0;
    top: 0;
    width: var(--stet-measure-panel);
    z-index: 99999;
}

.stet-slide-over[hidden] {
    display: none;
}

body.stet-admin-shell.stet-panel-open .stet-slide-backdrop,
body.stet-admin-shell.stet-panel-open .stet-slide-over {
    z-index: 100001;
}

.stet-slide-over__header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.stet-slide-over__title {
    color: var(--stet-ink);
    font-family: var(--stet-font-display);
    font-size: 23px;
    font-weight: 500;
    margin: 0;
}

/* Chip list */

.stet-chip-list {
    background: var(--stet-chip);
    border-radius: 10px;
    overflow: hidden;
}

.stet-chip-list__row {
    align-items: center;
    border-bottom: 1px solid var(--stet-line-soft);
    display: flex;
    justify-content: space-between;
    padding: 13px 16px;
}

.stet-chip-list__row:last-child {
    border-bottom: none;
}

.stet-chip-list__label {
    color: var(--stet-soft);
    font-family: var(--stet-font-sans);
    font-size: 14px;
}

/* Settings layout */

.stet-settings-page {
    margin: 0 auto;
    max-width: var(--stet-measure-settings);
    padding: 38px 24px 50px;
    width: 100%;
}

.stet-settings-row--checkbox {
    padding: 12px 0;
}

.stet-settings-checkbox {
    align-items: flex-start;
    color: var(--stet-soft);
    cursor: pointer;
    display: flex;
    font-family: var(--stet-font-serif);
    font-size: 16px;
    gap: 10px;
    line-height: 1.45;
}

.stet-settings-checkbox input[type='checkbox'] {
    flex-shrink: 0;
    margin-top: 4px;
}

.stet-settings-row {
    align-items: center;
    border-bottom: 1px solid var(--stet-line-soft);
    display: flex;
    justify-content: space-between;
    padding-bottom: 18px;
}

.stet-settings-row--switch {
    border-bottom: none;
    padding-bottom: 0;
}

.stet-settings-row--switch .stet-settings-row__copy,
.stet-settings-row--switch .stet-settings-row__copy-block {
    flex: 1 1 auto;
    margin-bottom: 0;
    min-width: 0;
}

.stet-settings-row--switch .stet-switch {
    align-self: center;
}

.stet-settings-switch-block {
    border-bottom: 1px solid var(--stet-line-soft);
    margin-bottom: 0;
    padding-bottom: 18px;
}

.stet-settings-switch-block .stet-settings-row__copy--quiet {
    margin-right: 0;
    margin-top: 6px;
}

.stet-settings-row__copy-block {
    flex: 1;
    min-width: 0;
}

.stet-settings-row__copy-block .stet-settings-row__mono {
    color: var(--stet-ink-soft);
    margin: 6px 0 0;
}

.stet-panel-broadcast-switch {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.stet-broadcast-status {
    margin: 0 0 6px;
}

.stet-broadcast-status--muted {
    opacity: 0.85;
}

.stet-broadcast-queue-summary {
    margin: 0 0 14px;
    opacity: 0.85;
}

.stet-settings-row__copy {
    color: var(--stet-soft);
    font-family: var(--stet-font-serif);
    font-size: 16px;
    line-height: 1.5;
    margin-right: var(--stet-space-4);
}

.stet-settings-knob {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stet-settings-knob[hidden] {
    display: none !important;
}

.stet-settings-knob__label {
    color: var(--stet-ink);
    flex-shrink: 0;
    font-family: var(--stet-font-sans);
    font-size: 14.5px;
    white-space: nowrap;
}

.stet-settings-knob--align-top {
    align-items: flex-start;
}

.stet-site-icon-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.stet-site-icon-picker__preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--stet-border-subtle, rgba(0, 0, 0, 0.12));
    background: var(--stet-surface-muted, #f5f5f4);
}

.stet-site-icon-picker__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.stet-site-icon-picker__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.stet-site-icon-picker__hint {
    color: var(--stet-soft);
    font-family: var(--stet-font-sans);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
    max-width: 28rem;
}

.stet-site-icon-picker__image,
.stet-site-icon-picker__letter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.stet-site-icon-picker__image[hidden],
.stet-site-icon-picker__letter[hidden] {
    display: none;
}

.stet-site-icon-monogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--stet-ink);
    color: var(--stet-canvas);
    font-family: var(--stet-font-mono, ui-monospace, monospace);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
}

.stet-site-icon-letter-input {
    width: 56px;
    text-align: center;
    text-transform: uppercase;
}

.stet-settings-knob > .stet-inset,
.stet-settings-knob > .stet-audience-api-key-field,
.stet-settings-knob > .stet-audience-field,
.stet-settings-knob > .stet-site-icon-picker {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

#stet-audience-setup,
.stet-audience-panel {
    padding-top: 18px;
}

#stet-audience-setup .stet-settings-knob,
.stet-audience-panel .stet-settings-knob {
    align-items: flex-start;
    gap: 16px;
}

#stet-audience-setup .stet-settings-knob__label,
.stet-audience-panel .stet-settings-knob__label {
    flex: 0 0 132px;
    line-height: 1.4;
    padding-top: 10px;
}

#stet-audience-setup .stet-audience-field,
.stet-audience-panel .stet-audience-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#stet-audience-setup .stet-audience-field .stet-inset,
.stet-audience-panel .stet-audience-field .stet-inset {
    width: 100%;
}

.stet-audience-panel__intro {
    margin-bottom: 24px;
    max-width: 32rem;
}

.stet-audience-provider-name {
    font-family: var(--stet-font-mono);
    font-size: 13px;
    margin: 10px 0 0;
}

.stet-audience-connect-callout {
    background: var(--stet-chip);
    border-radius: 10px;
    font-family: var(--stet-font-serif);
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0 0;
    max-width: 32rem;
    padding: 14px 16px;
}

.stet-audience-summary-card {
    align-items: center;
    background: var(--stet-chip);
    border-radius: 10px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 16px;
}

.stet-audience-summary-card__title {
    font-family: var(--stet-font-sans);
    font-size: 14.5px;
    font-weight: 500;
    margin: 0 0 4px;
}

.stet-audience-summary-card__status {
    color: var(--stet-muted);
    font-family: var(--stet-font-serif);
    font-size: 13.5px;
    line-height: 1.45;
    margin: 0;
}

.stet-audience-step + .stet-audience-step {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--stet-line-soft);
}

.stet-audience-previews__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stet-audience-previews__actions .stet-btn {
    align-self: flex-start;
}

.stet-audience-verify {
    border-top: 1px solid var(--stet-line-soft);
    margin-bottom: 0;
    margin-top: 4px;
    padding-top: 18px;
}

.stet-audience-verify__panel {
    gap: 10px;
}

.stet-audience-verify__state {
    font-family: var(--stet-font-serif);
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    padding-top: 10px;
}

.stet-audience-verify__state[data-state="verified"] {
    color: var(--stet-ok);
    font-family: var(--stet-font-mono);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.1em;
    line-height: 1;
    padding-top: 10px;
    text-transform: uppercase;
}

.stet-audience-verify__state[data-state="unverified"] {
    color: var(--stet-muted);
    font-family: var(--stet-font-mono);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.1em;
    line-height: 1;
    padding-top: 10px;
    text-transform: uppercase;
}

.stet-audience-verify__state[data-state="incomplete"] {
    color: var(--stet-ink);
}

.stet-audience-subscribers-field {
    gap: 4px;
}

.stet-audience-subscribers__count {
    color: var(--stet-ink);
    font-family: var(--stet-font-serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    padding-top: 10px;
}

.stet-audience-subscribers__footnote {
    color: var(--stet-soft);
    font-family: var(--stet-font-serif);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

.stet-audience-verify__footnote,
.stet-audience-verify__feedback {
    color: var(--stet-soft);
    font-family: var(--stet-font-serif);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

.stet-audience-verify__panel .stet-btn {
    align-self: flex-start;
    white-space: nowrap;
}

.stet-audience-card {
    align-items: center;
    background: var(--stet-chip);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding: 16px;
}

.stet-audience-card__title {
    color: var(--stet-ink);
    font-family: var(--stet-font-sans);
    font-size: 14.5px;
    font-weight: 500;
}

.stet-audience-card__sub {
    color: var(--stet-muted);
    display: block;
    font-family: var(--stet-font-serif);
    font-size: 13.5px;
    margin-top: 4px;
}


.stet-subscribers-shell .stet-drafts {
    padding-top: 24px;
}

.stet-subscribers__header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.stet-subscribers__header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stet-subscribers__import {
    margin-bottom: 16px;
}

.stet-subscribers__import-toggle {
    color: var(--stet-soft);
    cursor: pointer;
    font-family: var(--stet-font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    width: fit-content;
}

.stet-subscribers__import-form {
    align-items: flex-start;
    border: 1px solid var(--stet-line-soft);
    border-radius: var(--stet-radius-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    max-width: 520px;
    padding: 16px;
}

.stet-subscribers__import-consent {
    align-items: center;
    display: flex;
    gap: 8px;
}

.stet-subscribers__search {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.stet-subscribers__search-input {
    flex: 1 1 220px;
    max-width: 360px;
}

.stet-subscribers__filters {
    margin-bottom: 20px;
}

.stet-subscribers__filters .stet-segmented__btn {
    text-decoration: none;
}

.stet-subscribers__bulk-bar {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.stet-subscribers__checkbox {
    flex: 0 0 auto;
    margin-right: 8px;
}

.stet-subscribers__title-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.stet-subscribers__actions {
    flex-wrap: wrap;
}

.stet-subscribers__pagination {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.stet-subscribers__mode {
    border: 0;
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
}

.stet-subscribers__toast {
    bottom: 24px;
    left: 50%;
    position: fixed;
    transform: translateX(-50%);
    z-index: 100001;
}

/* Drafts list */

.stet-drafts {
    margin: 0 auto;
    max-width: var(--stet-measure-drafts);
    padding: 40px 24px;
    width: 100%;
}

.stet-drafts__controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.stet-drafts__search {
    align-items: center;
    display: flex;
    flex: 1 1 220px;
    gap: 8px;
    max-width: 360px;
}

.stet-drafts__search .stet-inset {
    flex: 1 1 auto;
}

.stet-drafts__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.stet-drafts__filter {
    color: var(--stet-muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
}

.stet-drafts__filter:hover {
    color: var(--stet-ink);
}

.stet-drafts__filter.is-active {
    color: var(--stet-ink);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.stet-drafts__row {
    border-bottom: 1px solid var(--stet-line-soft);
    padding: 22px 0;
}

.stet-drafts__row-link {
    color: inherit;
    display: block;
    text-decoration: none;
}

.stet-drafts__title-link {
    color: inherit;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
}

.stet-drafts__title-link:hover .stet-drafts__title {
    color: var(--stet-accent);
}

.stet-drafts__row-link:hover .stet-drafts__excerpt {
    color: var(--stet-soft);
}

.stet-drafts__head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.stet-drafts__head .stet-drafts__title {
    flex: 1 1 auto;
    min-width: 0;
}

.stet-drafts__head-actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    margin-left: auto;
}

.stet-drafts__head-actions .stet-drafts__unpublish,
.stet-drafts__head-actions .stet-drafts__trash {
    margin: 0;
}

.stet-settings-notice {
    background: color-mix(in srgb, var(--stet-accent) 10%, var(--stet-canvas));
    border: 1px solid var(--stet-line-soft);
    border-radius: var(--stet-radius-md);
    margin-bottom: 16px;
    padding: 14px 16px;
}

.stet-settings-notice code {
    font-family: var(--stet-font-mono);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.stet-modal__actions--row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.stet-modal--list,
.stet-modal--trash {
    max-width: 440px;
}

body.stet-list-modal-open {
    overflow: hidden;
}

body.stet-list-modal-open .stet-modal-backdrop {
    z-index: 100002;
}

.stet-drafts__head .stet-drafts__title {
    color: var(--stet-ink);
    font-family: var(--stet-font-display);
    font-size: 21px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0;
    transition: color 0.2s;
}

.stet-drafts__excerpt {
    color: var(--stet-soft);
    font-family: var(--stet-font-serif);
    font-size: 15px;
    line-height: 1.5;
    margin: 7px 0 9px;
}

.stet-drafts__meta {
    color: var(--stet-muted);
}

.stet-list-footer {
    margin-top: 28px;
}

body.stet-admin-shell .stet-pages-list,
body.stet-admin-shell .stet-drafts {
    margin: 0 auto;
    max-width: var(--stet-measure-composer);
    padding: 58px 34px 40px;
    width: 88%;
}

/* Writing mode banner (non-shell wp-admin) */

.stet-writing-mode-banner {
    background: color-mix(in srgb, var(--stet-accent) 12%, var(--stet-canvas));
    border-bottom: 1px solid var(--stet-line-soft);
    margin: 0 0 0 -20px;
    padding: 12px 20px;
}

body.stet-writing-mode-admin .stet-writing-mode-banner {
    margin-left: 0;
}

.stet-writing-mode-banner__text {
    color: var(--stet-ink);
    font-family: var(--stet-font-sans);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.stet-writing-mode-banner__text a {
    color: var(--stet-accent);
    margin-left: 0.35em;
    text-decoration: none;
    white-space: nowrap;
}

.stet-writing-mode-banner__text a:hover {
    text-decoration: underline;
}

/* Motion */

@keyframes stet-blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes stet-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.stet-animate-in {
    animation: stet-fade-up 0.45s ease;
}

.stet-caret {
    animation: stet-blink 1.1s step-end infinite;
    background: var(--stet-accent);
    display: inline-block;
    height: 1em;
    margin-left: 2px;
    transform: translateY(0.1em);
    width: 2px;
}

@media (max-width: 600px) {
    body.stet-admin-shell:not(.stet-screen-home) #wpwrap,
    body.stet-admin-shell:not(.stet-screen-home) #wpcontent,
    body.stet-admin-shell:not(.stet-screen-home) #wpbody,
    body.stet-admin-shell:not(.stet-screen-home) #wpbody-content {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.stet-admin-shell .stet-settings-shell,
    body.stet-admin-shell .wrap.stet-settings-shell {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .stet-settings-page {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        padding-left: 16px;
        padding-right: 16px;
    }

    .stet-settings-knob {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .stet-site-icon-picker,
    .stet-site-icon-picker__image,
    .stet-site-icon-picker__letter,
    .stet-site-icon-picker__actions,
    .stet-site-icon-picker__buttons {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .stet-settings-knob .stet-segmented,
    .stet-segmented {
        box-sizing: border-box;
        display: flex;
        flex-wrap: wrap;
        max-width: 100%;
        width: 100%;
    }

    .stet-segmented--providers {
        margin-left: auto;
        width: auto;
    }

    .stet-segmented--providers .stet-segmented__btn {
        flex: 0 1 auto;
    }

    #stet-audience-setup .stet-settings-knob__label,
    .stet-audience-panel .stet-settings-knob__label {
        flex: none;
        padding-top: 0;
    }

    .stet-audience-subscribers__count,
    .stet-audience-verify__state {
        padding-top: 0;
    }

    .stet-audience-verify {
        margin-top: 4px;
    }

    .stet-segmented__btn {
        flex: 1 1 auto;
        min-width: 0;
        padding: 6px 10px;
    }

    .stet-settings-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .stet-settings-row__copy {
        margin-right: 0;
    }

    .stet-inset {
        box-sizing: border-box;
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stet-animate-in,
    .stet-home-widget__progress-fill,
    .stet-caret,
    .stet-btn,
    .stet-switch,
    .stet-segmented__btn {
        animation: none;
        transition: none;
    }
}
