/* Priority Pixels Content Engine.
   Chrome mirrors pp-reports + pp-portal: dark left sidebar (#262728),
   Muli body / Effra headings, pink accent, cards on a light background. */

@font-face {
    font-family: 'Effra';
    src: url('/static/fonts/effra_std_he-webfont.woff2') format('woff2'),
         url('/static/fonts/effra_std_he-webfont.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Muli';
    src: url('/static/fonts/Muli-Light.woff2') format('woff2'),
         url('/static/fonts/Muli-Light.woff') format('woff');
    font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Muli';
    src: url('/static/fonts/Muli.woff2') format('woff2'),
         url('/static/fonts/Muli.woff') format('woff');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Muli';
    src: url('/static/fonts/Muli-SemiBold.woff2') format('woff2'),
         url('/static/fonts/Muli-SemiBold.woff') format('woff');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Muli';
    src: url('/static/fonts/Muli-Bold.woff2') format('woff2'),
         url('/static/fonts/Muli-Bold.woff') format('woff');
    font-weight: 700; font-style: normal; font-display: swap;
}

:root {
    --pp-teal: #4fbab7;
    --pp-teal-dark: #3a9e9b;
    --pp-pink: #ed3779;
    --pp-pink-hover: #d62e6b;
    --pp-yellow: #ffc63b;
    --pp-dark: #262728;
    --pp-grey: #666;
    --pp-light-grey: #999;
    --pp-bg: #f5f5f5;
    --pp-white: #fff;
    --pp-border: #e5e5e5;
    --pp-radius: 8px;
    --pp-radius-sm: 4px;
    --sidebar-bg: #262728;
    --sidebar-text: #ffffff;
    --sidebar-muted: #d1d5db;
    --sidebar-hover: rgba(255,255,255,0.1);
    --sidebar-width: 256px;
    --sidebar-width-collapsed: 64px;
    --font-body: 'Muli', 'Helvetica Neue', Arial, sans-serif;
    --font-head: 'Effra', 'Muli', Arial, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--pp-bg);
    color: var(--pp-dark);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--pp-teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; letter-spacing: 0.2px; }

/* ==== Sidebar chrome (mirrors pp-reports layout) ==== */

.pp-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 90;
    transition: width 0.15s ease;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    min-width: 0;
}
.sidebar-brand-link:hover { text-decoration: none; }

.sidebar-brand-logo {
    height: 24px;
    width: auto;
    max-width: 100%;
    display: block;
    flex-shrink: 1;
    min-width: 0;
}


.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    flex: 1 1 auto;
    overflow-y: auto;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    min-width: 0;
}
.sidebar-identity-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pp-pink) 0%, var(--pp-teal) 100%);
    color: var(--pp-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.4px;
    flex-shrink: 0;
    text-transform: uppercase;
    object-fit: cover;
}
.sidebar-identity-avatar-img { display: block; }
.sidebar-identity-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--sidebar-text);
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-identity-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.sidebar-identity-btn:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--sidebar-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    min-height: 36px;
}
.sidebar-link svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
}
.sidebar-link span { min-width: 0; }
.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    text-decoration: none;
}
.sidebar-link.is-active {
    background: var(--pp-pink);
    color: var(--pp-white);
}
.sidebar-link.is-active:hover { background: var(--pp-pink-hover); }

.sidebar-link-logout { color: rgba(255,255,255,0.55); }
.sidebar-link-logout:hover { color: var(--pp-pink); background: rgba(237,55,121,0.08); }

.sidebar-group { display: flex; flex-direction: column; }
.sidebar-group-toggle {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.sidebar-group-toggle .sidebar-chevron {
    margin-left: auto;
    color: currentColor;
    opacity: 0.8;
    transition: transform 0.15s ease;
}
.sidebar-group.is-open > .sidebar-group-toggle .sidebar-chevron { transform: rotate(90deg); }

.sidebar-sublinks {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 0 28px;
}
.sidebar-group.is-open > .sidebar-sublinks { display: flex; }

.sidebar-sublink {
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    min-height: 30px;
    border-radius: 6px;
    color: #9ca3af;
}
.sidebar-sublink svg { width: 14px; height: 14px; }
.sidebar-sublink:hover { color: var(--sidebar-text); background: var(--sidebar-hover); }
.sidebar-sublink.is-active {
    background: var(--pp-pink);
    color: var(--pp-white);
}
.sidebar-sublink.is-active:hover { background: var(--pp-pink-hover); }

.sidebar-group-nested > .sidebar-sublinks { margin-left: 28px; }


/* Main column beside the sidebar */
.pp-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.15s ease;
}

