/* Social planner layout — icon rail, calendar, composer. Builds on the shared agency style.css. */
:root {
  --accent: #f26b1d; --accent-dark: #d95a10; --peach: #fff3eb; --peach-2: #ffe6d6; --peach-line: #ffd4b8;
  --primary: #f26b1d; --bg: #f6f6f8; --line: #e9e9ef; --text: #1f2330; --muted: #737787;
}
body { background: var(--bg); }
a { color: var(--accent-dark); }
.btn.primary, .btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.accent:hover, .btn.primary:hover { background: var(--accent-dark); filter: none; }
.btn { border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--peach-2); border-color: var(--accent); }
.hidden { display: none !important; }
.spacer { flex: 1; }
.pad { padding: 18px; }
.small { font-size: 13px; }
.red { color: var(--danger); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.pi { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
.ti { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.hint-card { padding: 16px 18px; margin-bottom: 14px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; width: 64px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px; z-index: 5; }
.rail-logo img { display: block; border-radius: 8px; }
.rail nav, .rail-bottom { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 14px; }
.rail-bottom { margin-top: auto; }
.rail a[data-tip] { position: relative; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #4b4f5c; }
.rail a[data-tip] svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail a[data-tip]:hover { background: var(--peach); color: var(--accent); }
.rail a.active { background: var(--peach-2); color: var(--accent); }
.rail a[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 52px; top: 50%; transform: translateY(-50%); background: #1f2330; color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.me { width: 34px; height: 34px; border-radius: 50%; background: #2b2f3a; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-top: 6px; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.banner { background: #fef2f2; color: #7f1d1d; border-bottom: 1px solid #fecaca; padding: 10px 24px; font-size: 14px; }
main { max-width: none; margin: 0; padding: 20px 24px; flex: 1; width: 100%; }
body[data-page="clients"] main, body[data-page="accounts"] main, body[data-page="users"] main { max-width: 1150px; }
.page-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 20px; flex: 1; }
.pill-select { width: auto; padding: 7px 30px 7px 12px; border-radius: 8px; font-size: 14px; }

/* ---------- calendar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.nav-box { display: inline-flex; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; height: 38px; }
.nav-box button { border: 0; background: none; font-size: 20px; width: 34px; height: 100%; cursor: pointer; color: #4b4f5c; }
.nav-box button:hover { color: var(--accent); }
.nav-box span { font-weight: 600; font-size: 14px; min-width: 96px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; color: #4b4f5c; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-h { padding: 10px; text-align: center; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.cal-h:nth-child(7) { border-right: 0; }
.cal-d { position: relative; min-height: 140px; padding: 6px 6px 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.cal-week .cal-d { min-height: calc(100vh - 210px); }
.cal-d:nth-child(7n + 7) { border-right: 0; }
.cal-d.out { background: #fafafb; }
.cal-d.out .cal-n { color: #c0c3cc; }
.cal-n { font-size: 12px; color: var(--muted); margin: 0 0 6px 2px; }
.today-pill { background: var(--accent); color: #fff; border-radius: 6px; padding: 2px 7px; font-weight: 600; }
.cal-posts { display: grid; gap: 5px; }
.cal-posts.clip > :nth-child(n + 4) { display: none; }
.show-all { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.show-all:hover { color: var(--accent); }
.cell-add { position: absolute; right: 6px; bottom: 5px; width: 20px; height: 20px; border-radius: 5px; background: #6b7080; color: #fff; display: grid; place-items: center; font-size: 15px; line-height: 1; opacity: .25; }
.cal-d:hover .cell-add { opacity: 1; background: var(--accent); }

/* post card */
.pc { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--accent)); background: #fff; border-radius: 7px; padding: 5px 7px; font: inherit; cursor: pointer; color: var(--text); min-width: 0; }
.pc:hover { border-color: var(--peach-line); border-left-color: var(--c, var(--accent)); box-shadow: 0 2px 8px rgba(242, 107, 29, .12); }
.pc-h { display: flex; align-items: center; gap: 5px; font-size: 12px; min-width: 0; }
.pc-h .pi { width: 14px; height: 14px; }
.pc-h b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.pc-t { font-size: 11px; font-weight: 600; white-space: nowrap; color: #4b4f5c; }
.pc-b { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); margin-top: 3px; min-width: 0; }
.pc-b > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pc-b i { font-style: normal; font-weight: 600; }
.pc.st-draft { border-style: dashed; border-left-style: solid; background: #fcfcfd; }
.pc.st-published { background: #f6fbf7; }
.pc.st-failed, .pc.st-partial { background: #fff5f5; border-color: #f8caca; }
.cal-week .pc-b > span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* list view */
.cal-list { display: grid; gap: 10px; }
.cl-day { display: grid; grid-template-columns: 70px 1fr; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.cl-day.today { border-color: var(--peach-line); background: #fffaf6; }
.cl-date { text-align: center; }
.cl-date b { display: block; font-size: 24px; }
.cl-date span { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.cl-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }

/* status pills */
.pill.st-draft { background: #eef0f3; color: var(--muted); }
.pill.st-scheduled, .pill.st-publishing { background: var(--peach); color: var(--accent-dark); }
.pill.st-published { background: var(--ok-bg); color: var(--ok); }
.pill.st-failed, .pill.st-partial { background: var(--danger-bg); color: var(--danger); }

/* ---------- publish section ---------- */
.with-side { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 0; flex: 1; min-width: 0; }
body[data-page="compose"] .main-col { height: 100vh; }
body[data-page="compose"] main, body[data-page="posts"] main { padding: 0; display: flex; min-height: 0; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #3b3f4b; font-size: 14px; }
.side a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side a:hover { background: var(--peach); }
.side a.on { background: var(--peach-2); color: var(--accent-dark); font-weight: 600; }
.badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 7px; }
.side-main { padding: 20px 24px; min-width: 0; }

/* queue */
.q-day h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 18px 0 8px; }
.q-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.q-row:hover { border-color: var(--peach-line); }
.q-time { font-weight: 700; font-variant-numeric: tabular-nums; width: 48px; flex: none; }
.q-main { flex: 1; min-width: 0; }
.q-accts { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.q-cap { color: #4b4f5c; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
.bad-icon { opacity: .55; text-decoration: line-through; }

/* composer */
.compose-page { grid-template-columns: 210px minmax(0, 1fr) minmax(300px, 32%); min-height: 0; }
.composer { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.composer-scroll { flex: 1; overflow: auto; padding: 20px 24px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.picker { position: relative; display: flex; align-items: center; min-height: 50px; padding: 6px 40px 6px 8px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chips .placeholder { padding: 6px; }
.chip-acct { display: inline-flex; align-items: center; gap: 6px; background: var(--peach); border: 1px solid var(--peach-line); border-radius: 99px; padding: 3px 6px 3px 3px; font-size: 13px; font-weight: 600; }
.chip-acct img, .chip-acct .av { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.av { display: inline-block; background: #d9dbe2; border-radius: 50%; width: 24px; height: 24px; }
.av.big { width: 38px; height: 38px; }
.chip-acct .pi { width: 14px; height: 14px; margin-left: -12px; margin-top: 14px; box-shadow: 0 0 0 2px #fff; border-radius: 50%; }
.chip-acct button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); padding: 0 2px; }
.chip-acct small { color: var(--ok); font-weight: 600; }
.picker-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; }
.menu { position: absolute; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(20, 22, 30, .14); padding: 6px; }
#pMenu { left: 0; right: 0; top: calc(100% + 4px); max-height: 340px; overflow: auto; cursor: default; }
.m-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 8px 4px; }
.m-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; margin: 0; color: var(--text); font-size: 14px; cursor: pointer; }
.m-item:hover { background: var(--peach); }
.m-item input { width: auto; margin: 0; accent-color: var(--accent); }
.m-empty { padding: 8px; margin: 0; font-size: 13px; }
.picker-foot { display: flex; align-items: center; gap: 14px; margin: 8px 2px 14px; font-size: 13px; }
.link-btn { border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); padding: 0; }
.link-btn:hover { color: var(--accent); }
.qs { position: relative; }
#qsMenu { right: 0; top: calc(100% + 6px); min-width: 200px; }
#qsMenu button { display: flex; align-items: center; width: 100%; border: 0; background: none; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 7px; cursor: pointer; text-align: left; }
#qsMenu button:hover { background: var(--peach); }
.editor { position: relative; padding: 4px; }
.editor textarea { border: 0; resize: vertical; min-height: 150px; padding: 12px; font-size: 15px; line-height: 1.5; }
.editor textarea:focus { outline: 0; }
.editor.over { border-color: var(--accent); background: var(--peach); }
.drop-hint { display: none; position: absolute; inset: 0; place-items: center; font-weight: 600; color: var(--accent); pointer-events: none; }
.editor.over .drop-hint { display: grid; }
.ed-tools { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding: 8px 8px 4px; }
.tool { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: #fff; display: grid; place-items: center; cursor: pointer; margin: 0; color: #4b4f5c; font: inherit; font-weight: 700; }
.tool:hover { border-color: var(--accent); color: var(--accent); }
.tool .ti { width: 16px; height: 16px; }
.counter { font-size: 12px; color: var(--muted); }
.counter.red { color: var(--danger); font-weight: 600; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 8px; padding: 0 12px; }
.media-grid:not(:empty) { padding-bottom: 10px; }
.m { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: #eef0f3; }
.m img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m.bad { outline: 2px solid var(--danger); }
.m .warn { position: absolute; left: 4px; bottom: 4px; right: 4px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 6px; padding: 2px 4px; text-align: center; }
.m-btns { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.m-btns button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; font-size: 11px; line-height: 1; }
.bottom-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 24px; background: #fff; border-top: 1px solid var(--line); }
.bottom-bar input[type=datetime-local] { width: auto; min-width: 0; flex: 0 1 215px; font-size: 14px; padding: 7px 8px; }
@media (min-width: 1101px) { .bottom-bar { flex-wrap: nowrap; } .bottom-bar > .muted { white-space: nowrap; } }
.bb-actions { margin-left: auto; display: flex; gap: 8px; }

/* preview */
.preview-pane { background: #fafafb; overflow: auto; padding: 16px 28px; }
.pv-tabs { display: flex; justify-content: center; gap: 18px; border-bottom: 1px solid var(--line); margin: 0 -28px 22px; }
.pv-tabs button { border: 0; background: none; padding: 8px 6px 10px; cursor: pointer; border-bottom: 3px solid transparent; }
.pv-tabs button.on { border-bottom-color: var(--accent); }
.pv-tabs .pi { width: 26px; height: 26px; }
.pv { max-width: 400px; margin: 0 auto; overflow: hidden; }
.pv-h { display: flex; align-items: center; gap: 10px; padding: 12px; font-size: 14px; }
.pv-h small { display: block; color: var(--muted); font-size: 12px; }
.pv-h .avatar { width: 38px; height: 38px; border-radius: 50%; }
.pv-skel { padding: 4px 12px 22px; display: grid; gap: 9px; }
.pv-skel i { height: 7px; border-radius: 4px; background: #e6e7ec; width: 88%; }
.pv-skel i:nth-child(2) { width: 100%; }
.pv-skel i:nth-child(3) { width: 55%; }
.pv-cap { padding: 0 12px 12px; white-space: pre-wrap; font-size: 14px; overflow-wrap: anywhere; }
.pv-instagram .pv-cap { padding-top: 10px; }
.pv-img { position: relative; background: #000; }
.pv-img img { width: 100%; display: block; max-height: 480px; object-fit: contain; }
.pv-n { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; border-radius: 99px; padding: 2px 8px; }
.pv-noimg { background: #f1f2f5; color: var(--muted); text-align: center; padding: 60px 10px; font-size: 14px; }
.pv-note { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 380px; margin: 16px auto; }

/* post dialog */
.thumbs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.thumbs img { height: 110px; border-radius: 8px; }
.caption { white-space: pre-wrap; background: #f7f7f9; border-radius: 10px; padding: 12px; max-height: 220px; overflow: auto; margin: 0 0 12px; }
.targets { display: grid; gap: 8px; margin-bottom: 14px; }
.target { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.target .error { flex-basis: 100%; margin: 0 0 0 24px; }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.post-actions .btn { text-decoration: none; }

/* clients / accounts / users pages */
img.avatar { width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; margin-right: 8px; object-fit: cover; }
.inline-select { width: auto; padding: 5px 8px; font-size: 14px; }
.acct-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--peach); border-radius: 99px; padding: 3px 10px 3px 4px; margin: 2px 2px 2px 0; font-size: 13px; }
.intro { margin: -6px 0 16px; max-width: 760px; }
.fb-btn { display: inline-flex; align-items: center; gap: 8px; background: #1877f2 !important; border-color: #1877f2 !important; color: #fff; }
.fb-btn .pi circle { fill: #fff; }
.fb-btn .pi path { fill: #1877f2; }
.setup.needs { border-color: var(--peach-line); }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; align-items: end; }
.setup-grid > div { margin-bottom: 12px; }
.setup details { margin-top: 6px; }
.setup summary { cursor: pointer; font-weight: 600; color: var(--accent-dark); }
.steps { line-height: 1.6; padding-left: 20px; }
code { background: #f1f2f5; padding: 1px 5px; border-radius: 4px; font-size: 13px; word-break: break-all; }
th { background: #fafafb; }

@media (max-width: 1100px) {
  .compose-page { grid-template-columns: 180px minmax(0, 1fr); }
  body[data-page="compose"] .main-col { height: auto; }
  .preview-pane { grid-column: 2; border-top: 1px solid var(--line); }
  .composer { border-right: 0; }
  .with-side { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .rail { width: 52px; }
  .rail a[data-tip] { width: 38px; height: 38px; }
  main { padding: 14px; }
  .with-side, .compose-page { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .side a { white-space: nowrap; }
  .preview-pane { grid-column: 1; }
  .cal-h { font-size: 11px; padding: 6px 2px; }
  .cal-d { min-height: 90px; padding: 3px 3px 24px; }
  .pc-b, .pc-h b { display: none; }
}

/* live on Pages */
.side-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.live-row { cursor: default; }
.q-img.noimg { display: grid; place-items: center; background: #f1f2f5; color: var(--muted); }
.more { text-align: center; margin: 12px 0; }
.center { text-align: center; }

/* video + reels */
.type-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; font-size: 14px; }
.type-row .seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; }
.m.video img { filter: brightness(.85); }
.m .play, .q-img-wrap .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-style: normal; font-size: 22px; text-shadow: 0 1px 6px rgba(0,0,0,.5); pointer-events: none; }
.m .dur { position: absolute; left: 4px; top: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 5px; padding: 1px 5px; }
.m.video { background: #1f2330; }
.q-img-wrap { position: relative; display: inline-block; flex: none; }
.q-img-wrap .play { font-size: 14px; }
.upload-bar { position: relative; height: 22px; margin: 0 12px 10px; background: var(--peach); border-radius: 99px; overflow: hidden; }
.upload-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width .2s; }
.upload-bar span { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 600; line-height: 22px; color: #3b2a1f; }
.pv-img video { width: 100%; display: block; max-height: 480px; background: #000; }
.pv-img.pv-reel video { aspect-ratio: 9 / 16; max-height: 560px; object-fit: cover; }
.thumbs video { height: 160px; border-radius: 8px; background: #000; }

/* inbox */
.rail a[data-tip] { overflow: visible; }
.rail-badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.rail-badge.human { background: var(--danger); }
body[data-page="inbox"] main { padding: 0; display: flex; min-height: 0; }
body[data-page="inbox"] .main-col { height: 100vh; }
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); flex: 1; min-height: 0; }
.ib-list { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ib-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 8px; }
.ib-head h1 { flex: 1; margin: 0; font-size: 20px; }
.ib-filters { display: grid; gap: 8px; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.ib-filters .pill-select { width: 100%; }
.seg.small { display: flex; }
.seg.small a { flex: 1; text-align: center; padding: 6px 4px; font-size: 13px; color: #4b4f5c; border-right: 1px solid var(--line); }
.seg.small a:last-child { border-right: 0; }
.seg.small a.on { background: var(--accent); color: #fff; font-weight: 600; }
.ib-note { margin: 8px 16px 0; font-size: 13px; color: var(--muted); }
.ib-convs { overflow: auto; flex: 1; }
.ib-conv { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.ib-conv:hover { background: #fafafb; }
.ib-conv.on { background: var(--peach); }
.ib-conv.unread b { font-weight: 800; }
.ib-av .pi { width: 26px; height: 26px; }
.ib-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ib-top { display: flex; justify-content: space-between; gap: 8px; }
.ib-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ib-top small { color: var(--muted); white-space: nowrap; }
.ib-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-sub .dot { width: 7px; height: 7px; margin-right: 4px; }
.ib-tags { display: flex; gap: 4px; }
.ib-tags:empty { display: none; }
.ib-empty { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 30px; }
.ib-thread { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.ib-thead { display: flex; align-items: center; gap: 8px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.ib-msgs { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 70%; display: grid; gap: 3px; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; justify-items: end; }
.bubble { padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; unicode-bidi: plaintext; }
.msg.in .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.out .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg small { font-size: 11px; color: var(--muted); }
.att { font-size: 12px; opacity: .8; margin-top: 4px; }
.ib-compose { background: #fff; border-top: 1px solid var(--line); padding: 12px 20px; display: grid; gap: 8px; }
.ib-compose textarea { unicode-bidi: plaintext; }
.ib-flag { margin: 0; font-size: 13px; background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 7px 10px; }
.ib-flag.red { background: var(--danger-bg); color: var(--danger); }
.ib-draft-label { font-size: 12px; font-weight: 600; color: var(--accent-dark); }
.ib-actions { display: flex; gap: 8px; align-items: center; }
.setup-steps { max-width: 720px; }
.setup-steps h2 { margin-top: 0; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; }
  .ib-list { max-height: 45vh; }
  .msg { max-width: 88%; }
}
.ib-setup { padding: 20px 24px; flex: 1; }
