/* WordSpin AI application styles (Chrome). Header, footer and public-page
   styles live in chrome.css. */

/* ---------- @font-face ---------- */
@font-face { font-family: Sora; src: url('../fonts/Sora.ttf'); font-weight: 100 800; font-display: swap; }
@font-face { font-family: Inter; src: url('../fonts/Inter.ttf'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: JBM; src: url('../fonts/JetBrainsMono.ttf'); font-weight: 100 800; font-display: swap; }

/* ---------- CSS Variables ---------- */
:root {
    --bg: #05060b;
    --bg2: #0a0c16;
    --line: rgba(255, 255, 255, .12);
    --tx: #eef1fa;
    --mut: #9aa3bd;
    --cy: #2de0ff;
    --bl: #5a7bff;
    --mg: #d24dff;
    --grad: linear-gradient(100deg, #2de0ff, #5a7bff 50%, #d24dff);
    --solid: #3b55d6;

    /* names the page styles below already use */
    --navy: #eef1fa;
    --navy2: #cbd3ee;
    --em: #2de0ff;
    --em2: #8feeff;
    --teal: #5a7bff;
    --blue: #8fa6ff;
    --mint: rgba(90, 123, 255, .14);
    --sky: rgba(45, 224, 255, .10);

    --primary: #2de0ff;
    --primary-hover: #8feeff;
    --primary-light: rgba(90, 123, 255, .14);
    --cta: #2de0ff;
    --cta-hover: #8feeff;
    --cta-light: rgba(90, 123, 255, .14);
    --surface: #0a0c16;
    --card-bg: #0d1020;
    --card-border: rgba(255, 255, 255, .12);
    --text: #eef1fa;
    --text-light: #ffffff;
    --muted: #9aa3bd;
    --input-border: rgba(255, 255, 255, .2);
    --input-bg: #080a14;
    --shadow: 0 1px 3px rgba(0, 0, 0, .35);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
    --radius-sm: 9px;
    --radius: 12px;
    --radius-lg: 22px;
    --font-mono: JBM, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ---------- Reset & Base ---------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: Sora, sans-serif;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.1;
}

/* ---------- Container ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ---------- Headers ---------- */
.container > header, .main > header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.container > header h1, .main > header h1 {
    margin: 0 0 0.75rem;
    font-family: Sora, sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.container > header p, .main > header p {
    margin: 0;
    color: var(--mut);
    font-size: 1.2rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.12);
    padding: 1.5rem;
    border: 1.5px solid var(--line);
    color: var(--text);
}

/* ---------- Flash Messages ---------- */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.flash-success {
    background: var(--mint);
    color: #2de0ff;
    border: 1.5px solid rgba(90,123,255,.4);
}

.flash-danger {
    background: rgba(255,90,120,.14);
    color: #ff8aa0;
    border: 1.5px solid rgba(255,90,120,.4);
}

.flash-info {
    background: var(--sky);
    color: #8fa6ff;
    border: 1.5px solid rgba(90,123,255,.4);
}

/* ---------- Controls ---------- */
.controls {
    margin-bottom: 1.5rem;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 180px;
}

.control label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text);
}

.control small {
    font-weight: 400;
    color: var(--mut);
    font-size: 0.85rem;
    line-height: 1.5;
}

.control input,
.control select,
.form-control {
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.control input:focus,
.control select:focus,
.form-control:focus {
    border-color: var(--em);
    box-shadow: 0 0 0 3px rgba(90,123,255,.12);
}

.control input[type="range"] {
    padding: 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    accent-color: var(--em);
    margin-top: 0.5rem;
}

.versions-control {
    flex: 0.6;
    min-width: 120px;
}

.checkbox-control .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}

.checkbox-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--em);
}

.checkbox-control small {
    display: block;
    margin-top: 0.3rem;
    margin-left: 1.7rem;
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 1.5rem;
    justify-content: center;
    background: var(--mint);
    padding: 6px;
    border-radius: 16px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1.5px solid var(--line);
}

.tab-btn {
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: 11px;
    background: transparent;
    color: var(--mut);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tab-btn:hover {
    background: rgba(15,18,34,.7);
    color: var(--text);
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--em);
    box-shadow: 0 3px 10px rgba(0,0,0,.24);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ---------- Editor ---------- */
.editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .editor {
        grid-template-columns: 1fr;
    }
}