.main-content {
    flex: 1 1 auto;
    padding: 24px 32px 32px;
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}

/* Mobile: sidebar becomes an off-canvas overlay */
.pp-sidebar-mobile-toggle {
    display: none;
    position: fixed;
    top: 12px; right: 12px;
    width: 42px; height: 42px;
    border-radius: 8px;
    border: 1px solid var(--pp-border);
    background: var(--pp-white);
    color: var(--pp-dark);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 95;
    box-shadow: var(--shadow-sm);
}
.pp-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 89;
}
.pp-sidebar-mobile-open .pp-sidebar-backdrop { display: block; }

@media (max-width: 900px) {
    .pp-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        width: var(--sidebar-width);
    }
    .pp-sidebar-mobile-open .pp-sidebar { transform: translateX(0); }
    .pp-main { margin-left: 0; }
    .pp-sidebar-mobile-toggle { display: inline-flex; }
    .main-content { padding: 68px 16px 24px; }
}

.page-status-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 24px;
    margin-bottom: 12px;
}

/* Page status strip: top-right chrome, mirrors pp-reports SyncButton */
.page-status {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.2;
}
.page-status-divider { color: #d1d5db; font-weight: 400; }
.page-status-info-btn,
.page-status-cadence,
.page-status-lastsync {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    background: transparent;
    border: 0;
    padding: 0;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: default;
}
.page-status-info-btn { cursor: pointer; transition: color 0.15s; }
.page-status-info-btn:hover { color: var(--pp-pink); }

/* Icon-in-button helper: aligns SVG + label with a small gap */
.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.btn-with-icon svg { flex-shrink: 0; }

/* Top-of-page loading bar shown on any form submit or nav click so
   the user always sees that the click landed. Auto-hides on the next
   pageshow event when the new page renders. */
.pp-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: var(--pp-pink);
    z-index: 500;
    box-shadow: 0 0 8px rgba(237,55,121,0.5);
    transition: width 0.4s ease;
    pointer-events: none;
}
.pp-progress.is-loading {
    width: 70%;
    transition: width 12s cubic-bezier(0.1, 0.7, 0.1, 1);
}
.pp-progress.is-done {
    width: 100%;
    transition: width 0.15s ease-out;
    opacity: 0;
}

/* Button-busy state: label reads "Working..." while the click is in
   flight. Icon does not spin; users find spinning icons on non-refresh
   buttons (send, apply, submit) visually noisy. */
.btn.is-busy {
    opacity: 0.7;
    cursor: wait;
    position: relative;
}

/* Generic modal shell used by any page needing a proper dialog */
.pp-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.pp-modal.is-open { display: flex; }
.pp-modal-panel {
    background: var(--pp-white);
    border: 1px solid var(--pp-border);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--pp-border);
}
.pp-modal-title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 800;
    color: var(--pp-dark);
    margin: 0;
}
.pp-modal-close {
    background: transparent;
    border: 0;
    padding: 6px;
    border-radius: 6px;
    color: var(--pp-grey);
    cursor: pointer;
    line-height: 0;
    transition: background 0.15s, color 0.15s;
}
.pp-modal-close:hover { background: #f4f4f4; color: var(--pp-dark); }
.pp-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    font-size: 14px;
    color: var(--pp-dark);
    line-height: 1.6;
}
.pp-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--pp-border);
    background: #fafafa;
}
.pp-radio-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--pp-border);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.pp-radio-row:hover { border-color: var(--pp-teal); background: #f8fdfd; }
.pp-radio-row input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--pp-pink);
    flex-shrink: 0;
}
.pp-radio-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pp-dark);
    line-height: 1.3;
}
.pp-radio-sub {
    font-size: 12px;
    color: var(--pp-grey);
    line-height: 1.4;
    margin-top: 2px;
}

