:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #f9fafc;
    --border: #e4e6ef;
    --text: #151827;
    --text-2: #555a70;
    --muted: #8a8fa6;
    --primary: #5b4cf0;
    --primary-dark: #4636d6;
    --primary-soft: #eeecff;
    --success: #1a8f5a;
    --success-soft: #e3f6ec;
    --warning: #b7791f;
    --warning-soft: #fff4dc;
    --danger: #d23b3b;
    --danger-soft: #fde8e8;
    --info-soft: #e7f0fe;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
    --series-1: #2a78d6;
    --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 1em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
img, video { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 500; color: var(--text-2); font-size: 13px; }
label > input, label > select, label > textarea { margin-top: 6px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; min-height: 90px; }
input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--text); cursor: pointer; }
.check input { margin-top: 3px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row > .shrink { flex: 0 0 auto; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 4px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 600; font-size: 13px;
    padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap;
    text-decoration: none !important; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #f5c2c2; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #157a4c; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.link-btn.danger { color: var(--danger); }

/* ---------- Alerts / badges ---------- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: #11603d; border-color: #bfe8d2; }
.alert-error { background: var(--danger-soft); color: #9b2323; border-color: #f5c2c2; }
.alert-info { background: var(--info-soft); color: #1d4f91; border-color: #c8dcfb; }
.alert-warning { background: var(--warning-soft); color: #7a5313; border-color: #f3dca8; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-scheduled { background: var(--info-soft); color: #1d4f91; border-color: #c8dcfb; }
.badge-published { background: var(--success-soft); color: #11603d; border-color: #bfe8d2; }
.badge-failed, .badge-rejected { background: var(--danger-soft); color: #9b2323; border-color: #f5c2c2; }
.badge-pending_approval { background: var(--warning-soft); color: #7a5313; border-color: #f3dca8; }
.badge-publishing { background: var(--primary-soft); color: var(--primary-dark); border-color: #d6d1ff; }
.badge-demo { background: #f1f1f4; color: #666; }

.net-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px; color: #fff;
    font-size: 10px; font-weight: 700; text-transform: none; flex: 0 0 auto;
}
.net-icon.lg { width: 36px; height: 36px; font-size: 13px; border-radius: 9px; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    background: #14132b; color: #c9c8e3; display: flex; flex-direction: column;
    padding: 18px 12px; z-index: 30; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: inherit; text-decoration: none !important; padding: 0 8px; }
.sidebar .brand { color: #fff; }
.brand-mark { display: inline-flex; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #7a6cff, #5b4cf0); color: #fff; align-items: center; justify-content: center; font-size: 17px; }
.brand-lg { font-size: 22px; justify-content: center; margin-bottom: 18px; }
.ws-switch { margin: 16px 0 10px; }
.ws-switch select { background: #1f1e3d; color: #fff; border-color: #2e2d52; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #c9c8e3; font-weight: 500; text-decoration: none; }
.sidebar nav a:hover { background: #1f1e3d; color: #fff; }
.sidebar nav a.active { background: #2b2860; color: #fff; }
.nav-icon { width: 18px; text-align: center; opacity: .85; }
.nav-count { margin-left: auto; background: #f0b429; color: #1b1400; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; }
.nav-count.danger { background: #f16363; color: #fff; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid #2a2950; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-chip { display: flex; gap: 8px; align-items: center; min-width: 0; }
.user-chip strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.user-chip small { color: #8e8db2; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #5b4cf0; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.link-muted { color: #8e8db2; font-size: 12px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 19px; margin: 0; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.menu-toggle { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; }
.flashes { padding: 0 28px; }
.flashes .alert:first-child { margin-top: 16px; }
.content { padding: 24px 28px 48px; }
.nav-backdrop { display: none; }

/* ---------- Cards / grid ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .split > .card + .card, .week-grid > * + * { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }

.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--text-2); }

/* ---------- Dashboard setup tracker (3 steps side by side) ---------- */
.setup { background: linear-gradient(135deg, #f6f5ff 0%, #ffffff 55%); border: 1px solid #e3e0ff; border-radius: var(--radius); padding: 18px 20px 20px; }
.setup-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.setup-top h2 { margin: 0 0 2px; font-size: 17px; }
.setup-top p { margin: 0; color: var(--text-2); font-size: 13px; }
.setup-meter { min-width: 180px; text-align: right; font-size: 12px; font-weight: 600; color: var(--primary-dark); }
.setup-bar { height: 6px; background: #e6e3ff; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.setup-bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.setup-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.setup-node { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
/* line joining one step to the next */
.setup-node:not(:last-child)::after { content: ""; position: absolute; top: 28px; right: -13px; width: 13px; height: 2px; background: var(--border); }
.setup-node.is-done:not(:last-child)::after { background: #9ad9b9; }
.setup-dot { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 700; }
.setup-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.setup-text strong { font-size: 14px; }
.setup-text span { font-size: 12px; color: var(--muted); }
.setup-node.is-done { background: #f6fcf9; border-color: #cfeedd; }
.setup-node.is-done .setup-dot { background: var(--success); border-color: var(--success); color: #fff; }
.setup-node.is-done .setup-text strong { color: var(--text-2); }
.setup-tag { font-size: 12px; font-weight: 600; color: var(--success); }
.setup-node.is-next { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.setup-node.is-next .setup-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.setup-node.is-later { opacity: .8; }
.setup-link { font-size: 12px; font-weight: 600; }
@media (max-width: 760px) {
    .setup-track { grid-template-columns: 1fr; }
    .setup-node { flex-direction: row; align-items: center; flex-wrap: wrap; }
    .setup-node:not(:last-child)::after { top: auto; bottom: -13px; right: auto; left: 27px; width: 2px; height: 13px; }
    .setup-meter { text-align: left; width: 100%; }
}

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h3 { color: var(--text); }

/* ---------- Tables / lists ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.post-item { display: flex; gap: 14px; padding: 10px 8px; margin: 0 -8px; border-radius: 8px; border-bottom: 1px solid var(--border); }
.post-item:last-child { border-bottom: 0; }
.post-item .when { width: 120px; flex: 0 0 auto; font-size: 12px; color: var(--text-2); }
.post-item .when strong { display: block; color: var(--text); font-size: 13px; }
.post-item .body { flex: 1; min-width: 0; }
.post-item .text { white-space: pre-wrap; word-break: break-word; }
/* Queue rows stay compact: small cover + 2-line caption. Double-click opens the full preview. */
.post-summary { display: flex; gap: 10px; align-items: flex-start; }
.post-thumb { position: relative; flex: 0 0 auto; }
.post-thumb .thumb { width: 48px; height: 48px; border-radius: 6px; }
.post-thumb .more-count { position: absolute; right: 2px; bottom: 2px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; line-height: 1.4; border-radius: 4px; padding: 0 4px; }
.post-item .text.clamp-2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.45; }
.post-item[data-preview] { cursor: default; }
.caption-ig-steps { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.caption-ig-steps .hint { flex: 1; min-width: 200px; }
.post-item[data-preview]:hover { background: var(--surface-2); }
.post-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.acct-stack { display: inline-flex; gap: 3px; }
.error-text { color: var(--danger); font-size: 12px; margin-top: 6px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.tabs .count { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }

/* ---------- Media ---------- */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb-remove { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; line-height: 1; }
.dropzone { border: 2px dashed var(--border); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); color: var(--primary); }
.dropzone input { display: none; }

/* ---------- Composer ---------- */
.account-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.account-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--text); background: var(--surface); user-select: none; }
.account-pill input { display: none; }
.account-pill.checked, .account-pill:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.account-pill small { color: var(--muted); font-weight: 400; }
.counters { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.counters .over { color: var(--danger); font-weight: 600; }
.message-label { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px 12px; }
.message-label textarea { grid-column: 1 / -1; }
.message-limit { color: var(--muted); font-size: 12px; font-weight: 500; }
.message-limit.near { color: var(--warning); }
.message-limit.over { color: var(--danger); font-weight: 700; }
textarea[aria-invalid="true"] { border-color: var(--danger); }
.editor-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.preview { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); }
.preview-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.preview-head .avatar { width: 38px; height: 38px; }
.preview-text { white-space: pre-wrap; word-break: break-word; }
.preview-media { margin-top: 10px; display: grid; gap: 4px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.preview-media img, .preview-media video { width: 100%; border-radius: 8px; aspect-ratio: 1; object-fit: cover; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.radio-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 600; color: var(--text); }
.radio-card small { display: block; font-weight: 400; color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card input { margin-right: 6px; }

/* ---------- Account picker (composer) ---------- */
.picker-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picker-count { font-size: 12px; color: var(--text-2); display: inline-flex; gap: 8px; align-items: center; }
.picker-count strong { color: var(--primary); font-size: 14px; }
.picker-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 12px; }
.picker-bar input[type=search] { flex: 1 1 220px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { font: inherit; font-size: 12px; font-weight: 600; border: 0; background: transparent; color: var(--text-2); padding: 5px 10px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg-btn .net-icon { width: 16px; height: 16px; font-size: 8px; border-radius: 4px; }
.seg-btn span:not(.net-icon) { color: var(--muted); font-weight: 500; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.split > *, .stack > * { min-width: 0; } /* let grid/flex children shrink instead of overflowing on phones */
.picker-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; max-height: 360px; overflow-y: auto; padding: 2px; }
.pgroup { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.pgroup:has(input:checked) { border-color: #cfc9ff; background: #fbfaff; }
.pgroup-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pgroup-avatar { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pgroup-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; text-transform: capitalize; }
.pgroup-toggle { flex: 0 0 auto; }
.pgroup-accts { display: flex; gap: 6px; flex-wrap: wrap; }
.pgroup .account-pill { padding: 5px 10px 5px 5px; font-size: 12px; position: relative; border-radius: 9px; }
.pgroup .account-pill .pill-text { display: inline-flex; flex-direction: column; line-height: 1.2; }
.pgroup .account-pill .pill-text small { color: var(--muted); font-size: 10px; }
.pill-check { display: none; width: 16px; height: 16px; border-radius: 50%; background: var(--net, var(--primary)); color: #fff; font-size: 10px; align-items: center; justify-content: center; margin-left: 2px; }
.pgroup .account-pill:has(input:checked) { border-color: var(--net, var(--primary)); background: color-mix(in srgb, var(--net, var(--primary)) 9%, white); }
.pgroup .account-pill:has(input:checked) .pill-check { display: inline-flex; }
.pgroup .account-pill:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Grammar panel ---------- */
.grammar-panel { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 10px 12px; }
.grammar-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grammar-head .link-btn { margin-left: auto; }
.grammar-ok { color: var(--success); font-weight: 600; }
.grammar-item { border-top: 1px solid var(--border); padding: 8px 0 2px; margin-top: 8px; }
.grammar-msg { font-size: 12px; color: var(--text-2); }
.grammar-fixes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.grammar-bad { text-decoration: line-through; text-decoration-color: var(--danger); color: var(--danger); font-weight: 600; }
.grammar-fix { font: inherit; font-size: 12px; font-weight: 600; border: 1px solid #bfe8d2; background: var(--success-soft); color: #11603d; border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.grammar-fix:hover { background: #cdf0dc; }

/* ---------- Hashtag suggestions ---------- */
.hashtag-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hashtag-count { font-size: 12px; color: var(--text-2); }
.hashtag-count.over { color: var(--danger); font-weight: 600; }
.hashtag-input-row { display: flex; gap: 8px; margin-top: 6px; }
.hashtag-input-row input { flex: 1; min-width: 0; }
.hashtag-panel { margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 12px 14px; }
.hashtag-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hashtag-head .link-btn { margin-left: auto; }
.tag-section { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.tag-section-title { font-size: 12px; font-weight: 700; color: var(--text); display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.tag-hint { font-size: 11px; color: var(--muted); margin: 2px 0 6px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { font: inherit; font-size: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.tag-chip:hover { border-color: var(--primary); color: var(--primary); }
.tag-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tag-chip.group { font-weight: 600; color: var(--primary-dark); background: var(--primary-soft); border-color: #d6d1ff; }
.tag-group { display: inline-flex; align-items: center; }
.tag-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 4px; }
.tag-x:hover { color: var(--danger); }

/* ---------- Delete menu (published posts) ---------- */
.delete-menu { position: relative; display: inline-block; }
.delete-menu summary { list-style: none; }
.delete-menu summary::-webkit-details-marker { display: none; }
.delete-menu-box { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.delete-menu-box p { margin: 0; }
.delete-menu-box .hint { display: block; text-align: center; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(12, 12, 30, .45); display: none; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 100; overflow-y: auto; }
.modal.open { display: flex; }
.modal-box { background: var(--surface); border-radius: 14px; width: 100%; max-width: 620px; box-shadow: var(--shadow-lg); padding: 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-close { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }
.ai-results .ai-option { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 10px; white-space: pre-wrap; }
.ai-option .btn { margin-top: 8px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-toolbar h2 { margin: 0 8px; min-width: 170px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; }
.cal-dow { background: var(--surface-2); padding: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); text-align: center; }
.cal-day { background: var(--surface); min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num { color: var(--muted); }
.cal-day.today .cal-num { background: var(--primary); color: #fff; }
.cal-num { font-size: 12px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cal-head { display: flex; justify-content: space-between; align-items: center; }
.cal-add { opacity: 0; font-size: 16px; color: var(--primary); text-decoration: none !important; padding: 0 4px; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-chip { display: flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 5px; border-radius: 5px; background: var(--info-soft); color: #1d4f91; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none !important; border-left: 3px solid transparent; }
.cal-chip.published { background: var(--success-soft); color: #11603d; }
.cal-chip.failed { background: var(--danger-soft); color: #9b2323; }
.cal-chip.pending_approval { background: var(--warning-soft); color: #7a5313; }
.cal-chip.slot { background: #f4f3fb; color: var(--text-2); border-left-color: currentColor; }
.cal-chip .net-icon { width: 14px; height: 14px; font-size: 7px; border-radius: 3px; }
.cal-more { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Schedule grid ---------- */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.week-col h3 { font-size: 13px; text-align: center; margin-bottom: 10px; }
.slot-card { border-radius: 8px; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--series-1); margin-bottom: 8px; font-size: 12px; }
.slot-card strong { font-size: 13px; }
.slot-card .acct-stack { margin-top: 5px; flex-wrap: wrap; }
.slot-card form { display: inline; }

/* ---------- Library ---------- */
.library-card { display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--series-1); }
.library-card h3 { margin: 0; }
.library-card .meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.drag-handle { cursor: grab; color: var(--muted); padding: 0 6px; user-select: none; }
.sortable-row.dragging { opacity: .4; }

/* ---------- Charts (plain HTML/CSS) ---------- */
.chart { position: relative; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 190px; padding: 0 0 0 36px; position: relative; border-bottom: 1px solid var(--border); }
.bars .gridline { position: absolute; left: 36px; right: 0; border-top: 1px dashed #eceef4; font-size: 10px; color: var(--muted); }
.bars .gridline span { position: absolute; left: -34px; top: -7px; width: 28px; text-align: right; }
.bar { flex: 1; min-width: 4px; background: var(--series-1); border-radius: 4px 4px 0 0; position: relative; cursor: default; z-index: 1; }
.bar:hover { filter: brightness(1.1); }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bar-col .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #14132b; color: #fff; font-size: 11px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; pointer-events: none; }
.bar-col:hover .tip { display: block; }
.bar-col:hover .bar { filter: brightness(1.1); }
.bar-col > .bar { flex: 0 0 auto; } /* keep each bar at its own height inside the column */
.bar-col.fail-only .bar { background: transparent; }
.x-labels { display: flex; gap: 3px; padding-left: 36px; margin-top: 6px; }
.x-labels span { flex: 1; font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 56px; gap: 10px; align-items: center; padding: 6px 0; }
.hbar-label { display: flex; gap: 8px; align-items: center; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hbar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.heat { display: grid; grid-template-columns: 40px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10px; color: var(--muted); }
.heat div { aspect-ratio: 1; border-radius: 3px; }
.heat .lbl { aspect-ratio: auto; display: flex; align-items: center; }

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(circle at 20% 0%, #ecebff, transparent 50%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-card h1 { font-size: 22px; text-align: center; }
.auth-card > .muted { text-align: center; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--text-2); }

/* ---------- Landing ---------- */
.public { background: #fff; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1180px; margin: 0 auto; padding: 18px 24px; gap: 16px; }
.lp-nav .brand { color: var(--text); padding: 0; }
.lp-links { display: flex; gap: 22px; align-items: center; }
.lp-links a:not(.btn) { color: var(--text-2); font-weight: 500; }
.hero { max-width: 1180px; margin: 0 auto; padding: 60px 24px 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; background: var(--primary-soft); color: var(--primary-dark); padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-bottom: 16px; }
.hero h1 { font-size: 48px; line-height: 1.08; letter-spacing: -.02em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p.lead { font-size: 18px; color: var(--text-2); max-width: 540px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.hero-cta .btn { padding: 13px 22px; font-size: 15px; }
.hero-visual { background: linear-gradient(160deg, #f3f1ff, #eef6ff); border-radius: 22px; padding: 22px; border: 1px solid #e6e3ff; }
.mock { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: 16px; }
.mock-row { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid var(--border); margin-top: 8px; font-size: 13px; }
.mock-row .t { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.logos { text-align: center; color: var(--muted); padding: 24px; font-weight: 600; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; }
.section { max-width: 1180px; margin: 0 auto; padding: 64px 24px; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-head h2 { font-size: 34px; letter-spacing: -.01em; }
.section-head p { color: var(--text-2); font-size: 16px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { border: 1px solid var(--border); border-radius: 16px; padding: 24px; background: #fff; }
.feature .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 14px; }
.feature p { color: var(--text-2); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
.step { padding: 24px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.step::before { counter-increment: step; content: counter(step); display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; }
.pricing { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.plan { border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; background: #fff; }
.plan.featured { border: 2px solid var(--primary); box-shadow: var(--shadow-lg); }
.plan .price { font-size: 34px; font-weight: 800; margin: 8px 0; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 12px 0 20px; flex: 1; }
.plan li { padding: 5px 0; color: var(--text-2); }
.plan li::before { content: "✓ "; color: var(--success); font-weight: 700; }
.faq details { border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; background: #fff; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--text-2); }
.cta-band { background: linear-gradient(135deg, #5b4cf0, #3d2fc7); color: #fff; border-radius: 22px; padding: 48px 32px; text-align: center; }
.cta-band h2 { font-size: 30px; }
.cta-band .btn { background: #fff; color: var(--primary-dark); border-color: #fff; padding: 13px 24px; font-size: 15px; }
.lp-foot { border-top: 1px solid var(--border); padding: 28px 24px; text-align: center; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: 1fr; }
    .pricing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .nav-open .sidebar { transform: none; }
    .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
    .main { margin-left: 0; }
    .menu-toggle { display: block; }
    .topbar, .content { padding-left: 16px; padding-right: 16px; }
    .flashes { padding: 0 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .hero { grid-template-columns: 1fr; padding-top: 32px; }
    .hero h1 { font-size: 36px; }
    .features, .steps { grid-template-columns: 1fr; }
    .lp-links a:not(.btn) { display: none; }
    .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cal-day { min-height: 76px; }
    .cal-chip span.txt { display: none; }
    .post-item { flex-direction: column; gap: 6px; }
    .post-item .when { width: auto; }
    .hbar-row { grid-template-columns: 100px 1fr 44px; }
}
@media (max-width: 520px) {
    .grid-4, .pricing { grid-template-columns: 1fr; }
    .topbar h1 { font-size: 16px; }
    .topbar-actions .btn { padding: 7px 10px; }
}

/* ---------- Upload progress (Queue) ---------- */
.upload-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--primary-dark); }
.upload-bar { width: 120px; height: 6px; background: var(--primary-soft); border-radius: 999px; overflow: hidden; display: inline-block; }
.upload-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }
.upload-bar.indeterminate span { width: 35%; animation: upload-slide 1.2s ease-in-out infinite; }
@keyframes upload-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ---------- Composer: instant upload + restored draft ---------- */
.thumb.uploading img, .thumb.uploading video { opacity: .45; }
.thumb-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.thumb-progress { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; background: rgba(255,255,255,.8); border-radius: 4px; overflow: hidden; }
.thumb-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.thumb.failed { border-color: #f5c2c2; background: var(--danger-soft); }
.thumb-error { font-size: 10px; color: #9b2323; padding: 6px; line-height: 1.2; }
.draft-banner { background: var(--info-soft); border: 1px solid #c8dcfb; color: #1d4f91; border-radius: 10px; padding: 10px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Queue: toolbar + action menu ---------- */
.queue-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.queue-toolbar .tabs { border-bottom: 0; margin-bottom: 0; }
.queue-filter { padding-bottom: 8px; }
.queue-filter select { width: auto; min-width: 220px; padding: 7px 10px; font-size: 13px; }
.tabs .count.danger { background: var(--danger-soft); color: #9b2323; border-color: #f5c2c2; }
.post-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.post-actions .btn-ghost { color: var(--text-2); }
.post-actions .btn-ghost .net-icon { width: 16px; height: 16px; font-size: 8px; border-radius: 4px; }
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--surface-2); border-color: var(--primary); }
.menu-box { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; min-width: 270px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 13px; font-weight: 500; color: var(--text); background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; flex-wrap: wrap; }
.menu-item:hover { background: var(--surface-2); }
.menu-item small { flex-basis: 100%; padding-left: 23px; color: var(--muted); font-weight: 400; font-size: 11px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-row { padding: 8px 10px; }
.menu-label { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.menu-inline { display: flex; gap: 6px; }
.menu-inline select { padding: 5px 8px; font-size: 12px; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------- Video thumbnail picker ---------- */
.thumb-picker { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
.thumb-picker-head { display: flex; align-items: baseline; gap: 6px; font-size: 15px; }
.thumb-picker-sub { font-size: 13px; font-weight: 600; margin: 8px 0 6px; }
.thumb-picker-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.thumb-picker .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.thumb-picker .seg-btn { font: inherit; font-size: 13px; font-weight: 500; border: 0; border-right: 1px solid var(--border); background: var(--surface); padding: 7px 12px; cursor: pointer; color: var(--text); }
.thumb-picker .seg-btn:last-child { border-right: 0; }
.thumb-picker .seg-btn.active { background: #e9ebf3; font-weight: 600; }
.thumb-arrows { display: flex; gap: 4px; }
.thumb-arrows .btn { width: 32px; padding: 4px 0; font-size: 16px; }
.thumb-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.thumb-option { position: relative; flex: 0 0 auto; width: 84px; height: 120px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface-2); scroll-snap-align: start; }
.thumb-option img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-option span { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.thumb-option:hover { border-color: #cfc9ff; }
.thumb-option.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.thumb-frame-video { width: 100%; max-height: 320px; background: #000; border-radius: 8px; display: block; }
.thumb-frame-controls { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.thumb-frame-controls input[type=range] { flex: 1; }
.small-zone { padding: 18px; font-size: 13px; }
.thumb-selected { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.thumb-selected img { width: 54px; height: 76px; object-fit: cover; border-radius: 6px; }
.thumb-selected div { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.thumb-status { margin: 8px 0 0; }

/* Elements marked hidden must stay hidden even when a class gives them display:flex/grid */
[hidden] { display: none !important; }

/* ---------- Post mock-ups (Create post preview + Queue preview window) ---------- */
.preview-wrap { display: flex; flex-direction: column; gap: 6px; }
.preview-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mock { background: #fff; border: 1px solid #dadde1; border-radius: 10px; overflow: hidden; color: #050505; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; }
.mock-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.mock-head div { display: flex; flex-direction: column; line-height: 1.25; }
.mock-head small { color: #65676b; font-size: 12px; }
.mock-menu { margin-left: auto; color: #65676b; font-weight: 700; letter-spacing: 1px; }
.mock-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #5b4cf0, #8b7dff); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.mock-avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.mock-avatar.ring { width: 34px; height: 34px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e1306c; margin: 2px; }
.mock-text { padding: 0 14px; margin-bottom: 10px; white-space: pre-wrap; word-break: break-word; } /* margin, not padding: the 5-line cut must not show part of line 6 */
.mock-text.clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.mock-more { background: none; border: 0; padding: 0 14px 10px; margin-top: -6px; font: inherit; font-weight: 600; color: #65676b; cursor: pointer; }
.mock img { display: block; }
/* Facebook photo grid (how FB lays out several photos) */
.mock-grid { display: grid; gap: 2px; }
.mock-grid .cell { position: relative; overflow: hidden; background: #f0f2f5; }
.mock-grid img { width: 100%; height: 100%; object-fit: cover; }
.mock-grid.n1 .cell img { height: auto; max-height: 520px; object-fit: contain; margin: 0 auto; }
.mock-grid.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1; }
.mock-grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.mock-grid.n3 .cell:first-child { grid-row: span 2; }
.mock-grid.n4 { grid-template-columns: 1fr 1fr; aspect-ratio: 1; }
.mock-grid.n5 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 3fr 2fr; aspect-ratio: 1; }
.mock-grid.n5 .cell:nth-child(-n+2) { grid-column: span 3; }
.mock-grid.n5 .cell:nth-child(n+3) { grid-column: span 2; }
.mock-grid .more { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
/* Carousel (Instagram, Facebook swipe carousel) */
.mock-carousel { position: relative; background: #000; }
.mock-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.mock-track::-webkit-scrollbar { display: none; }
.mock-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1; background: #f0f2f5; }
.mock-carousel.ig .mock-slide { aspect-ratio: 4 / 5; }
.mock-slide img { width: 100%; height: 100%; object-fit: cover; }
.mock-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #050505; font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mock-nav.prev { left: 8px; } .mock-nav.next { right: 8px; }
.mock-count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.mock-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.mock-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.mock-dots i.on { background: #0095f6; }
/* Reel player */
.mock-reel { position: relative; background: #000; display: flex; justify-content: center; }
.mock-reel video { width: 100%; max-height: 560px; aspect-ratio: 9 / 16; object-fit: contain; background: #000; display: block; }
.mock-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; pointer-events: none; }
/* Facebook link card + actions + comment */
.mock-link { display: flex; background: #f0f2f5; border-top: 1px solid #dadde1; border-bottom: 1px solid #dadde1; }
.mock-link-img { width: 110px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 30px; background: #e4e6eb; }
.mock-link div:last-child { padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.mock-link small { color: #65676b; font-size: 11px; }
.mock-link strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-fb-actions { display: flex; justify-content: space-around; border-top: 1px solid #dadde1; margin: 8px 12px 0; padding: 6px 0; color: #65676b; font-weight: 600; font-size: 13px; }
.mock-comment { display: flex; gap: 8px; padding: 8px 14px 12px; }
.mock-comment > div { background: #f0f2f5; border-radius: 16px; padding: 7px 12px; font-size: 13px; white-space: pre-wrap; }
/* Instagram */
.mock-ig .mock-head { padding: 10px 12px; }
.mock-ig-single img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.mock-ig-empty { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #fafafa; color: #8e8e8e; font-size: 13px; border-top: 1px solid #efefef; border-bottom: 1px solid #efefef; }
.mock-ig-actions { display: flex; gap: 14px; padding: 10px 12px 4px; font-size: 20px; }
.mock-ig-actions .save { margin-left: auto; }
.mock-ig .mock-text { padding: 0 12px; margin-bottom: 4px; }
.mock-ig .mock-more { padding: 0 12px 4px; margin-top: 0; color: #8e8e8e; font-weight: 400; }
.mock-ig-comment { padding: 2px 12px; font-size: 13px; color: #262626; white-space: pre-wrap; }
.mock-time { padding: 4px 12px 12px; color: #8e8e8e; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; }
/* Queue preview window */
.previewable { cursor: zoom-in; }
.previewable:hover { opacity: .85; }
.preview-modal-box { max-width: 460px; }
.preview-modal-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.preview-modal-tabs:empty { display: none; }
.preview-modal-tabs .seg-btn { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.preview-modal-tabs .seg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.preview-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
#post-preview-note:empty { display: none; }

/* The landing page also uses .mock (with padding + shadow); keep post mock-ups flat */
.mock.mock-fb, .mock.mock-ig { padding: 0; box-shadow: none; border-radius: 10px; }

/* ---------- Activity log: filters + "View post" history ---------- */
.act-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.act-filters select, .act-filters input[type=search] { width: auto; min-width: 180px; padding: 7px 10px; font-size: 13px; }
.act-filters input[type=search] { min-width: 240px; flex: 1; max-width: 360px; }
.act-label { font-weight: 600; white-space: nowrap; }
.act-details { min-width: 280px; }
.act-view { margin-top: 6px; }
.act-view summary { cursor: pointer; color: var(--primary); font-size: 12.5px; font-weight: 600; }
.act-box { margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); display: grid; gap: 10px; }
.act-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; font-size: 13px; }
.act-row > strong { color: var(--text-2); font-weight: 600; }
.act-text { white-space: pre-wrap; word-break: break-word; }
.act-accounts { display: grid; gap: 6px; }
.act-account { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.act-account .error-text, .act-own-text { flex-basis: 100%; margin-top: 0; }
.act-media-list { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.act-media { position: relative; display: block; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #000; }
.act-media img, .act-media video { width: 100%; height: 100%; object-fit: cover; }
.act-media span { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; border-radius: 4px; padding: 0 4px; }
.act-media-gone { width: 96px; height: 96px; border-radius: 8px; border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: var(--muted); padding: 6px; }
.act-cover { display: grid; gap: 2px; justify-items: center; }
.act-pages { display: flex; gap: 10px; align-items: center; justify-content: center; padding-top: 12px; }
@media (max-width: 640px) { .act-row { grid-template-columns: 1fr; gap: 2px; } }

/* =====================================================================
   UI refresh (2026-11-25): visual layer only. Same classes and markup,
   so every form, button and script works exactly as before.
   ===================================================================== */
:root {
    --bg: #f4f5fb;
    --surface-2: #f7f8fc;
    --border: #e6e8f0;
    --text: #101326;
    --text-2: #4d5370;
    --muted: #868ba5;
    --primary: #5848f0;
    --primary-dark: #4232d8;
    --primary-soft: #efedff;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(17, 22, 50, .04), 0 2px 8px rgba(17, 22, 50, .04);
    --shadow-lg: 0 16px 40px rgba(17, 22, 50, .14);
    --sidebar-w: 248px;
}
body { font-size: 14px; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
::selection { background: #dcd7ff; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-weight: 650; }

/* ---------- Sidebar: light, grouped ---------- */
.sidebar { background: #ffffff; color: var(--text-2); border-right: 1px solid var(--border); padding: 20px 14px 16px; }
.sidebar .brand { color: var(--text); font-size: 17px; letter-spacing: -.01em; padding: 0 6px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #8b7dff, #5848f0); box-shadow: 0 6px 14px rgba(88, 72, 240, .3); }
.brand-mark svg { width: 17px; height: 17px; }
.ws-switch { margin: 18px 0 6px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.ws-switch select { background: #fff; color: var(--text); border-color: var(--border); font-weight: 600; padding: 7px 10px; }
.ws-switch .link-muted { color: var(--muted); }
.ws-switch .link-muted:hover { color: var(--primary); }
.nav-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #a2a6bd; padding: 16px 10px 6px; }
.sidebar nav { gap: 1px; }
.sidebar nav a { position: relative; color: var(--text-2); padding: 8px 10px; border-radius: 9px; font-weight: 500; transition: background .15s, color .15s; }
.sidebar nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-icon { width: 20px; display: inline-flex; align-items: center; justify-content: center; opacity: 1; color: #9095b0; }
.sidebar nav a:hover .nav-icon { color: var(--text-2); }
.sidebar nav a.active .nav-icon { color: var(--primary); }
.nav-count { background: #fff1d6; color: #8a5a00; }
.nav-count.danger { background: #ffe1e1; color: #b42323; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 14px 4px 0; }
.user-chip strong { color: var(--text); }
.user-chip small { color: var(--muted); }
.avatar { background: linear-gradient(135deg, #8b7dff, #5848f0); }
.link-muted { color: var(--muted); }
.logout-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; }
.logout-link:hover { background: var(--danger-soft); color: var(--danger); text-decoration: none; }
.logout-link svg { width: 16px; height: 16px; }

/* ---------- Top bar ---------- */
.topbar { background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px); padding: 14px 32px; min-height: 68px; }
.topbar-title { display: flex; flex-direction: column; min-width: 0; }
.topbar-ws { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.topbar-actions { align-items: center; }
.flashes { padding: 0 32px; }
.content { padding: 26px 32px 56px; max-width: 1480px; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; padding: 9px 16px; transition: background .15s, border-color .15s, box-shadow .15s, transform .15s; box-shadow: 0 1px 2px rgba(17, 22, 50, .05); }
.btn:hover { border-color: #d5d8e5; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #6656f5, #5444ec); border-color: #5444ec; box-shadow: 0 1px 2px rgba(17, 22, 50, .1), 0 4px 12px rgba(88, 72, 240, .22); }
.btn-primary:hover { background: linear-gradient(180deg, #5a4af0, #4636de); border-color: #4636de; box-shadow: 0 2px 4px rgba(17, 22, 50, .1), 0 6px 16px rgba(88, 72, 240, .3); }
.btn-success { box-shadow: 0 4px 12px rgba(26, 143, 90, .2); }
.btn-ghost { box-shadow: none; }
.btn-sm { padding: 5px 11px; border-radius: 8px; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Forms ---------- */
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
    border-radius: 10px; border-color: #dfe2ec; background: #fff; padding: 9px 12px;
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #cdd1df; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(88, 72, 240, .12); }
label { color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.ws-switch select:focus { box-shadow: 0 0 0 3px rgba(88, 72, 240, .12); }

/* ---------- Cards ---------- */
.card { border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.grid { gap: 18px; }
.card-head { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #f0f1f6; }
.card-head h2 { font-size: 16px; }
.card-head > a { font-size: 13px; font-weight: 600; }

/* Stat tiles: coloured accent per tile */
.stat { position: relative; overflow: hidden; padding: 20px 22px; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary); }
.grid > .stat:nth-child(4n+2)::before { background: #1a8f5a; }
.grid > .stat:nth-child(4n+3)::before { background: #2a78d6; }
.grid > .stat:nth-child(4n+4)::before { background: #e0812a; }
.stat .label { font-size: 11px; letter-spacing: .06em; }
.stat .value { font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .sub { margin-top: 4px; color: var(--muted); }

/* Setup tracker */
.setup { background: linear-gradient(135deg, #f3f1ff 0%, #ffffff 60%); border-color: #e4e0ff; box-shadow: var(--shadow); }
.setup-node { border-radius: 12px; transition: box-shadow .15s; }

/* ---------- Tables ---------- */
.table-wrap { border-radius: 10px; }
th { background: transparent; color: var(--muted); font-size: 11px; letter-spacing: .06em; border-bottom: 1px solid var(--border); padding: 10px 12px; }
td { border-bottom-color: #f0f1f6; padding: 12px; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fafaff; }

/* ---------- Lists, tabs, badges, alerts ---------- */
.post-item { border-bottom-color: #f0f1f6; border-radius: 10px; padding: 12px 10px; margin: 0 -10px; }
.post-item:hover { background: #fafaff; }
.tabs { gap: 2px; }
.tabs a { font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom-width: 2px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary-dark); }
.badge { font-weight: 650; padding: 2px 10px; letter-spacing: .01em; }
.alert { border-radius: 12px; padding: 12px 16px; font-size: 13.5px; }
.empty { padding: 44px 16px; }
.empty h3 { font-size: 16px; }

/* ---------- Calendar / schedule / library ---------- */
.calendar { border-radius: var(--radius); box-shadow: var(--shadow); }
.cal-day { min-height: 124px; transition: background .12s; }
.cal-day:hover { background: #fcfcff; }
.cal-chip { border-radius: 6px; padding: 3px 6px; }
.week-col { box-shadow: var(--shadow); border-radius: 12px; }
.slot-card { border-radius: 10px; background: #fff; }
.library-card { transition: box-shadow .15s, transform .15s; }
.library-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ---------- Charts ---------- */
.bar { background: linear-gradient(180deg, #7b6dff, #5848f0); border-radius: 5px 5px 0 0; }
.hbar-track { height: 10px; border-radius: 999px; }
.hbar-fill { background: linear-gradient(90deg, #7b6dff, #5848f0); border-radius: 999px; }

/* ---------- Menus / modals ---------- */
.menu-box, .delete-menu-box { border-radius: 14px; }
.modal { background: rgba(16, 19, 38, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-box { border-radius: 18px; padding: 24px; }

/* ---------- Auth pages ---------- */
.auth-page { background: radial-gradient(circle at 15% 0%, #e7e3ff, transparent 45%), radial-gradient(circle at 90% 100%, #e3efff, transparent 45%), var(--bg); }
.auth-card { border-radius: 20px; padding: 36px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .topbar { padding: 12px 16px; min-height: 60px; }
    .topbar h1 { font-size: 17px; }
    .content { padding: 18px 16px 48px; }
    .flashes { padding: 0 16px; }
    .sidebar { box-shadow: var(--shadow-lg); }
    .card { padding: 18px; }
}
@media (max-width: 520px) {
    .topbar-ws { display: none; }
    .stat .value { font-size: 26px; }
}

/* =====================================================================
   Colour scheme v2 (2026-11-25): navy sidebar, royal blue, amber accent.
   Colours only; layout and behaviour unchanged.
   ===================================================================== */
:root {
    --bg: #f2f5fa;
    --surface-2: #f6f8fc;
    --border: #e2e8f1;
    --text: #0f1b2d;
    --text-2: #44536b;
    --muted: #7d8aa0;
    --primary: #2563eb;
    --primary-dark: #1d4fd8;
    --primary-soft: #e8f0ff;
    --accent: #f59e0b;
    --series-1: #2563eb;
    --info-soft: #e8f0ff;
}
::selection { background: #cfe0ff; }

/* Sidebar: deep navy */
.sidebar { background: linear-gradient(180deg, #0b1a33 0%, #0f2444 100%); color: #b6c3d8; border-right: 0; }
.sidebar .brand { color: #fff; }
.brand-mark { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #0b1a33; box-shadow: 0 6px 14px rgba(245, 158, 11, .35); }
.ws-switch { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .08); }
.ws-switch select { background: #132a4d; color: #fff; border-color: #23406b; }
.ws-switch .link-muted { color: #8ea0bd; }
.ws-switch .link-muted:hover { color: #fbbf24; }
.nav-group { color: #6f82a3; }
.sidebar nav a { color: #c3cee0; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: rgba(37, 99, 235, .28); color: #fff; }
.sidebar nav a.active::before { background: #fbbf24; }
.nav-icon { color: #8193b2; }
.sidebar nav a:hover .nav-icon { color: #dbe4f3; }
.sidebar nav a.active .nav-icon { color: #fbbf24; }
.nav-count { background: #fbbf24; color: #3b2600; }
.nav-count.danger { background: #ef4444; color: #fff; }
.sidebar-foot { border-top-color: rgba(255, 255, 255, .08); }
.user-chip strong { color: #fff; }
.user-chip small { color: #8ea0bd; }
.avatar { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.sidebar .link-muted { color: #8ea0bd; }
.sidebar .logout-link:hover { background: rgba(239, 68, 68, .15); color: #fca5a5; }

/* Top bar: keep the action button inside the screen */
.main { overflow-x: clip; }
.topbar-title { flex: 1 1 auto; }
.topbar-actions { flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
.topbar-ws { color: var(--primary); }

/* Buttons */
.btn-primary { background: linear-gradient(180deg, #3b74f0, #2563eb); border-color: #2563eb; box-shadow: 0 1px 2px rgba(15, 27, 45, .1), 0 4px 12px rgba(37, 99, 235, .25); }
.btn-primary:hover { background: linear-gradient(180deg, #2f68e8, #1d4fd8); border-color: #1d4fd8; box-shadow: 0 2px 4px rgba(15, 27, 45, .1), 0 6px 16px rgba(37, 99, 235, .32); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(37, 99, 235, .13); }
.ws-switch select:focus { box-shadow: 0 0 0 3px rgba(251, 191, 36, .25); }

/* Stat tiles */
.stat::before { background: #2563eb; }
.grid > .stat:nth-child(4n+2)::before { background: #10b981; }
.grid > .stat:nth-child(4n+3)::before { background: #f59e0b; }
.grid > .stat:nth-child(4n+4)::before { background: #ef4444; }

/* Places that had purple built in */
.setup { background: linear-gradient(135deg, #eaf1ff 0%, #ffffff 60%); border-color: #d4e2ff; }
.setup-bar { background: #dbe7ff; }
.badge-publishing { border-color: #c7d8ff; }
.badge-scheduled { background: #e8f0ff; color: #1d4fd8; border-color: #c7d8ff; }
.pgroup:has(input:checked) { border-color: #bcd2ff; background: #f7faff; }
.tag-chip.group { border-color: #c7d8ff; }
.thumb-option:hover { border-color: #bcd2ff; }
.cal-chip { background: #e8f0ff; color: #1d4fd8; }
.cal-chip.published { background: var(--success-soft); color: #11603d; }
.cal-chip.failed { background: var(--danger-soft); color: #9b2323; }
.cal-chip.pending_approval { background: var(--warning-soft); color: #7a5313; }
.cal-chip.slot { background: #f1f5fb; color: var(--text-2); }
.mock-avatar { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.bar-col .tip { background: #0b1a33; }
.bar { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.hbar-fill { background: linear-gradient(90deg, #60a5fa, #2563eb); }
tbody tr:hover td, .post-item:hover, .post-item[data-preview]:hover { background: #f7faff; }
.cal-day:hover { background: #fbfcff; }
.auth-page { background: radial-gradient(circle at 15% 0%, #dbe7ff, transparent 45%), radial-gradient(circle at 90% 100%, #fff1d6, transparent 45%), var(--bg); }
.modal { background: rgba(11, 26, 51, .5); }

/* content-full-width: content lines up with the top bar on wide screens */
.content { max-width: none; }

/* =====================================================================
   Calendar + Queue v2 (2026-11-25). Scoped to .cal2 / .q-list / queue toolbar.
   ===================================================================== */
/* ---------- Calendar ---------- */
.cal2-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cal2-title h2 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin: 0 0 6px; }
.cal2-title h2 span { color: var(--muted); font-weight: 500; }
.cal2-sum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cal2-sum i, .cal2-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.cal2-sum .s-scheduled i, .cal2-legend .l-scheduled { background: #2563eb; }
.cal2-sum .s-published i, .cal2-legend .l-published { background: #10b981; }
.cal2-sum .s-failed i, .cal2-legend .l-failed { background: #ef4444; }
.cal2-sum .s-pending i, .cal2-legend .l-pending { background: #f59e0b; }
.cal2-legend .l-slot { background: #a3acc2; }
.cal2-nav { display: flex; align-items: center; gap: 14px; }
.cal2-seg { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; box-shadow: var(--shadow); }
.cal2-seg a { padding: 8px 14px; font-weight: 600; font-size: 13px; color: var(--text); border-right: 1px solid var(--border); text-decoration: none; }
.cal2-seg a:last-child { border-right: 0; }
.cal2-seg a:first-child, .cal2-seg a:last-child { font-size: 17px; line-height: 1; padding: 7px 14px 8px; }
.cal2-seg a:hover { background: var(--primary-soft); color: var(--primary-dark); text-decoration: none; }

.calendar.cal2 { border-radius: 16px; }
.cal2 .cal-dow { background: #f8fafd; font-size: 11px; letter-spacing: .08em; padding: 10px 8px; }
.cal2 .cal-day { min-height: 132px; padding: 8px; gap: 4px; }
.cal2 .cal-day.weekend { background: #fbfcfe; }
.cal2 .cal-day.other { background: #f6f8fb; }
.cal2 .cal-day.other .cal-chip { opacity: .7; }
.cal2 .cal-day.today { background: #f4f8ff; box-shadow: inset 0 0 0 2px #2563eb; }
.cal2 .cal-head { justify-content: flex-start; gap: 6px; margin-bottom: 2px; }
.cal2 .cal-num { font-size: 13px; font-weight: 700; }
.cal2 .cal-day.past:not(.today) .cal-num { color: var(--muted); }
.cal2 .cal-count { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; line-height: 17px; }
.cal2 .cal-add { margin-left: auto; width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.cal2 .cal-add:hover { background: var(--primary-soft); }

.cal2 .cal-chip { display: flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 7px; font-size: 11.5px; border-left: 3px solid; background: #eef4ff; color: #1e3a8a; border-left-color: #2563eb; transition: transform .12s, box-shadow .12s; }
.cal2 .cal-chip:hover { transform: translateX(1px); box-shadow: 0 2px 6px rgba(15,27,45,.1); }
.cal2 .cal-chip.published { background: #ecfaf3; color: #065f46; border-left-color: #10b981; }
.cal2 .cal-chip.failed { background: #fff1f1; color: #991b1b; border-left-color: #ef4444; }
.cal2 .cal-chip.pending_approval { background: #fff8e6; color: #7a4d00; border-left-color: #f59e0b; }
.cal2 .cal-chip.draft { background: #f3f4f8; color: var(--text-2); border-left-color: #a3acc2; }
.cal2 .cal-chip.slot { background: #f6f7fb; color: var(--text-2); border-left-color: var(--slot, #a3acc2); }
.cal2 .cal-chip .t { font-weight: 700; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.cal2 .cal-chip .t small { font-size: 9.5px; font-weight: 600; margin-left: 1px; opacity: .8; }
.cal2 .cal-chip .txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cal2 .cal-chip .nets { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.cal2 .cal-chip .nets i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.cal2 .cal-chip .nets .n-facebook { background: #1877f2; }
.cal2 .cal-chip .nets .n-instagram { background: #e1306c; }
.cal2 .cal-extra { display: none; }
.cal2 .cal-day.expanded .cal-extra { display: flex; }
.cal2 .cal-more { font: inherit; font-size: 11.5px; font-weight: 600; color: var(--primary); background: none; border: 0; padding: 2px 4px; text-align: left; cursor: pointer; border-radius: 6px; }
.cal2 .cal-more:hover { background: var(--primary-soft); }
.cal2-legend { margin-top: 14px; gap: 18px; }

/* ---------- Queue ---------- */
.queue-toolbar { border-bottom: 0; align-items: center; margin-bottom: 16px; }
.queue-toolbar .tabs { display: inline-flex; gap: 2px; padding: 4px; background: #fff; border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow); }
.queue-toolbar .tabs a { border-bottom: 0; border-radius: 9px; padding: 7px 14px; font-size: 13px; color: var(--text-2); }
.queue-toolbar .tabs a:hover { background: var(--surface-2); color: var(--text); }
.queue-toolbar .tabs a.active { background: #2563eb; color: #fff; }
.queue-toolbar .tabs a.active .count { background: rgba(255,255,255,.22); border-color: transparent; color: #fff; }
.queue-filter { padding-bottom: 0; }
.queue-filter select { min-width: 260px; max-width: 360px; padding: 9px 12px; box-shadow: var(--shadow); }

.q-list { padding: 4px 24px 12px; }
.q-day { position: sticky; top: 68px; z-index: 4; display: flex; align-items: baseline; gap: 10px; padding: 16px 0 10px; background: #fff; border-bottom: 1px solid var(--border); }
.q-day-name { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.q-day-date { font-size: 13px; color: var(--muted); }
.q-day-count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: #1d4fd8; background: #e8f0ff; border-radius: 999px; padding: 2px 10px; }

.q-list .post-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 16px 12px; margin: 0 -12px; border-radius: 12px; border-bottom: 1px solid #eef1f6; }
.q-list .post-item:hover { background: #f8faff; }
.q-list .post-item .when { width: auto; padding-top: 2px; }
.q-list .post-item .when strong { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.q-list .post-summary { gap: 14px; }
.q-list .post-thumb .thumb { width: 72px; height: 72px; border-radius: 12px; box-shadow: 0 1px 3px rgba(15,27,45,.12); }
.q-text { min-width: 0; flex: 1; }
.q-client { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-list .post-item .text.clamp-2 { font-size: 13px; color: var(--text-2); }
.q-list .post-meta { margin-top: 10px; gap: 6px; }
.q-list .post-meta > .nowrap { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-weight: 500; }
.q-list .post-meta > .nowrap .net-icon { width: 18px; height: 18px; font-size: 9px; border-radius: 50%; }
.q-list .post-actions { margin-top: 12px; gap: 6px; }
.q-list .post-actions .btn-sm { padding: 6px 11px; font-size: 12.5px; background: #fff; }
.q-list .post-actions .btn-sm:hover { border-color: #bcd2ff; color: var(--primary-dark); background: #f5f8ff; }
.q-list .post-actions .btn-primary, .q-list .post-actions .btn-success { color: #fff; }
.q-list .post-actions .btn-primary { background: linear-gradient(180deg, #3b74f0, #2563eb); }

@media (max-width: 860px) {
    .q-list { padding: 4px 14px 10px; }
    .q-list .post-item { grid-template-columns: 1fr; gap: 8px; }
    .q-list .post-item .when { display: flex; gap: 8px; align-items: baseline; }
    .q-day { top: 60px; }
    .queue-filter select { min-width: 0; width: 100%; }
    .cal2-title h2 { font-size: 21px; }
}

/* Queue day headings v2: easy to spot while scrolling */
.q-list .q-day { align-items: center; gap: 12px; margin: 22px -24px 6px; padding: 12px 24px; background: linear-gradient(90deg, #eaf1ff 0%, #f6f9ff 60%, #ffffff 100%); border-top: 1px solid #d6e3ff; border-bottom: 1px solid #d6e3ff; border-left: 5px solid #2563eb; }
.q-list > .q-day:first-child { margin-top: -4px; }
.q-day-tile { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 11px; background: #2563eb; color: #fff; line-height: 1; box-shadow: 0 4px 10px rgba(37, 99, 235, .28); flex: 0 0 auto; }
.q-day-tile b { font-size: 19px; font-weight: 800; }
.q-day-tile small { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; opacity: .9; }
.q-list .q-day-name { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.q-list .q-day-date { font-size: 14px; font-weight: 500; color: var(--text-2); }
.q-list .q-day-count { font-size: 12.5px; padding: 4px 12px; background: #2563eb; color: #fff; }
.q-list .q-day.is-today { background: linear-gradient(90deg, #fff4dc 0%, #fffaf0 60%, #ffffff 100%); border-color: #f6dfa6; border-left-color: #f59e0b; }
.q-list .q-day.is-today .q-day-tile, .q-list .q-day.is-today .q-day-count { background: #f59e0b; box-shadow: 0 4px 10px rgba(245, 158, 11, .3); }
.q-list .q-day.is-past { background: linear-gradient(90deg, #f1f3f7 0%, #f8f9fb 60%, #ffffff 100%); border-color: #e2e6ee; border-left-color: #94a3b8; }
.q-list .q-day.is-past .q-day-tile, .q-list .q-day.is-past .q-day-count { background: #64748b; box-shadow: none; }
@media (max-width: 860px) {
    .q-list .q-day { margin-left: -14px; margin-right: -14px; padding: 10px 14px; }
    .q-list .q-day-name { font-size: 17px; }
    .q-list .q-day-date { display: none; }
}
/* Queue search box */
.queue-toolbar { flex-wrap: wrap; }
.queue-search { position: relative; flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; margin-left: auto; }
.queue-search svg { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.queue-search input[type=search] { padding: 9px 90px 9px 38px; border-radius: 11px; box-shadow: var(--shadow); }
.queue-search-count { position: absolute; right: 10px; font-size: 11.5px; font-weight: 700; color: #1d4fd8; background: #e8f0ff; border-radius: 999px; padding: 2px 9px; pointer-events: none; }
.queue-toolbar .queue-filter { margin-left: 0; }
.queue-toolbar .queue-filter select { min-width: 220px; }
@media (max-width: 860px) { .queue-search { max-width: none; flex-basis: 100%; margin-left: 0; } }