.panel {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    overflow: hidden;
    min-width: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    background: linear-gradient(110deg, #0f1222, #0f1222);
    border-bottom: 1.5px solid var(--line);
}

.panel-header h2 {
    margin: 0;
    font-family: Sora, sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stats {
    color: var(--mut);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ---------- Textareas ---------- */
textarea {
    flex: 1;
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
    line-height: 1.7;
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    border-color: var(--em);
    box-shadow: 0 0 0 3px rgba(90,123,255,.12);
}

/* ---------- Panel Actions ---------- */
.panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    background: #0f1222;
}

.panel-actions .btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
}

/* ---------- Quill Editor ---------- */
.quill-editor {
    flex: 1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.quill-editor .ql-toolbar {
    border: none;
    border-bottom: 1.5px solid var(--input-border);
    background: var(--card-bg);
    padding: 0.5rem;
}

.ql-toolbar.ql-snow {
    border-color: var(--line);
    background: #0f1222;
}

.ql-container.ql-snow {
    border-color: var(--line);
    font-family: inherit;
}

.quill-editor .ql-container {
    border: none;
    flex: 1;
    font-size: 1rem;
    line-height: 1.7;
}

.quill-editor .ql-editor {
    color: var(--text);
    padding: 1rem;
}

.quill-editor .ql-editor.ql-blank::before {
    color: var(--mut);
    font-style: normal;
}

.quill-editor.focused,
.quill-editor .ql-editor:focus {
    outline: none;
}

.quill-editor .ql-toolbar button {
    color: var(--text);
}

.quill-editor .ql-toolbar button:hover,
.quill-editor .ql-toolbar button:focus {
    color: var(--em);
}

.quill-editor .ql-active {
    color: var(--em) !important;
}

.quill-editor .ql-stroke {
    stroke: currentColor;
}

.quill-editor .ql-fill {
    fill: currentColor;
}

/* ---------- Editor Visibility ---------- */
#rewritten-editor.hidden,
#original-editor.hidden {
    display: none;
}

/* ---------- Spintax Output ---------- */
.spintax-output {
    min-height: 300px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    resize: vertical;
}

/* ---------- Preview List ---------- */
.preview-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    padding: 1rem;
    background: var(--surface);
    border-left: 4px solid var(--em);
}

.preview-item p {
    margin: 0;
    color: var(--text);
    line-height: 1.7;
}

/* ---------- Plagiarism ---------- */
.plagiarism-score-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.plagiarism-score {
    font-family: Sora, sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    min-width: 90px;
    text-align: center;
}

