/* Scoped Social workspace: no effect on task views or the application shell. */
.social-page, .social-dialog { --social-accent:#7c3aed; --social-ink:#182230; --social-muted:#5d6778; --social-border:#e4e7ee; color:var(--social-ink); font-size:14px; line-height:1.5; }
.social-page *, .social-dialog * { box-sizing:border-box; }
.social-page { width:100%; max-width:1280px; margin:0 auto; padding:32px clamp(16px,3vw,40px) 48px; overflow:auto; min-height:0; flex:1; }
.social-page h1 { font-size:28px; letter-spacing:-.8px; line-height:1.2; margin:5px 0 8px; font-weight:750; }
.social-page h2, .social-dialog h2 { font-size:21px; line-height:1.3; font-weight:700; margin:0 0 8px; }
.social-page h3, .social-dialog h3 { font-size:15px; font-weight:650; margin:0 0 6px; }
.social-dialog h4 { font-size:13px; font-weight:650; margin:20px 0 10px; }
.social-page p, .social-dialog p { margin:6px 0; }
.social-muted { color:var(--social-muted); font-size:13px; line-height:1.55; }
.social-eyebrow { font-size:10px; letter-spacing:1.6px; font-weight:750; color:var(--social-accent); }
.social-header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; }
#social-header-actions { display:flex; gap:8px; flex-wrap:wrap; }
.social-page .btn, .social-dialog .btn { display:inline-flex; justify-content:center; align-items:center; gap:6px; min-height:40px; padding:9px 15px; font:inherit; font-size:13px; font-weight:600; border-radius:9px; border:1px solid var(--social-border); text-decoration:none; cursor:pointer; white-space:normal; line-height:1.4; }
.social-page .btn-primary, .social-dialog .btn-primary { background:var(--social-accent); color:#fff; border-color:var(--social-accent); }
.social-page .btn-secondary, .social-dialog .btn-secondary { background:#fff; color:#344054; }
.social-page .btn:hover:not(:disabled), .social-dialog .btn:hover:not(:disabled) { filter:brightness(.96); }
.social-page button:disabled, .social-dialog button:disabled { opacity:.45; cursor:not-allowed; }
.social-page :focus-visible, .social-dialog :focus-visible { outline:3px solid #a78bfa; outline-offset:3px; }
.social-page [hidden], .social-dialog [hidden], #nav-social[hidden] { display:none!important; }
.social-page label, .social-dialog label { display:block; font-size:13px; font-weight:550; margin:12px 0; }
.social-page select, .social-page input, .social-dialog input:not([type=checkbox]), .social-dialog select, .social-dialog textarea { display:block; width:100%; font:inherit; color:var(--social-ink); background:#fff; padding:10px 12px; min-height:44px; border:1px solid #cdd3df; border-radius:8px; margin-top:6px; max-width:100%; }
.social-dialog textarea { resize:vertical; }
.social-page input::placeholder, .social-dialog input::placeholder, .social-dialog textarea::placeholder { color:#747e8e; }
.social-account-card { padding:20px 24px; background:#fff; border:1px solid var(--social-border); border-radius:14px; display:grid; grid-template-columns:minmax(200px,1fr) 1.6fr; gap:32px; align-items:center; }
.social-account-card label { margin:0; }
#social-connection { border-left:1px solid var(--social-border); padding-left:28px; }
.social-badge { display:inline-flex; align-items:center; gap:6px; border-radius:6px; background:#f1ecfc; color:#6530b3; font-size:12px; font-weight:600; padding:4px 8px; }
.social-badge.success { background:#edf8f2; color:#166443; }
.social-badge.warning { background:#fff6e8; color:#945314; }
.social-notice { display:flex; align-items:baseline; gap:10px; background:#f2effb; border:1px solid #e7defa; color:#584278; border-radius:10px; padding:12px 16px; margin:16px 0 24px; font-size:13px; }
.social-notice strong { flex-shrink:0; }
.social-content-card { background:#fff; border:1px solid var(--social-border); border-radius:14px; overflow:hidden; margin-top:24px; }
.social-tabs { display:flex; gap:20px; padding:0 24px; border-bottom:1px solid var(--social-border); overflow-x:auto; }
.social-tab { flex-shrink:0; display:flex; gap:7px; align-items:center; padding:17px 0 14px; background:none; border:none; border-bottom:3px solid transparent; color:var(--social-muted); font:inherit; font-size:13px; cursor:pointer; }
.social-tab.active { color:var(--social-accent); border-bottom-color:var(--social-accent); font-weight:650; }
.social-tab span { padding:1px 6px; border-radius:5px; background:#f1f2f6; font-size:11px; }
.social-tab.active span { background:#eee7fc; }
.social-list-toolbar { padding:24px 24px 8px; display:flex; gap:24px; justify-content:space-between; align-items:center; }
.social-list-toolbar h2 { font-size:18px; margin:0; }
.social-search { width:240px; flex-shrink:0; margin:0!important; }
.social-search input { margin:0; }
#social-list { padding:0 24px; }
.social-row { display:flex; gap:16px; align-items:center; padding:18px 0; border-bottom:1px solid #edf0f4; }
.social-row:last-child { border-bottom:none; }
.social-row > div { flex:1; min-width:0; }
.social-row h3 { overflow-wrap:anywhere; }
.social-row > .btn { flex-shrink:0; }
.social-task-thumbnail { display:flex; align-items:center; justify-content:center; width:64px; height:64px; flex:0 0 64px; overflow:hidden; background:#f5f2fb; border:1px solid var(--social-border); border-radius:10px; color:#9a7dbd; font-size:24px; }
.social-task-thumbnail img { width:100%; height:100%; object-fit:contain; }
.social-thumbnail-placeholder { line-height:1; }
.social-row-meta { display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:12px; color:var(--social-muted); }
.social-row a { color:var(--social-accent); font-size:13px; }
#social-pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 24px; border-top:1px solid var(--social-border); }
#social-pagination:empty { display:none; }
.social-empty { text-align:center; padding:48px 18px; color:var(--social-muted); }
.social-empty h3 { color:var(--social-ink); font-size:17px; }
.social-empty .btn { margin-top:14px; }
.social-calendar-section { margin-top:24px; padding:18px 22px; border:1px solid var(--social-border); border-radius:12px; background:#fff; }
.social-page summary, .social-dialog summary { cursor:pointer; font-size:14px; font-weight:600; padding:6px 0; }
.social-dialog { position:fixed; inset:0; margin:auto; color:var(--social-ink); background:#fff; border:1px solid var(--social-border); border-radius:18px; padding:28px; width:min(760px,calc(100vw - 40px)); max-width:none; max-height:calc(100dvh - 48px); overflow:auto; box-shadow:0 24px 80px #15223740; }
.social-dialog::backdrop { background:#14203380; backdrop-filter:blur(3px); }
.social-dialog-header { padding-right:40px; margin-bottom:24px; }
.social-dialog-header h2 { margin-top:5px; }
.social-close { position:absolute; top:20px; right:20px; width:36px; font-size:22px!important; padding:3px!important; }
.social-form-section { margin-top:24px; padding-top:22px; border-top:1px solid var(--social-border); }
.social-step { display:inline-flex; align-items:center; justify-content:center; width:25px; height:25px; font-size:12px; color:var(--social-accent); background:#f1ebfd; border-radius:50%; margin-right:5px; }
.social-toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:14px 0; }
.social-toolbar label { flex:1; }
.social-connection-box { padding:16px; background:#fafbfe; border:1px solid var(--social-border); border-radius:10px; margin-top:16px; }
.social-connection-box button { margin-top:12px; }
.social-setting-group { margin-top:16px; padding:12px 16px; border:1px solid var(--social-border); border-radius:10px; }
.social-setting-group summary span { display:block; margin-left:16px; font-size:12px; font-weight:400; color:var(--social-muted); }
.social-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 18px; }
.social-members { max-height:220px; overflow:auto; }
.social-dialog .social-member { display:flex; gap:10px; align-items:center; padding:8px; margin:0; min-height:48px; border-radius:6px; }
.social-member:hover { background:#f6f3fb; }
.social-member input, .social-dialog input[type=checkbox] { width:18px; height:18px; accent-color:var(--social-accent); flex-shrink:0; }
.social-member small { display:block; font-size:11px; color:var(--social-muted); font-weight:400; }
.social-dialog-footer { display:flex; gap:16px; align-items:center; justify-content:space-between; margin-top:28px; padding:16px 0 0; border-top:1px solid var(--social-border); background:#fff; }
.social-dialog-footer > div { display:flex; gap:8px; }
.social-media { display:grid; grid-template-columns:repeat(auto-fill,minmax(135px,1fr)); gap:10px; max-height:360px; overflow:auto; padding:3px; }
.social-file { position:relative; overflow-wrap:anywhere; background:#fbfcfe; color:var(--social-ink); border:1px solid var(--social-border); border-radius:10px; padding:10px; cursor:pointer; font:inherit; font-size:12px; min-height:64px; text-align:left; }
.social-file:hover { border-color:#ac91dc; }
.social-file[aria-pressed=true] { border:2px solid var(--social-accent); padding:9px; background:#f6f1ff; }
.social-file[aria-pressed=true]::after { content:'✓'; position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%; text-align:center; background:var(--social-accent); color:#fff; font-weight:700; }
.social-file img { width:100%; height:115px; object-fit:contain; display:block; margin-bottom:10px; border-radius:5px; background:#f0f1f6; }
.social-selected-row { display:flex; gap:10px; align-items:center; padding:10px 0; border-bottom:1px solid var(--social-border); }
.social-selected-row > span:nth-child(2) { flex:1; overflow-wrap:anywhere; min-width:0; font-size:13px; }
.social-selected-row > div { display:flex; gap:4px; }
.social-selected-row .btn { min-width:36px; padding:7px 10px; }
.social-rank { display:flex; justify-content:center; align-items:center; width:24px; height:24px; border-radius:50%; flex:0 0 24px; background:#f0eafc; color:var(--social-accent); font-weight:600; }
.social-selection-empty { background:#f8f9fc; border:1px dashed #d6dce7; padding:14px; border-radius:8px; }
.social-help { margin:16px 0; padding:10px 14px; background:#f8f9fc; border-radius:8px; }
.social-help summary { font-size:13px; }
.social-help p { font-size:13px; color:var(--social-muted); }
.social-preview { display:flex; gap:12px; overflow:auto; padding:10px 0; scroll-snap-type:x mandatory; }
.social-preview img, .social-preview video { width:300px; max-width:85%; object-fit:contain; border-radius:10px; background:#f3f4f7; scroll-snap-align:start; }
.social-caption-preview { white-space:pre-wrap; padding:16px; background:#f8f9fc; border-radius:10px; overflow-wrap:anywhere; }
.social-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; margin-top:14px; }
.social-day { border:1px solid var(--social-border); border-radius:8px; padding:10px 4px; font-size:11px; line-height:1.7; text-align:center; }
button.social-day { cursor:pointer; }
.social-day.empty { background:#fafbfc; color:#667085; }
.social-day.some { background:#f0ebfb; color:#6434ac; }
.social-day.full { background:#fff4e5; color:#8e521c; }
.social-day-post { display:flex; gap:10px; align-items:center; padding:10px; border-bottom:1px solid var(--social-border); }
.social-day-post img, .social-day-post video { width:64px; height:64px; object-fit:contain; }
.social-error:not(:empty), .social-inline-error { padding:12px; color:#a72828; background:#fff3f3; border-radius:8px; margin:12px 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.social-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
[aria-busy=true].social-page::after, [aria-busy=true].social-dialog::after { content:'Sedang memproses…'; position:fixed; bottom:20px; left:50%; transform:translateX(-50%); z-index:20; padding:10px 18px; border-radius:30px; background:#34214d; color:white; box-shadow:0 3px 16px #0002; font-size:13px; }
@media(max-width:800px) {
 .social-page { padding:24px 20px 36px; }
 .social-list-toolbar { align-items:stretch; flex-direction:column; gap:12px; }
 .social-search { width:100%; }
 .social-account-card { gap:20px; padding:18px; }
 #social-connection { padding-left:20px; }
 .social-tabs { gap:18px; padding:0 18px; }
}
@media(max-width:600px) {
 .social-page { padding:22px 14px 32px; }
 .social-header { align-items:flex-start; flex-direction:column; gap:16px; }
 .social-page h1 { font-size:26px; }
 #social-header-actions { width:100%; }
 #social-header-actions .btn { flex:1; }
 .social-account-card { grid-template-columns:1fr; gap:14px; }
 #social-connection { border-left:none; border-top:1px solid var(--social-border); padding:14px 0 0; }
 .social-notice { flex-direction:column; gap:3px; }
 .social-list-toolbar { padding:18px 16px 8px; }
 #social-list { padding:0 16px; }
 .social-row { flex-wrap:wrap; gap:12px; }
 .social-row > div { flex-basis:calc(100% - 76px); }
 .social-row > .btn { width:100%; }
 .social-row a { padding:8px 0; }
 #social-pagination { padding:16px; flex-wrap:wrap; }
 .social-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); padding:20px 16px; border-radius:14px; }
 .social-dialog-header { margin-bottom:20px; }
 .social-close { top:12px; right:12px; }
 .social-page .btn, .social-dialog .btn { min-height:44px; }
 .social-form-grid { grid-template-columns:1fr; }
 .social-dialog-footer { flex-direction:column; align-items:stretch; gap:10px; }
 .social-dialog-footer > div { display:grid; grid-template-columns:1fr 1fr; }
 .social-selected-row { flex-wrap:wrap; }
 .social-selected-row > div { margin-left:auto; }
 .social-days { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .social-calendar-section { padding:14px; }
}
/* Keep the save action in reach while longer settings are expanded. */
.social-dialog-footer { position:sticky; bottom:-28px; margin-left:-28px; margin-right:-28px; padding:16px 28px; z-index:2; box-shadow:0 -6px 14px #18223005; }
@media(max-width:600px) { .social-dialog-footer { bottom:-20px; margin-left:-16px; margin-right:-16px; padding:12px 16px; } }
/* Match the application's existing theme toggle. */
body:not(.light-mode) .social-page, body:not(.light-mode) .social-dialog { --social-ink:#f0edf6; --social-muted:#b3afbf; --social-border:#35313f; color:var(--social-ink); }
body:not(.light-mode) .social-page { background:#14121b; }
body:not(.light-mode) .social-dialog, body:not(.light-mode) .social-account-card, body:not(.light-mode) .social-content-card, body:not(.light-mode) .social-calendar-section, body:not(.light-mode) .social-dialog-footer { background:#201c29; }
body:not(.light-mode) .social-page .btn-secondary, body:not(.light-mode) .social-dialog .btn-secondary, body:not(.light-mode) .social-page input, body:not(.light-mode) .social-page select, body:not(.light-mode) .social-dialog input:not([type=checkbox]), body:not(.light-mode) .social-dialog select, body:not(.light-mode) .social-dialog textarea { background:#292434; color:#f0edf6; border-color:#484050; }
body:not(.light-mode) .social-eyebrow, body:not(.light-mode) .social-tab.active, body:not(.light-mode) .social-row a { color:#c7adff; }
body:not(.light-mode) .social-notice { background:#2b213e; color:#decffa; border-color:#443356; }
body:not(.light-mode) .social-badge, body:not(.light-mode) .social-tab.active span, body:not(.light-mode) .social-step, body:not(.light-mode) .social-rank { background:#342647; color:#dcc5ff; }
body:not(.light-mode) .social-badge.success { background:#173b30; color:#9bd8bf; }
body:not(.light-mode) .social-badge.warning { background:#49351e; color:#f2cf9d; }
body:not(.light-mode) .social-tab span, body:not(.light-mode) .social-help, body:not(.light-mode) .social-connection-box, body:not(.light-mode) .social-selection-empty, body:not(.light-mode) .social-caption-preview, body:not(.light-mode) .social-file { background:#282331; }
body:not(.light-mode) .social-file[aria-pressed=true] { background:#37274a; border-color:#b28ae8; }
body:not(.light-mode) .social-row, body:not(.light-mode) .social-selected-row { border-color:#35313f; }
body:not(.light-mode) .social-task-icon { background:#30253f; color:#bda3e0; }
body:not(.light-mode) .social-error:not(:empty), body:not(.light-mode) .social-inline-error { background:#42262b; color:#ffbcbc; }
body:not(.light-mode) .social-member:hover { background:#362b43; }
body:not(.light-mode) .social-day.empty { background:#292434; color:#b3afbf; }
body:not(.light-mode) .social-day.some { background:#342647; color:#dcc5ff; }
body:not(.light-mode) .social-day.full { background:#49351e; color:#f2cf9d; }

/* Compact Instagram context inside the task sidebar; independent of the workspace. */
.social-task-panel { --social-ink:var(--text-main); --social-muted:var(--text-muted); --social-border:var(--border); min-width:0; padding:16px; border:1px solid var(--border); border-radius:12px; background:var(--bg-card); color:var(--text-main); }
.social-task-panel header h3 { margin:0 0 14px; font-size:.95rem; font-weight:700; }
.social-task-panel p { margin:0 0 12px; line-height:1.5; }
.social-task-panel .social-task-account { display:flex; flex-direction:column; gap:5px; font-size:.8rem; color:var(--text-muted); margin-bottom:14px; }
.social-task-panel .social-task-account strong { color:var(--text-main); font-size:.95rem; overflow-wrap:anywhere; }
.social-task-panel select { width:100%; min-width:0; min-height:44px; padding:8px; border:1px solid var(--border); border-radius:8px; background:var(--bg-body); color:var(--text-main); font:inherit; }
.social-task-posts { list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.social-task-post { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px 0; border-top:1px solid var(--border); }
.social-task-post > div { display:flex; flex:1 1 130px; flex-wrap:wrap; align-items:center; gap:7px; min-width:0; }
.social-task-post small { flex-basis:100%; color:var(--text-muted); overflow-wrap:anywhere; }
.social-task-panel .btn { min-height:44px; white-space:normal; line-height:1.35; overflow-wrap:anywhere; }
.social-task-create { width:100%; justify-content:center; }
.social-task-panel .social-muted { font-size:.8rem; }
.social-task-panel .social-task-note { font-size:.75rem; color:var(--text-muted); border-top:1px solid var(--border); padding-top:12px; margin:14px 0 0; }
.social-task-history { margin-top:12px; font-size:.8rem; }
.social-task-history summary { min-height:44px; cursor:pointer; display:flex; align-items:center; color:var(--text-muted); }
.social-task-history summary::before { content:'▸'; margin-right:7px; }
.social-task-history[open] summary::before { content:'▾'; }
.social-task-panel :focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
@media(max-width:400px) { .social-task-post { display:grid; } .social-task-post .btn { width:100%; justify-content:center; } }

.social-task-panel .btn-secondary { border:1px solid var(--border); background:var(--bg-body); color:var(--text-main); border-radius:8px; padding:9px 12px; font-size:.8rem; }
.social-task-panel .btn-secondary:hover { background:var(--bg-card-hover); }
