:root {
    --primary: #3f51b5;
    --primary-dark: #2c3a8c;
    --accent: #ff7043;
    --bg: #f4f6fb;
    --text: #2c3e50;
    --muted: #6c7a89;
    --success: #2ecc71;
    --danger: #e74c3c;
    --card-bg: #ffffff;
    --border: #dce3f0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.nav-links a {
    margin-right: 1rem;
    font-weight: 500;
}

.nav-links .logout {
    color: var(--danger);
}

.locale-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.locale-switcher select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 0.95rem;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -999;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.6rem 1rem;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    z-index: 999;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

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

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

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--border);
}

.card h2 {
    margin-top: 0;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.table td form + .button {
    margin-top: 0.5rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table.stack {
    width: 100%;
}

.table.stack tbody tr {
    transition: background 0.2s ease;
}

.table.stack tbody tr:hover {
    background: rgba(63, 81, 181, 0.05);
}

.table.stack td[data-label] {
    position: relative;
}

.button {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.button.secondary {
    background: var(--muted);
}

.button.danger {
    background: var(--danger);
}

.button[disabled],
.button[disabled]:hover {
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert.error {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.alert.success {
    background: rgba(46, 204, 113, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert.warning {
    background: rgba(255, 204, 0, 0.15);
    border-color: #f1c40f;
    color: #8a6d00;
}

.alert ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
    color: var(--muted);
    font-size: 0.9rem;
    list-style: disc;
    list-style-position: inside;
}

.calendar {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--border);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(63, 81, 181, 0.08);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid var(--border);
}

.calendar-cell {
    min-height: 120px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
}

.calendar-cell:nth-child(7n) {
    border-right: none;
}

.calendar-day {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.calendar-post {
    background: rgba(63, 81, 181, 0.1);
    border-left: 3px solid var(--primary);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.calendar-post:focus {
    outline: 2px solid var(--primary);
}

.calendar-post.dragging {
    opacity: 0.6;
}

.calendar-cell.drop-target {
    outline: 2px dashed var(--primary);
    background: rgba(63, 81, 181, 0.08);
}

.calendar-status {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    min-height: 2.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.calendar-status[data-status-type="error"] {
    color: var(--danger);
}

.calendar-status[data-status-type="success"] {
    color: var(--success);
}

.onboarding-steps {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.onboarding-steps li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.onboarding-steps li.complete a {
    color: var(--success);
}

.onboarding-steps li span {
    font-size: 1.1rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(63, 81, 181, 0.12);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(46, 204, 113, 0.12);
    color: var(--success);
}

.badge.warning {
    background: rgba(255, 204, 0, 0.18);
    color: #9c6f00;
}

.flex {
    display: flex;
    gap: 1.5rem;
}

.flex-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.qr-preview {
    margin-top: 1.5rem;
    border: 1px dashed var(--border);
    border-radius: 16px;
    padding: 2rem;
    min-height: 260px;
    display: grid;
    place-items: center;
    background: rgba(63, 81, 181, 0.05);
}

.qr-preview img {
    max-width: 100%;
    height: auto;
}

.link-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.link-card form:last-child {
    align-self: flex-end;
}

.button[disabled] {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.composer {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    flex-wrap: wrap;
}

.composer-editor {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.composer-editor textarea[data-composer-input] {
    min-height: 180px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    resize: vertical;
}

.composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.composer-toolbar-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.composer-char-count {
    font-size: 0.85rem;
    color: var(--muted);
}

.composer-char-count[data-state="over"] {
    color: var(--danger);
    font-weight: 600;
}

.composer-panel {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f9fbff;
    padding: 1rem;
    box-shadow: 0 12px 24px rgba(63, 81, 181, 0.08);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.emoji-button {
    font-size: 1.5rem;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    padding: 0.35rem;
    transition: border 0.2s ease, transform 0.2s ease;
}

.emoji-button:hover,
.emoji-button:focus {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.composer-suggestions {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    padding: 0.5rem;
    max-width: 100%;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.composer-suggestions button {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}

.composer-suggestions button:hover,
.composer-suggestions button:focus {
    border-color: var(--primary);
    color: var(--primary);
}

.composer-preview {
    flex: 0 0 260px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: linear-gradient(150deg, rgba(63, 81, 181, 0.1), rgba(63, 81, 181, 0.02));
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.preview-tab {
    flex: 1 1 auto;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 0.85rem;
}

.preview-tab.active {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff;
    box-shadow: 0 10px 20px rgba(63, 81, 181, 0.12);
}

.preview-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: inset 0 0 0 1px rgba(63, 81, 181, 0.08);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-title {
    font-weight: 600;
}

.preview-body {
    flex: 1 1 auto;
    white-space: pre-wrap;
    line-height: 1.4;
}

.preview-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.composer-utm-panel .utm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.composer-utm-panel input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.composer-utm-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.composer-utm-status {
    min-height: 1.2rem;
    font-size: 0.85rem;
}

.composer-utm-status[data-state="error"] {
    color: var(--danger);
}

.composer-utm-status[data-state="success"] {
    color: var(--success);
}

.approval-request-form select[multiple] {
    min-height: 140px;
}

.approval-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.approval-step {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    background: #fff;
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.06);
}

.approval-step.current {
    border-color: var(--primary);
    box-shadow: 0 14px 28px rgba(63, 81, 181, 0.16);
}

.approval-decision textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    resize: vertical;
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

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

    .composer {
        flex-direction: column;
    }

    .composer-preview {
        flex: 1 1 auto;
    }
}

@media (max-width: 680px) {
    .table.stack thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }

    .table.stack tbody,
    .table.stack tr,
    .table.stack td {
        display: block;
        width: 100%;
    }

    .table.stack tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--card-bg);
        overflow: hidden;
    }

    .table.stack td {
        display: flex;
        gap: 0.75rem;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.75rem;
        border-bottom: 1px solid var(--border);
    }

    .table.stack td:last-child {
        border-bottom: none;
    }

    .table.stack td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
    }

    .table.stack td[colspan] {
        display: block;
        text-align: center;
    }
}

.alert {
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    background: #fff7ed;
}

.alert.danger {
    border-color: rgba(231, 76, 60, 0.3);
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}

.alert.success {
    border-color: rgba(46, 204, 113, 0.3);
    background: rgba(46, 204, 113, 0.1);
    color: var(--success);
}

.inbox-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: start;
}

.conversation-list,
.conversation-detail,
.new-conversation {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.conversation-list header h2 {
    margin: 0;
}

.conversation-items {
    list-style: none;
    padding: 0;
    margin: 1.2rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.conversation-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.conversation-item.active,
.conversation-item:hover {
    border-color: var(--primary);
    box-shadow: 0 16px 32px rgba(63, 81, 181, 0.12);
}

.conversation-item a {
    display: block;
    padding: 0.9rem 1rem;
    color: inherit;
}

.conversation-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.conversation-topic {
    margin: 0.4rem 0;
    font-size: 0.95rem;
}

.conversation-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.priority {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-urgent {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

.priority-high {
    background: rgba(255, 112, 67, 0.18);
    color: var(--accent);
}

.priority-normal {
    background: rgba(63, 81, 181, 0.15);
    color: var(--primary);
}

.priority-low {
    background: rgba(108, 122, 137, 0.15);
    color: var(--muted);
}

.conversation-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message-thread {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: #f9fafe;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(63, 81, 181, 0.08);
}

.message.outbound,
.message.automation {
    background: rgba(63, 81, 181, 0.1);
}

.message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.tag {
    display: inline-flex;
    align-items: center;
    background: rgba(63, 81, 181, 0.15);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

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

.inline-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form select,
.inline-form input,
.inline-form textarea,
.assignment-panel select,
.assignment-panel textarea,
.assignment-panel input,
.new-conversation input,
.new-conversation select,
.new-conversation textarea,
.message-form textarea,
.message-form select,
.message-form input {
    width: 100%;
    max-width: 100%;
    padding: 0.6rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
}

.assignment-panel,
.message-form {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: rgba(63, 81, 181, 0.03);
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.form-row label {
    font-weight: 600;
    font-size: 0.9rem;
}

.new-conversation {
    margin-top: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    border: 1px dashed var(--border);
    background: rgba(108, 122, 137, 0.08);
    color: var(--muted);
}

.upgrade-hint {
    max-width: 320px;
}

.inbox-metrics .card {
    text-align: left;
}

@media (max-width: 1024px) {
    .inbox-layout {
        grid-template-columns: 1fr;
    }

    .conversation-detail {
        order: 2;
    }

    .new-conversation {
        order: 3;
    }
}

@media (max-width: 680px) {
    .conversation-items {
        gap: 0.5rem;
    }

    .conversation-item a {
        padding: 0.8rem;
    }
}

.media-studio {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 2fr;
    gap: 2rem;
    margin-top: 2rem;
}

.media-upload,
.media-library,
.media-library-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.media-library {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.library-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 16px 28px rgba(63, 81, 181, 0.08);
}

.library-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, var(--primary)) 20%, transparent);
}

.library-preview {
    aspect-ratio: 4 / 3;
    background: rgba(63, 81, 181, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.library-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-preview .placeholder {
    font-size: 2.5rem;
}

.library-body {
    padding: 1rem 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.library-body .tags {
    font-size: 0.85rem;
    color: var(--muted);
}

.library-transforms {
    padding: 0.8rem 1.2rem 1.2rem;
    border-top: 1px solid var(--border);
}

.library-transforms ul {
    margin: 0.5rem 0 0;
    padding-left: 1rem;
    font-size: 0.9rem;
}

.variant-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.8rem 1rem 1.2rem;
}

.variant-form select {
    padding: 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.media-library-section {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stock-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stock-gallery.gifs {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stock-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
}

.stock-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.stock-body {
    padding: 1rem 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stock-body form {
    margin-top: 0.5rem;
}

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

    .media-upload {
        order: 1;
    }

    .media-library {
        order: 2;
    }
}

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

    .stock-gallery {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

.ai-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.ai-form .assistant-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.assistant-form textarea,
.assistant-form input,
.assistant-form select {
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
}

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

.platform-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.6rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 0.8rem 1rem 1rem;
}

.platform-choices label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.ai-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    background: #fff;
    box-shadow: 0 16px 30px rgba(63, 81, 181, 0.08);
}

.result-block header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.result-content {
    white-space: pre-wrap;
    background: rgba(63, 81, 181, 0.08);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-family: 'Source Code Pro', 'Courier New', monospace;
    font-size: 0.95rem;
}

.repurpose-card {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(63, 81, 181, 0.05);
}

.ai-history {
    margin-top: 2rem;
}

@media (max-width: 1024px) {
    .ai-layout {
        grid-template-columns: 1fr;
    }

    .ai-results {
        order: 2;
    }
}