.plagiarism-level {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.plagiarism-level.low {
    background: var(--mint);
    color: #2de0ff;
}

.plagiarism-level.medium {
    background: rgba(255,200,97,.14);
    color: #ffc861;
}

.plagiarism-level.high {
    background: rgba(255,90,120,.14);
    color: #ff8aa0;
}

.plagiarism-detail {
    margin: 0.25rem 0 0;
    color: var(--mut);
    font-size: 0.9rem;
}

.plagiarism-matches {
    max-height: 400px;
    overflow-y: auto;
}

.plagiarism-match {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border-left: 4px solid var(--em);
}

.plagiarism-match.matched {
    border-left-color: var(--em);
}

.plagiarism-match.no-match {
    border-left-color: var(--input-border);
    opacity: 0.8;
}

.plagiarism-match-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.plagiarism-match-phrase {
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 200px;
}

.plagiarism-badge,
.plagiarism-risk-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.plagiarism-badge {
    background: var(--mint);
    color: var(--em);
}

.plagiarism-risk-badge {
    background: var(--mint);
    color: #2de0ff;
}

.plagiarism-risk-badge.none {
    background: #0f1222;
    color: var(--mut);
}

.plagiarism-risk-badge.low {
    background: var(--mint);
    color: #2de0ff;
}

.plagiarism-risk-badge.medium {
    background: rgba(255,200,97,.14);
    color: #ffc861;
}

.plagiarism-risk-badge.high {
    background: rgba(255,90,120,.14);
    color: #ff8aa0;
}

/* ---------- API Keys ---------- */
.api-key-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.api-key-form .control {
    flex: 1;
    min-width: 250px;
}

.created-key {
    background: var(--mint);
    border: 1.5px solid var(--em);
}

.created-key .warning {
    color: #ffc861;
    font-weight: 600;
}

.key-display {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.key-display code {
    flex: 1;
    min-width: 250px;
    word-break: break-all;
    background: var(--bg);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--input-border);
    font-size: 0.95rem;
}

/* ---------- Data Table ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1.5px solid var(--line);
}

.data-table th {
    font-weight: 600;
    color: var(--mut);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table code {
    font-size: 0.85rem;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--mint);
    color: #2de0ff;
}

.badge-danger {
    background: rgba(255,90,120,.14);
    color: #ff8aa0;
}

/* ---------- Endpoints ---------- */
.endpoint {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.endpoint h4 {
    margin: 0 0 0.5rem;
    color: var(--em);
}

.endpoint p {
    margin: 0 0 0.75rem;
    color: var(--mut);
}

.endpoint pre {
    margin: 0;
    max-width: 100%;
    overflow-x: auto;
}

/* ---------- API Keys Mobile ---------- */
@media (max-width: 640px) {
    body.api-keys-page {
        overflow-x: hidden;
    }
    body.api-keys-page .container,
    body.api-keys-page main,
    body.api-keys-page .card,
    body.api-keys-page .endpoint,
    body.api-keys-page .api-key-form,
    body.api-keys-page .key-display {
        max-width: 100%;
        min-width: 0;
    }
    body.api-keys-page .api-key-form .control,
    body.api-keys-page .key-display code,
    body.api-keys-page .api-key-form input,
    body.api-keys-page .api-key-form select,
    body.api-keys-page .api-key-form textarea {
        max-width: 100%;
        min-width: 0;
    }
    body.api-keys-page .table-scroll,
    body.api-keys-page .data-table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
    body.api-keys-page pre,
    body.api-keys-page code,
    body.api-keys-page .endpoint pre,
    body.api-keys-page .endpoint code {
        max-width: 100%;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        overflow-x: auto;
    }
}

.inline-form {
    display: inline;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: 2px solid transparent;
    border-radius: 99px;
    font-family: Sora, sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
    line-height: 1.4;
    background: #0f1222;
    border-color: var(--line);
    color: var(--navy);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

.btn:active {
    transform: translateY(1px);
}

.btn.primary {
    border: 0;
    color: #05060b;
    background: var(--grad);
    box-shadow: 0 12px 28px rgba(90,123,255,.38), inset 0 1px 0 rgba(0,0,0,.55);
}

.btn.primary:hover {
    background: var(--grad);
}

.btn.secondary {
    background: var(--bg);
    color: var(--text);
    border-color: var(--line);
    box-shadow: none;
}

.btn.secondary:hover {
    background: var(--mint);
    border-color: var(--em);
}

.btn.danger {
    background: #0f1222;
    color: #ff8aa0;
    border-color: rgba(255,90,120,.4);
}

.btn.danger:hover {
    background: rgba(255,90,120,.14);
    border-color: rgba(255,90,120,.4);
}

.btn.navy {
    background: var(--bg2);
    color: #fff;
    border-color: var(--navy);
}

.btn.navy:hover {
    background: var(--bg2);
}

.btn.small {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

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

/* ---------- Spinner ---------- */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.18);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner:not(:empty) {
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    animation: none;
}

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

/* ---------- Hidden / Error ---------- */
.hidden {
    display: none !important;
}

.error {
    background: rgba(255,90,120,.14);
    color: #ff8aa0;
    border: 1.5px solid rgba(255,90,120,.4);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    font-weight: 500;
}

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10,12,22,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-content {
    width: 100%;
    max-width: 450px;
    padding: 1.5rem;
}

.modal-content.wide {
    max-width: 800px;
}

.modal-content h3 {
    margin-top: 0;
    font-family: Sora, sans-serif;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.modal-hint {
    color: var(--mut);
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.modal-content label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.modal-content input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
}

.modal-content input:focus {
    border-color: var(--em);
    box-shadow: 0 0 0 3px rgba(90,123,255,.12);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ---------- WordPress HTML ---------- */
.wordpress-html {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: var(--bg2);
    color: #8fa6ff;
    resize: vertical;
}

/* ---------- Auth Pages ---------- */
.auth-container {
    max-width: 420px;
    margin: 3rem auto;
    position: relative;
}

.auth-container:before {
    content: "";
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    background: url('../brand/chrome/icon-small.svg') center/contain no-repeat;
}

.auth-container h2 {
    text-align: center;
    margin-top: 0;
    font-family: Sora, sans-serif;
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--mut);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-size: 0.9rem;
}

.form-group input {
    background: #0f1222;
    border-radius: 12px;
}

.form-error {
    color: #ff8aa0;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group label {
    margin: 0;
    font-weight: 400;
    color: var(--mut);
}

.full-width {
    width: 100%;
}

.auth-link {
    text-align: center;
    margin-top: 1.25rem;
    color: var(--mut);
    font-size: 0.95rem;
}

.auth-link a {
    color: var(--em);
    font-weight: 600;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

.auth-forgot {
    text-align: center;
    font-size: 0.9rem;
}

.auth-forgot a {
    color: var(--em);
    font-weight: 600;
    text-decoration: none;
}

.auth-forgot a:hover {
    text-decoration: underline;
}

.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
    color: var(--mut);
    font-weight: 500;
    font-size: 0.9rem;
}

.oauth-divider::before,
.oauth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1.5px solid var(--line);
}

.oauth-divider span {
    padding: 0 0.75rem;
}

.google-btn {
    background: var(--bg);
    color: var(--text);
    border-color: var(--line);
    box-shadow: none;
    border-radius: 99px;
}

.google-btn:hover {
    background: var(--surface);
    border-color: var(--input-border);
}

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

/* ---------- Feature Pills ---------- */

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

/* ---------- Feature Grid ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 22px;
    border: 1.5px solid var(--line);
    padding: 2rem;
    box-shadow: 0 14px 34px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.12);
    color: var(--text);
}

.feature-card h3 {
    margin-top: 0;
    font-family: Sora, sans-serif;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--mut);
    margin: 0 0 1rem;
    line-height: 1.6;
}

.feature-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-card li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text);
    font-size: 0.95rem;
}

.feature-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--em);
    font-weight: 800;
}

/* ---------- Article List ---------- */
.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-list-item {
    padding: 1rem 0;
    border-bottom: 1.5px solid var(--line);
}

.article-list-item:last-child {
    border-bottom: none;
}

.article-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
}

.article-checkbox {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--em);
}

.article-info {
    min-width: 0;
}

.article-title-link {
    color: var(--em);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
}

.article-title-link:hover {
    text-decoration: underline;
}

.article-meta {
    display: block;
    color: var(--mut);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.modal-editor {
    margin-bottom: 0;
}

.modal-editor .panel {
    min-height: 250px;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    color: var(--mut);
    font-size: 0.9rem;
}

/* ---------- History ---------- */
.history-preview {
    color: var(--mut);
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.history-text {
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.history-text h4 {
    margin: 0.5rem 0 0.25rem;
    font-family: Sora, sans-serif;
    color: var(--text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.history-text p {
    margin: 0 0 0.75rem;
    white-space: pre-wrap;
    color: var(--text);
}

/* ---------- Bulk ---------- */
.bulk-note {
    margin-bottom: 1.5rem;
    background: rgba(255,200,97,.14);
    border-color: rgba(255,200,97,.4);
}

.bulk-note p {
    margin: 0 0 0.5rem;
    color: var(--text);
}

.bulk-note ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
    color: var(--mut);
}

.bulk-note li {
    margin-bottom: 0.25rem;
}

.bulk-note-hint {
    color: var(--text);
    font-size: 0.95rem;
}

.bulk-warning {
    background: rgba(255,90,120,.14);
    color: #ff8aa0;
    border: 1.5px solid rgba(255,90,120,.4);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.bulk-progress {
    text-align: center;
    font-weight: 600;
    color: var(--text);
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 22px;
    border: 1.5px solid var(--line);
    box-shadow: 0 14px 34px rgba(0,0,0,.3);
}

.bulk-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .bulk-item { grid-template-columns: 1fr; }
}

.bulk-item .panel {
    min-height: auto;
}

.bulk-item textarea {
    min-height: 180px;
}

.bulk-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bulk-item-header h3 {
    margin: 0;
    font-family: Sora, sans-serif;
    font-size: 1rem;
    color: var(--text);
    font-weight: 800;
}

/* ---------- Summary Label ---------- */
.summary-label {
    color: var(--em);
    font-weight: 700;
}

details summary {
    cursor: pointer;
    color: var(--em);
    font-weight: 600;
    font-size: 0.9rem;
}

details summary:hover {
    text-decoration: underline;
}

/* ---------- SEO ---------- */
.seo-controls {
    align-items: flex-start;
}

.seo-controls .control {
    width: 100%;
}

.seo-controls label {
    color: var(--em);
    font-weight: 600;
}

.custom-synonyms-control {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-synonyms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.synonym-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--mint);
    color: var(--em);
    border: 1.5px solid var(--em);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.synonym-tag .remove-synonym {
    background: transparent;
    border: none;
    color: var(--em);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.1rem;
}

.synonym-tag .remove-synonym:hover {
    color: #ff8aa0;
}

.custom-synonym-inputs {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.custom-synonym-inputs input {
    flex: 1;
    min-width: 180px;
}

.custom-synonym-inputs .btn {
    padding: 0.55rem 1rem;
}

.lsi-keywords-container {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid var(--line);
}

.lsi-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.lsi-keyword-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.lsi-keyword-item:hover {
    border-color: var(--em);
    background: var(--mint);
}

.lsi-keyword-item input {
    margin: 0;
    cursor: pointer;
}

/* ---------- Usage ---------- */
.usage-summary {
    margin-bottom: 1.5rem;
}

.usage-meter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0.75rem 0 0.25rem;
}

.usage-meter-line {
    margin: 0;
    font-size: 0.85rem;
    color: var(--mut);
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.usage-grid div {
    display: flex;
    flex-direction: column;
}

.usage-label {
    font-size: 0.8rem;
    color: var(--mut);
    margin-bottom: 0.2rem;
}

/* ---------- Affiliate ---------- */
.affiliate-subnav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1.5px solid var(--line);
    flex-wrap: wrap;
}

.affiliate-nav-link {
    padding: 0.6rem 1rem;
    color: var(--mut);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.affiliate-nav-link:hover {
    color: var(--em);
}

.affiliate-nav-link.active {
    color: var(--em);
    border-bottom-color: var(--em);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-box {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-box .stat-number {
    font-family: Sora, sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
}

.stat-box .stat-label {
    font-size: 0.8rem;
    color: var(--mut);
    font-weight: 500;
}

.stat-box.pending .stat-number {
    color: #ffc861;
}

.stat-box.paid .stat-number {
    color: #2de0ff;
}

.referral-link-box {
    margin-top: 0.5rem;
}

.materials-toolbar {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--mint);
    border-radius: var(--radius);
}

.materials-toolbar code {
    word-break: break-all;
    font-size: 0.85rem;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.material-card {
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.material-card h3 {
    margin: 0 0 0.35rem;
    font-family: Sora, sans-serif;
    font-size: 1rem;
    font-weight: 800;
}

.material-content {
    margin: 0.75rem 0;
    background: var(--bg2);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    overflow-x: auto;
}

.material-content pre {
    margin: 0;
    color: #8fa6ff;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.material-preview {
    margin: 0.75rem 0;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #0f1222;
}

.material-preview-frame {
    width: 100%;
    height: 270px;
    border: 0;
    display: block;
}

/* ---------- PPC Preview ---------- */
.ppc-preview {
    padding: 1rem;
    background: #0f1222;
}

.ppc-ad {
    max-width: 100%;
    font-family: Arial, sans-serif;
}

.ppc-sponsored {
    font-size: 0.75rem;
    font-weight: 700;
    color: #eef1fa;
    margin-bottom: 0.15rem;
}

.ppc-headline {
    font-size: 1.1rem;
    color: #8fa6ff;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.15rem;
}

.ppc-url {
    font-size: 0.8rem;
    color: #5fe3b0;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.ppc-desc {
    font-size: 0.85rem;
    color: #eef1fa;
    line-height: 1.45;
    white-space: pre-wrap;
}

/* ---------- Email Preview ---------- */
.email-preview {
    padding: 0.75rem;
    background: #0f1222;
}

.email-client {
    background: #0f1222;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.36);
    overflow: hidden;
}

.email-client-bar {
    display: flex;
    gap: 6px;
    padding: 0.5rem 0.75rem;
    background: #0f1222;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.email-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.email-dot.red { background: #b8274a; }
.email-dot.yellow { background: #ffc861; }
.email-dot.green { background: #147a5c; }

.email-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem 0.5rem;
}

.email-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--solid);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.email-from {
    font-size: 0.82rem;
    font-weight: 600;
    color: #eef1fa;
}

.email-from .muted {
    font-weight: 400;
    font-size: 0.78rem;
}

.email-to {
    font-size: 0.75rem;
    color: var(--mut);
}

.email-subject {
    font-size: 0.95rem;
    font-weight: 700;
    color: #eef1fa;
    padding: 0.5rem 0.9rem;
    border-top: 1px solid rgba(255,255,255,.12);
    border-bottom: 1px solid rgba(255,255,255,.12);
    background: #0f1222;
}

.email-body {
    padding: 0.9rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #eef1fa;
    white-space: pre-wrap;
    max-height: 220px;
    overflow-y: auto;
}

/* ---------- Facebook Preview ---------- */
.fb-preview {
    padding: 0.75rem;
    background: #0f1222;
}

.fb-post {
    background: #0f1222;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,.45);
    overflow: hidden;
    max-width: 100%;
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}

.fb-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem 0.5rem;
}

.fb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--solid);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.fb-page {
    font-size: 0.88rem;
    font-weight: 700;
    color: #eef1fa;
    line-height: 1.2;
}

.fb-verified {
    color: #8fa6ff;
    font-size: 0.75rem;
}

.fb-time {
    font-size: 0.72rem;
    color: #9aa3bd;
}

.fb-text {
    padding: 0 0.85rem 0.6rem;
    font-size: 0.86rem;
    color: #eef1fa;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.fb-link-card {
    border: 1px solid rgba(255,255,255,.12);
    border-top: 1px solid rgba(255,255,255,.12);
    background: #0f1222;
    margin-bottom: 0.5rem;
}

.fb-link-image {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    overflow: hidden;
    background: #0f1222;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-link-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fb-link-info {
    padding: 0.55rem 0.75rem;
}

.fb-link-domain {
    font-size: 0.68rem;
    color: #9aa3bd;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.fb-link-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #eef1fa;
    line-height: 1.3;
    margin: 0.1rem 0;
}

.fb-link-desc {
    font-size: 0.76rem;
    color: #9aa3bd;
    line-height: 1.35;
}

.fb-actions {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 0.5rem 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #9aa3bd;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.active-filter {
    background: var(--solid);
    color: #fff !important;
    border-color: var(--em);
}

/* ---------- Input / Focus ---------- */
input[type=checkbox] {
    accent-color: var(--em);
}

input[type=range] {
    accent-color: var(--em);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--em);
    outline-offset: 3px;
}

.control select,
.control input[type="text"],
.control input[type="number"],
.form-control,
.form-group input,
.modal-content input {
    background: #0f1222;
    border-radius: 12px;
}

/* ---------- Versions ---------- */
.versions-header {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    background: var(--surface);
    border-bottom: 1.5px solid var(--line);
}

.version-tab {
    padding: 0.35rem 0.85rem;
    border: 1.5px solid var(--input-border);
    border-radius: 9px;
    background: var(--card-bg);
    color: var(--navy);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.version-tab:hover {
    border-color: var(--em);
    color: var(--em);
}

.version-tab.active {
    background: var(--solid);
    color: #fff;
    border-color: var(--em);
}

.version-tab-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.version-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--em);
    margin: 0;
}

.version-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.version-select-all {
    padding: 0.35rem 0.85rem;
    border: 1.5px solid var(--input-border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--em);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.version-select-all:hover {
    background: var(--mint);
    border-color: var(--em);
}

.versions-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.output-code {
    flex: 1;
    width: 100%;
    min-height: 300px;
    margin: 0;
    padding: 1rem;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    background: var(--bg2);
    color: #8fa6ff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.7;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.output-code.hidden,
.output-text.hidden {
    display: none;
}

.actions {
    text-align: center;
    margin-bottom: 1.5rem;
}

.bulk-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ---------- Spintax Tab ---------- */
#spintax-tab .editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    #spintax-tab .editor {
        grid-template-columns: 1fr;
    }
}

.output-wrapper {
    flex: 1;
    position: relative;
    display: none;
    flex-direction: column;
}

.output-wrapper.active {
    display: flex;
}

/* ---------- Plagiarism Match Sources ---------- */
.plagiarism-match-sources {
    margin: 0;
    padding-left: 1.25rem;
}

.plagiarism-match-sources li {
    margin-bottom: 0.35rem;
}

.plagiarism-match-sources a {
    color: var(--em);
    text-decoration: none;
    word-break: break-all;
}

.plagiarism-match-sources a:hover {
    text-decoration: underline;
}

/* ---------- Rewrite Page Header ---------- */
.rewrite-page .pagehead {
    text-align: left;
    margin-bottom: 28px;
}

.rewrite-page .pagehead p {
    margin-left: 0;
    font-size: 1.05rem;
}

.rewrite-page .pagehead h1 {
    font-family: Sora, sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
}

/* ---------- Tool Text Layer ---------- */
.tool-text-layer {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: #0f1222;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 360px;
    overflow: auto;
    color: var(--navy);
}

.tool-text-layer.empty {
    color: var(--text);
    font-style: italic;
}

/* ---------- Mode Help ---------- */
.mode-help {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--mut);
    line-height: 1.4;
}

/* ---------- Progress Modal ---------- */
.progress-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,12,22,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 1rem;
}

.progress-modal {
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.progress-modal h3 {
    margin: 0 0 0.25rem;
    font-family: Sora, sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--navy);
}

.progress-step-text {
    margin: 0 0 1.25rem;
    font-size: 0.92rem;
    color: var(--mut);
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: var(--mint);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--grad);
    border-radius: 999px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-percent {
    font-family: Sora, sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0;
}

.progress-error {
    margin: 1rem 0 0;
    color: #ff8aa0;
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-error-close {
    margin-top: 1rem;
}

@media (max-width: 420px) {
    .progress-modal { max-width: 100%; padding: 1.25rem; }
    .progress-modal h3 { font-size: 1.05rem; }
    .progress-percent { font-size: 1.1rem; }
}

/* ---------- Photos Panel ---------- */
.photos-panel {
    margin-top: 1.5rem;
    padding: 1.25rem;
}

/* Keeps the Generate Rewrite button clear of the card above it. */
#photos-panel {
    margin-bottom: 1.5rem;
}

.photos-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1.5px solid var(--line);
}

.photos-panel .panel-header h2 {
    margin: 0;
    font-family: Sora, sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy);
}

.photos-search-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
}

.photos-search-row input {
    flex: 1 1 240px;
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 0.95rem;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-card {
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    background: #0f1222;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.photo-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
}

.photo-card.selected {
    border-color: var(--em);
    box-shadow: 0 0 0 2px rgba(90,123,255,.2);
}

.photo-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

.photo-info {
    padding: 0.65rem;
    font-size: 0.78rem;
    color: var(--text);
}

.photo-title {
    margin: 0 0 0.35rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--navy);
}

.photo-meta {
    margin: 0 0 0.25rem;
    color: var(--mut);
    font-size: 0.72rem;
}

.photo-attribution {
    margin: 0;
    font-size: 0.72rem;
    color: var(--mut);
    line-height: 1.35;
}

.photo-card .photo-select-btn {
    width: calc(100% - 1rem);
    margin: 0 0.5rem 0.5rem;
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
}

.photos-attribution {
    margin-top: 0.75rem;
}

/* ---------- Article Photos ---------- */
.article-photo {
    margin: 1.25rem 0;
    text-align: center;
}

.article-photo img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.24);
}