/* Footer */
.pp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 32px;
    border-top: 1px solid var(--pp-border);
    background: var(--pp-white);
    font-size: 12px;
    color: var(--pp-grey);
}
.pp-footer a { color: var(--pp-grey); }
.pp-footer a:hover { color: var(--pp-pink); text-decoration: none; }
.pp-footer-right { display: flex; align-items: center; gap: 16px; }
.pp-install-wrap { position: relative; display: inline-flex; align-items: center; }
.pp-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 0;
    color: var(--pp-pink);
    font: 600 12px inherit;
    font-family: inherit;
    cursor: pointer;
}
.pp-install-btn:hover { color: var(--pp-dark); }
.pp-install-btn svg { flex-shrink: 0; }
.pp-install-help {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 288px;
    background: var(--pp-dark);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    padding: 12px 14px;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    cursor: pointer;
    z-index: 10;
}
.pp-install-help code {
    background: rgba(255,255,255,0.12);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
}

/* Flash messages */
.flash-messages { margin-bottom: 16px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--pp-radius-sm);
    font-size: 14px;
    margin-bottom: 8px;
}
.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.flash-error { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }
.flash-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

/* LinkedIn token warning banner */
.linkedin-warning {
    padding: 12px 16px;
    border-radius: var(--pp-radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.linkedin-warning-expired {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #f8bbd0;
}

.linkedin-warning-expiring {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffecb3;
}

.linkedin-renew-link {
    flex-shrink: 0;
    background: var(--pp-dark);
    color: var(--pp-white) !important;
    padding: 6px 16px;
    border-radius: var(--pp-radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.15s;
}

.linkedin-renew-link:hover {
    background: #333;
}

/* Calendar header */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--pp-dark);
}

/* Tabs */
.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--pp-border);
}
.tab {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pp-grey);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}
.tab:hover {
    color: var(--pp-dark);
}
.tab-active {
    color: var(--pp-pink);
    border-bottom-color: var(--pp-pink);
}

.calendar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius-sm);
    font-size: 14px;
    background: var(--pp-white);
    cursor: pointer;
}

.btn-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--pp-light-grey);
    border: 1px solid var(--pp-border);
    background: var(--pp-white);
    transition: all 0.15s;
    text-decoration: none;
}