.article-photo figcaption {
    font-size: 0.78rem;
    color: var(--mut);
    margin-top: 0.4rem;
}

/* ---------- Plans Table ---------- */
.plans-table thead th {
    background: var(--bg2);
    color: #fff;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    font-family: Sora, sans-serif;
}

.plans-table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.plans-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

.plans-table tbody td:nth-child(2) {
    font-weight: 800;
    color: var(--navy);
    white-space: nowrap;
}

.plans-table tbody tr:hover td {
    background: var(--mint);
}

.plans-table tbody td h3 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

/* ---------- Rewriter Grid ---------- */
.rw-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 15px;
    align-items: start;
}

.rw-rail {
    position: sticky;
    top: 18px;
}

.rw-rail-title {
    font-family: Sora, sans-serif;
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 12px;
    color: var(--navy);
}

.rw-rail .usage-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rw-rail .usage-grid > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1.5px solid var(--line);
    padding-top: 10px;
}

.rw-rail .usage-grid > div:first-child {
    border-top: 0;
    padding-top: 0;
}

.rw-rail .usage-summary {
    box-sizing: border-box;
    max-width: 100%;
}

.rw-rail .usage-grid > div {
    gap: 10px;
}

.rw-rail .usage-label {
    min-width: 0;
}

.rw-rail .usage-grid strong {
    white-space: nowrap;
    flex: none;
    text-align: right;
}

@media (max-width: 1000px) {
    .rw-grid { grid-template-columns: 1fr; }
    .rw-rail { position: static; }
}

/* ---------- Rewrite Page Editor Canvas ---------- */
.rewrite-page .editor {
    background: #0f1222;
    border: 1.5px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    gap: 18px;
}

.rewrite-page .editor .panel.card {
    border: 1.5px solid rgba(255,255,255,.12);
    border-radius: 14px;
    box-shadow: none;
}

.rewrite-page .quill-editor .ql-editor {
    font-size: 15px;
    line-height: 1.7;
    padding: 18px 20px;
}

.rewrite-page .controls.card {
    border-radius: 18px;
}

.rewrite-page .controls select#mode {
    background: var(--mint);
    color: var(--em);
    border-color: rgba(90,123,255,.4);
    font-weight: 700;
    border-radius: 999px;
    padding-left: 14px;
}

.rewrite-page .controls input[type="range"] {
    accent-color: var(--em);
}

/* ---------- Rewrite Page Shell ---------- */

.rewrite-page .container {
    background: #0f1222;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
    width: calc(100% - 36px);
    margin: 22px auto 32px;
}

@media (max-width: 820px) {
    .rewrite-page .container {
        width: calc(100% - 20px);
        margin: 14px auto 22px;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
    
    
    
    
    
    
    
    .nav-account-menu {
        position: static;
        box-shadow: none;
        border: 0;
        padding: 0 0 0 8px;
        min-width: 0;
    }
    
    .container { padding: 24px 16px; }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    .feature-card { padding: 26px; }
    .editor { grid-template-columns: minmax(0, 1fr); }
    .controls { padding: 18px; }
    .tabs { overflow-x: auto; flex-wrap: wrap; }
    .tab-btn { font-size: 13px; padding: 9px 12px; }
    .rewrite-page .pagehead h1 { font-size: 1.9rem; }
    .panel-actions .btn { font-size: 0.75rem; }
    .auth-container { margin: 16px auto; }
    .feature-grid { min-width: 0; }

    .plans-table { table-layout: fixed; width: 100%; font-size: 12px; overflow-wrap: anywhere; }
    .plans-table th, .plans-table td { padding: 10px 6px; }
    .control { min-width: 0; }
    .custom-synonym-inputs { flex-wrap: wrap; }
    .auth-container.card { margin-left: 12px; margin-right: 12px; padding: 22px 18px; }

    .control-row > .control { flex: 1 1 100%; }
    .control input, .control select, .control textarea { max-width: 100%; min-width: 0; box-sizing: border-box; }
    .control input[type="file"] { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Legal Pages ---------- */
.legal-page h2 {
    margin: 1.6rem 0 0.7rem;
    font-family: Sora, sans-serif;
    font-size: 1.15rem;
    color: var(--navy);
}

.legal-page p,
.legal-page li {
    line-height: 1.65;
    color: var(--text);
}

.legal-page ul {
    margin: 0 0 1rem 1.2rem;
}