.btn-info:hover {
    color: var(--pp-teal);
    border-color: var(--pp-teal);
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: var(--pp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary { background: var(--pp-pink); color: var(--pp-white); }
.btn-primary:hover { background: #d62e6b; color: var(--pp-white); }
.btn-teal { background: var(--pp-teal); color: var(--pp-white); }
.btn-teal:hover { background: var(--pp-teal-dark); color: var(--pp-white); text-decoration: none; }

.btn-secondary { background: var(--pp-white); color: var(--pp-dark); border: 1px solid var(--pp-border); }
.btn-secondary:hover { background: var(--pp-bg); }

.btn-danger { background: var(--pp-pink); color: var(--pp-white); }
.btn-danger:hover { background: #d62e6b; color: var(--pp-white); }

.btn-sm { padding: 4px 10px; font-size: 12px; }

.btn-action { background: var(--pp-pink); color: var(--pp-white); }
.btn-action:hover { background: #d62e6b; color: var(--pp-white); }

.btn-plain { background: var(--pp-white); color: var(--pp-grey); border: 1px solid var(--pp-border); }
.btn-plain:hover { background: var(--pp-bg); color: var(--pp-dark); }

.btn-approval { background: var(--pp-pink); color: var(--pp-white); }
.btn-approval:hover { background: #d62e6b; color: var(--pp-white); }

.btn-calendar { background: var(--pp-pink); color: var(--pp-white); }
.btn-calendar:hover { background: #d62e6b; color: var(--pp-white); }

/* Table */
.table-wrap {
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.calendar-table thead {
    background: #262728;
    border-bottom: 0;
}

.calendar-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: #262728;
}

.calendar-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.calendar-row:hover { background: #fafbfc; }

.col-title { min-width: 140px; max-width: 200px; }
.col-source { min-width: 100px; max-width: 160px; }
.col-content { min-width: 160px; max-width: 260px; }
.col-date { min-width: 90px; white-space: nowrap; }
.col-status { min-width: 80px; }
.col-actions { min-width: 320px; white-space: nowrap; }

/* Source styles */
.source-link {
    font-size: 13px;
    word-break: break-all;
}

.source-idea {
    font-size: 13px;
    color: var(--pp-grey);
    font-style: italic;
}

.source-empty, .content-empty, .date-empty {
    color: var(--pp-light-grey);
    font-size: 13px;
}

/* Content preview */
.content-preview {
    font-size: 13px;
    color: var(--pp-grey);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Date display */
.date-display { font-size: 13px; font-weight: 500; }
.time-display { font-size: 12px; color: var(--pp-light-grey); }

/* Image indicator */
.image-indicator {
    font-size: 12px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Duplicate URL flag */
.duplicate-flag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--pp-radius-sm);
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pending { background: #eee; color: #666; }
.status-draft { background: #e0f5f4; color: #2a8a87; }
.status-awaiting { background: #fff7ed; color: #9a3412; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #fce4ec; color: #c62828; }
.status-published { background: #1a1a1a; color: #fff; }
.status-error { background: #fff3e0; color: #e65100; }
/* Blocked = topic blocklist refusal. Amber/yellow, distinct from
   red Error which means "something broke, retry". */
.status-blocked { background: #fff8e1; color: #8d6e00; border: 1px solid #ffd54f; }

/* Action buttons */
.action-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
}

.published-label {
    font-size: 12px;
    color: var(--pp-light-grey);
    font-style: italic;
}

/* Spinner */
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--pp-border);
    border-top-color: var(--pp-teal);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.htmx-indicator.spinner { display: inline-block; }

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-sm);
}

.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 20px; margin-bottom: 8px; color: var(--pp-dark); }
.empty-state p { color: var(--pp-grey); margin-bottom: 20px; }

/* Forms */
.form-page {
    max-width: 1400px;
    margin: 0;
}

.platform-edit-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.form-header h1 { font-size: 24px; }

.pp-form {
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-sm);
    padding: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--pp-dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius-sm);
    font-size: 14px;
    font-family: var(--font-body);
    transition: border-color 0.15s;
    background: var(--pp-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--pp-teal);
    box-shadow: 0 0 0 3px rgba(79,186,183,0.15);
}

.form-help {
    display: block;
    font-size: 12px;
    color: var(--pp-light-grey);
    margin-top: 4px;
}

.required { color: var(--pp-pink); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--pp-border);
}

/* Preview page */
.preview-page { max-width: 1400px; margin: 0 auto; }

.preview-card {
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-sm);
    padding: 32px;
    margin-bottom: 20px;
}

.preview-meta { margin-bottom: 24px; }

.meta-table { font-size: 14px; }
.meta-table td { padding: 4px 0; }
.meta-label { font-weight: 600; padding-right: 16px; color: var(--pp-grey); white-space: nowrap; }

.preview-content-box {
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.platform-badge {
    display: inline-block;
    background: #0A66C2;
    color: var(--pp-white);
    padding: 3px 12px;
    border-radius: var(--pp-radius-sm);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
}

.preview-text {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.preview-image {
    margin-top: 16px;
}

.post-image {
    max-width: 100%;
    border-radius: 6px;
}

/* LinkedIn feed image simulation — crops to 1.91:1 just like the real feed */
.linkedin-image-frame {
    margin-top: 16px;
    position: relative;
    width: 100%;
    aspect-ratio: 1.91 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: #f0f0f0;
}

.linkedin-image-fit {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Three-column platform preview */
.platform-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.platform-col {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    overflow: hidden;
    background: var(--pp-white);
}

.platform-col-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--pp-white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 14px;
    background: var(--pp-dark);
}

.platform-col-copy {
    padding: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--pp-dark);
    flex: 1;
    border-bottom: 1px solid var(--pp-border);
    max-height: 300px;
    overflow-y: auto;
}

.platform-col-image {
    padding: 12px;
}

.platform-image-frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: #f0f0f0;
}

.platform-image-frame.ratio-1-1 {
    aspect-ratio: 1 / 1;
}

.platform-image-frame.ratio-3-2 {
    aspect-ratio: 3 / 2;
}

.platform-image-frame.ratio-4-5 {
    aspect-ratio: 4 / 5;
}

.platform-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.platform-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ddd;
    background: #fafafa;
}

.platform-image-empty span {
    color: #aaa;
    font-size: 13px;
}

.platform-image-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.platform-upload-form {
    display: inline;
}

.platform-image-actions .btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    flex: none;
    text-align: center;
}
.platform-image-actions .btn-upload {
    background: #ffc63b;
    color: #1a1a1a;
    border: none;
    margin-left: auto;
    cursor: pointer;
}

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

.preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    border: 1px solid var(--pp-border);
}

.image-preview-box {
    margin-top: 4px;
}

.upload-section {
    background: var(--pp-bg);
    border-radius: var(--pp-radius);
    padding: 20px;
    border: 1px solid var(--pp-border);
}

.upload-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.upload-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.upload-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.file-input {
    font-size: 13px;
}

.image-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.upload-divider {
    font-size: 12px;
    color: var(--pp-light-grey);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-actions {
    display: flex;
    gap: 8px;
}

/* Toast notifications */
#toast-container {
    position: fixed;
    top: 68px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--pp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast-success { background: #2e7d32; color: #fff; }
.toast-error { background: #c62828; color: #fff; }
.toast-info { background: var(--pp-dark); color: #fff; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Instructions page */
.instructions-page {
    max-width: 800px;
}

.instructions-content {
    background: var(--pp-white);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.instruction-section {
    margin-bottom: 32px;
}

.instruction-section:last-child {
    margin-bottom: 0;
}

.instruction-section h2 {
    font-size: 18px;
    color: var(--pp-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--pp-teal);
}

.instruction-section p {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 8px;
}

.instruction-section ul {
    margin: 8px 0 8px 20px;
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

.instruction-section li {
    margin-bottom: 4px;
}

.instructions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 8px;
}

.instructions-table th,
.instructions-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.instructions-table th {
    background: var(--pp-bg);
    font-weight: 600;
    color: var(--pp-dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.instructions-table td {
    color: #444;
}

.workflow-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--pp-teal);
    color: var(--pp-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-top: 2px;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 15px;
    color: var(--pp-dark);
    margin-bottom: 6px;
}

.step-content p {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 6px;
}

.step-content ul {
    margin: 6px 0 6px 20px;
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content { padding: 16px; }
    .calendar-header { flex-direction: column; align-items: flex-start; }
    .calendar-actions { width: 100%; justify-content: flex-start; }

    .table-wrap { overflow-x: auto; }

    .pp-form { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }

    .header-inner { padding: 0; }
    .brand-logo { height: 24px; }
}

@media (max-width: 640px) {
    .calendar-table thead { display: none; }
    .calendar-table, .calendar-table tbody, .calendar-table tr, .calendar-table td {
        display: block;
    }
    .calendar-row {
        background: var(--pp-white);
        border: 1px solid var(--pp-border);
        border-radius: var(--pp-radius);
        margin-bottom: 12px;
        padding: 4px;
    }
    .calendar-row td {
        padding: 6px 16px;
        border: none;
    }
    .calendar-row td.col-title {
        font-size: 16px;
        padding-top: 12px;
    }
    .calendar-row td.col-actions {
        padding-bottom: 12px;
    }
    .col-content { display: none; }
}

/* Image generator two-column layout */
.image-generator-columns {
    display: flex;
    gap: 24px;
    margin-top: 12px;
}
.image-generator-col {
    flex: 1;
    padding: 16px;
    background: var(--pp-bg);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
}
.image-generator-col h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: var(--pp-dark);
}
@media (max-width: 900px) {
    .image-generator-columns {
        flex-direction: column;
    }
}

/* ===== Content Aggregator ===== */

.agg-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.agg-stat-card {
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    text-align: center;
}
.agg-stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--pp-teal);
}
.agg-stat-label {
    font-size: 12px;
    color: var(--pp-grey);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.agg-trend-section {
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}
.agg-trend-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.agg-filters {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.agg-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.agg-keyword-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    background: var(--pp-white);
    border: 1px solid var(--pp-border);
    color: var(--pp-grey);
    text-decoration: none;
    transition: all 0.15s;
}
.agg-keyword-pill:hover {
    border-color: var(--pp-teal);
    color: var(--pp-teal);
    text-decoration: none;
}
.agg-keyword-pill.active {
    background: var(--pp-teal);
    color: var(--pp-white);
    border-color: var(--pp-teal);
}

.agg-article {
    display: block;
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 12px;
    transition: box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.agg-article:hover { box-shadow: var(--shadow-md); text-decoration: none; color: inherit; }
.agg-article-source {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.agg-source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--pp-radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.agg-source-rss { background: #e0f5f4; color: #2a8a87; }
.agg-source-linkedin { background: #e8f0fe; color: #0A66C2; }
.agg-article-date {
    font-size: 12px;
    color: var(--pp-light-grey);
}
.agg-article-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}
.agg-article-title a { color: var(--pp-dark); }
.agg-article-title a:hover { color: var(--pp-teal); text-decoration: none; }
.agg-article-snippet {
    font-size: 14px;
    color: var(--pp-grey);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.agg-article-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
.agg-kw-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    background: var(--pp-bg);
    color: var(--pp-light-grey);
    border: 1px solid var(--pp-border);
}

.agg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
}
.agg-page-info {
    font-size: 13px;
    color: var(--pp-grey);
}

/* Content Ideas */
.agg-ideas-section {
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}
.agg-ideas-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.agg-ideas-header h2 {
    font-size: 18px;
    margin: 0;
    flex: 0 0 auto;
}
.agg-ideas-placeholder {
    font-size: 14px;
    color: var(--pp-grey);
    line-height: 1.6;
}
.agg-idea-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--pp-bg);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    margin-bottom: 10px;
}
.agg-idea-card:last-child { margin-bottom: 0; }
.agg-idea-content { flex: 1; }
.agg-idea-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--pp-dark);
    margin: 0 0 4px 0;
    line-height: 1.4;
}
.agg-idea-angle {
    font-size: 13px;
    color: var(--pp-grey);
    line-height: 1.5;
    margin: 0;
}
.agg-idea-actions {
    flex-shrink: 0;
    padding-top: 2px;
}
.agg-idea-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    align-items: center;
}
.agg-idea-sources-label {
    font-size: 11px;
    color: var(--pp-light-grey);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.agg-idea-source-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    background: #e0f5f4;
    color: #2a8a87;
    border: 1px solid #c5ece9;
    text-decoration: none;
    transition: all 0.15s;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agg-idea-source-pill:hover {
    background: var(--pp-teal);
    color: var(--pp-white);
    border-color: var(--pp-teal);
    text-decoration: none;
}
.agg-idea-empty {
    font-size: 14px;
    color: var(--pp-grey);
    padding: 12px 0;
}
.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* Info button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
}

/* Feeds info page */
.agg-feeds-section h2 {
    font-size: 18px;
    margin: 0 0 4px 0;
}
.agg-feeds-intro {
    font-size: 13px;
    color: var(--pp-grey);
    margin: 0 0 16px 0;
}
.agg-feeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 10px;
}
.agg-feed-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--pp-white);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
}
.agg-feed-status { font-size: 10px; padding-top: 3px; }
.agg-feed-active .agg-feed-status { color: #2e7d32; }
.agg-feed-unavailable .agg-feed-status { color: #c62828; }
.agg-feed-info { flex: 1; min-width: 0; }
.agg-feed-info strong {
    display: block;
    font-size: 14px;
    color: var(--pp-dark);
    margin-bottom: 2px;
}
.agg-feed-url {
    display: block;
    font-size: 11px;
    color: var(--pp-light-grey);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agg-feed-url:hover { color: var(--pp-teal); }
.agg-feed-reason {
    display: block;
    font-size: 11px;
    color: #c62828;
    margin-top: 2px;
    font-style: italic;
}

/* ===== Home Page ===== */

.home-page {
    max-width: 1200px;
    margin: 0 auto;
}

.home-hero {
    padding: 8px 0 24px;
}

.home-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--pp-dark);
    margin-bottom: 4px;
}

.home-subtitle {
    font-size: 14px;
    color: var(--pp-grey);
    font-weight: 400;
    margin: 0;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.home-card {
    background: var(--pp-white);
    border-radius: 12px;
    border: 1px solid var(--pp-border);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
}

.home-card:hover {
    border-color: var(--pp-teal);
    text-decoration: none;
    color: inherit;
}

.home-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.home-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(79, 186, 183, 0.12);
    color: var(--pp-teal);
    flex-shrink: 0;
}

.home-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--pp-dark);
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.home-card-arrow {
    color: #bbb;
    transition: color 0.15s;
    flex-shrink: 0;
}

.home-card:hover .home-card-arrow {
    color: var(--pp-teal);
}

.home-card-desc {
    font-size: 13px;
    color: var(--pp-grey);
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 1100px) {
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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


@media (max-width: 768px) {
    .agg-stats { grid-template-columns: repeat(2, 1fr); }
    .agg-idea-card { flex-direction: column; }
    .agg-feeds-grid { grid-template-columns: 1fr; }
}

/* ===== Footer ===== */

.pp-footer {
    text-align: center;
    padding: 24px 20px;
    margin-top: 40px;
    color: var(--pp-light-grey);
    font-size: 12px;
}
.pp-footer p { margin: 0; }

/* ===== Settings Page ===== */

.settings-section {
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-sm);
    padding: 28px;
}

.settings-section-header {
    margin-bottom: 20px;
}
.settings-section-header h2 {
    font-size: 18px;
    color: var(--pp-dark);
    margin-bottom: 6px;
}
.settings-section-desc {
    font-size: 13px;
    color: var(--pp-grey);
    line-height: 1.5;
}

.settings-documents {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-doc-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: var(--pp-bg);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
}

.settings-doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.settings-doc-icon {
    flex-shrink: 0;
    color: var(--pp-teal);
}

.settings-doc-name {
    display: block;
    font-size: 14px;
    color: var(--pp-dark);
}

.settings-doc-meta {
    display: block;
    font-size: 12px;
    color: var(--pp-light-grey);
}

.settings-doc-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.settings-doc-empty {
    font-size: 14px;
    color: var(--pp-grey);
    padding: 20px 0;
    text-align: center;
}

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

.settings-upload-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Settings platform blocks */
.settings-platform {
    padding: 20px;
    background: var(--pp-bg);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
}

.settings-platform-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.settings-platform-header h3 {
    font-size: 16px;
    color: var(--pp-dark);
    margin: 0;
}

.settings-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.settings-status-ok { background: #e8f5e9; color: #2e7d32; }
.settings-status-missing { background: #eee; color: #666; }
.settings-status-meta {
    font-size: 12px;
    color: var(--pp-light-grey);
    margin-left: 4px;
}

/* Settings modal */
.settings-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-modal-content {
    background: var(--pp-white);
    border-radius: var(--pp-radius);
    box-shadow: var(--shadow-md);
    padding: 28px;
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.settings-modal-header h3 {
    font-size: 18px;
    color: var(--pp-dark);
    margin: 0;
}
.settings-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--pp-grey);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.settings-modal-close:hover { color: var(--pp-dark); }

/* Newsletter editor */
.nl-email-preview {
    max-width: 640px;
    margin: 0 auto 24px auto;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}
.nl-action-bar {
    max-width: 640px;
    margin: 0 auto 40px auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.nl-drag-list { min-height: 40px; }
.nl-drag-handle {
    cursor: grab;
    font-size: 18px;
    color: #ccc;
    user-select: none;
}
.nl-drag-handle:hover { color: #999; }

/* Large card (company news) */
.nl-card-large {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px dashed var(--pp-border);
    border-radius: var(--pp-radius);
    margin-bottom: 12px;
    background: #fafafa;
    align-items: flex-start;
}
.nl-card-large .nl-card-img { flex: 0 0 160px; }
.nl-card-large .nl-card-img img {
    width: 160px;
    height: 107px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
.nl-card-large .nl-card-body { flex: 1; min-width: 0; }
.nl-card-large .nl-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.nl-card-noimg {
    width: 160px;
    height: 100px;
    background: #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
}

/* Small card (insights — 2 per row) */
.nl-insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.nl-card-small {
    padding: 12px;
    border: 1px dashed var(--pp-border);
    border-radius: var(--pp-radius);
    background: #fafafa;
}
.nl-card-img-sm img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin-bottom: 8px;
}
.nl-card-noimg-sm {
    width: 100%;
    aspect-ratio: 3/2;
    background: #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}
.nl-card-actions-sm {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

/* Editable card inputs */
.nl-card-title-input, .nl-card-title-input-sm {
    width: 100%;
    font-size: 14px;
    font-weight: 700;
    border: 1px dashed transparent;
    background: transparent;
    padding: 4px;
    border-radius: 3px;
    font-family: var(--font-body);
    margin-bottom: 4px;
}
.nl-card-title-input:focus, .nl-card-title-input-sm:focus {
    border-color: var(--pp-teal);
    outline: none;
    background: #fff;
}
.nl-card-excerpt-input, .nl-card-excerpt-input-sm {
    width: 100%;
    font-size: 13px;
    color: var(--pp-grey);
    border: 1px dashed transparent;
    background: transparent;
    padding: 4px;
    border-radius: 3px;
    font-family: var(--font-body);
    resize: vertical;
    line-height: 1.4;
}
.nl-card-excerpt-input:focus, .nl-card-excerpt-input-sm:focus {
    border-color: var(--pp-teal);
    outline: none;
    background: #fff;
}
