/* ==========================================================================
   app.css — the product (behind sign-in). Extends base.css.
   ========================================================================== */

body.app { background: var(--paper-2); overflow: hidden; }
.app-shell { display: grid; grid-template-columns: 256px 1fr; height: 100vh; height: 100dvh; }

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
}
.sb-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.sb-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; }
.ws-switch {
  margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper);
  font-weight: 550; font-size: 14px; transition: border-color .15s;
}
.ws-switch:hover { border-color: var(--ink); }
.ws-switch .ws-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.ws-switch .ws-meta { text-align: left; line-height: 1.15; flex: 1; }
.ws-switch .ws-meta small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.ws-switch .caret { color: var(--muted); }

.sb-nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.sb-group { margin-bottom: 14px; }
.sb-group-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 6px 10px; font-weight: 500; }
.sb-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500; transition: background .13s, color .13s; position: relative;
}
.sb-item:hover { background: var(--paper-2); color: var(--ink); }
.sb-item.active { background: var(--brand-tint); color: var(--brand-2); font-weight: 600; }
.sb-item .ic { width: 18px; height: 18px; flex: none; opacity: .85; }
.sb-item .ic svg { width: 100%; height: 100%; }
.sb-item .count { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--paper-2); color: var(--muted); padding: 1px 7px; border-radius: 999px; }
.sb-item.active .count { background: #fff; color: var(--brand-2); }
.sb-item.cta { background: var(--ink); color: #fff; margin: 4px 0 8px; justify-content: center; font-weight: 600; }
.sb-item.cta:hover { background: #000; }

.sb-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sb-foot .av { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.sb-foot .who { line-height: 1.15; flex: 1; overflow: hidden; }
.sb-foot .who b { font-size: 13.5px; display: block; }
.sb-foot .who small { font-size: 11.5px; color: var(--muted); }

/* ---------- main region ---------- */
.main { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.topbar { height: 60px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.85); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 14px; padding: 0 22px; flex: none; }
.topbar h1 { font-family: var(--sans); font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.topbar .demo-banner { margin-left: 12px; }
.topbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.view { flex: 1; overflow-y: auto; }
.view-pad { padding: 26px 30px 60px; max-width: 1180px; }
.view-head { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-head h2 { font-family: var(--sans); font-size: 24px; font-weight: 600; margin: 0 0 3px; letter-spacing: -.015em; }
.view-head p { color: var(--muted); font-size: 14.5px; margin: 0; }

.mobile-topbar { display: none; }

/* ---------- composer (the essence loop) ---------- */
.composer { display: grid; grid-template-columns: 1fr 1fr; height: 100%; overflow: hidden; }
.compose-pane { overflow-y: auto; padding: 24px 28px 120px; border-right: 1px solid var(--line); }
.preview-pane { overflow-y: auto; padding: 24px 28px 120px; background: var(--paper-2); position: relative; }

.compose-section { margin-bottom: 22px; }
.compose-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.compose-label .hint { margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 12px; }

/* post type segmented */
.seg { display: inline-flex; background: var(--paper-2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: none; background: transparent; padding: 7px 15px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; transition: all .14s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-s); }
.seg button svg { width: 15px; height: 15px; }

/* media dropzone */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 26px; text-align: center; transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-tint); }
.dropzone .dz-ic { width: 42px; height: 42px; margin: 0 auto 10px; color: var(--muted); }
.dropzone p { margin: 0; font-size: 14px; color: var(--ink-2); }
.dropzone small { color: var(--muted); font-size: 12.5px; }
.media-preview { display: flex; gap: 12px; flex-wrap: wrap; }
.media-thumb { position: relative; width: 120px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.media-thumb img, .media-thumb video, .media-thumb .fake-media { width: 100%; height: 92px; object-fit: cover; display: block; }
.media-thumb .mt-actions { display: flex; flex-direction: column; gap: 1px; }
.media-thumb .mt-actions button { border: none; background: var(--paper); font-size: 11.5px; padding: 6px; color: var(--ink-2); border-top: 1px solid var(--line); text-align: left; }
.media-thumb .mt-actions button:hover { background: var(--brand-tint); color: var(--brand-2); }
.media-thumb .cover-badge { position: absolute; top: 6px; left: 6px; }

/* account multi-select */
.acct-groups { display: flex; flex-direction: column; gap: 6px; }
.acct-row { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: border-color .13s, background .13s; user-select: none; }
.acct-row:hover { border-color: var(--line-2); background: var(--paper); }
.acct-row.sel { border-color: var(--brand); background: var(--brand-tint); }
.acct-row .acct-meta { flex: 1; line-height: 1.2; }
.acct-row .acct-meta b { font-size: 14px; font-weight: 600; }
.acct-row .acct-meta small { display: block; font-size: 12px; color: var(--muted); }
.acct-row .chk { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; flex: none; transition: all .13s; }
.acct-row.sel .chk { background: var(--brand); border-color: var(--brand); color: #fff; }
.acct-row.sel .chk svg { width: 13px; height: 13px; }
.acct-row:not(.sel) .chk svg { display: none; }
.remember-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.remember-row input { accent-color: var(--brand); width: 15px; height: 15px; }

/* caption textarea + counter ring */
.caption-wrap { position: relative; }
.caption-ta { width: 100%; min-height: 128px; border: 1px solid var(--line-2); border-radius: 13px; padding: 14px; font-family: var(--sans); font-size: 15.5px; line-height: 1.5; resize: vertical; transition: border-color .15s, box-shadow .15s; }
.caption-ta:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }

/* platform config chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card); font-size: 12.5px; font-weight: 550; color: var(--ink-2);
  transition: all .13s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip svg { width: 13px; height: 13px; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; }

/* per-platform overrides accordion */
.overrides { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.ov-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.ov-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.ov-head .ov-name { font-weight: 600; font-size: 13.5px; }
.ov-head .ov-count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; }
.count-ring { width: 26px; height: 26px; flex: none; }
.ov-body { padding: 0 12px 12px; }
.ov-body .caption-ta { min-height: 80px; font-size: 14px; }
.ov-body .ov-empty { font-size: 12.5px; color: var(--muted); padding: 4px 0 10px; }
.ov-warn { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--warn); margin-top: 7px; }
.ov-warn svg { width: 14px; height: 14px; }

/* AI assist */
.ai-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 12px; background: linear-gradient(120deg, var(--brand-tint), #f3f0ff); border: 1px solid #ddd8ff; border-radius: 12px; }
.ai-bar .ai-title { width: 100%; font-size: 12.5px; font-weight: 600; color: var(--brand-2); display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.ai-bar .ai-title svg { width: 15px; height: 15px; }
.ai-btn { border: 1px solid #d3ccff; background: rgba(255,255,255,.7); color: var(--brand-2); font-size: 12.5px; font-weight: 550; padding: 6px 12px; border-radius: 999px; transition: all .13s; }
.ai-btn:hover { background: #fff; border-color: var(--brand); }
.ai-btn[disabled] { opacity: .55; }
.ai-variants { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ai-variant { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 13.5px; line-height: 1.45; cursor: pointer; transition: border-color .13s; }
.ai-variant:hover { border-color: var(--brand); background: var(--brand-tint); }

/* ---------- previews ---------- */
.preview-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; position: sticky; top: 0; }
.preview-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; font-weight: 550; color: var(--muted); transition: all .13s; }
.preview-tab.on { border-color: var(--ink); color: var(--ink); }
.preview-tab .pf-avatar { width: 16px; height: 16px; }
.preview-empty { text-align: center; color: var(--muted); padding: 60px 20px; }

.pv-stack { display: flex; flex-direction: column; gap: 20px; }
.pv-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow-m); overflow: hidden; animation: pv-in .3s var(--ease-out); }
@keyframes pv-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.pv-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 0 0 8px 2px; display: flex; align-items: center; gap: 7px; }
.pv-label .cc { margin-left: auto; }
.pv-over { color: var(--danger); font-weight: 600; }

/* generic preview innards */
.pvh { display: flex; align-items: center; gap: 10px; padding: 13px 14px 0; }
.pvh .pa { width: 40px; height: 40px; border-radius: 50%; flex: none; background: var(--paper-2); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink-2); }
.pvh .nm { font-weight: 700; font-size: 14.5px; line-height: 1.2; display: flex; align-items: center; gap: 5px; }
.pvh .hd { font-size: 13px; color: var(--muted); }
.pv-text { padding: 8px 14px 14px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.pv-media { width: 100%; aspect-ratio: 16/9; background: var(--paper-2); position: relative; overflow: hidden; }
.pv-media.square { aspect-ratio: 1; }
.pv-media img, .pv-media video, .pv-media .fake-media { width: 100%; height: 100%; object-fit: cover; }
.pv-actions { display: flex; gap: 22px; padding: 10px 14px; color: var(--muted); border-top: 1px solid var(--line); }
.pv-actions svg { width: 18px; height: 18px; }
.pv-verified { color: var(--p-x); }
.truncated { color: var(--faint); }

/* ---------- bottom action bar ---------- */
.compose-bar {
  position: absolute; left: 0; right: 50%; bottom: 0; z-index: 20;
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: 12px 28px; display: flex; align-items: center; gap: 12px;
}
.compose-bar .cb-info { font-size: 13px; color: var(--muted); }
.compose-bar .cb-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sched-field { display: flex; align-items: center; gap: 6px; }
.sched-field input { border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font-family: var(--sans); font-size: 13.5px; }

/* ---------- publish sequence (the delight moment) ---------- */
.launch-overlay {
  position: fixed; inset: 0; z-index: 400; background: rgba(20,22,28,.72);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  animation: fade-in .25s var(--ease-out);
}
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
.launch-card {
  width: min(460px, 92vw); background: var(--card); border-radius: 22px; box-shadow: var(--shadow-l);
  padding: 28px; animation: launch-pop .4s var(--ease-out);
}
@keyframes launch-pop { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
.launch-card h3 { font-size: 20px; margin-bottom: 4px; }
.launch-card .lc-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.launch-progress { height: 4px; background: var(--paper-2); border-radius: 3px; overflow: hidden; margin-bottom: 20px; }
.launch-progress i { display: block; height: 100%; background: var(--brand); border-radius: 3px; width: 0; transition: width .4s var(--ease-out); }
.launch-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; }
.launch-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 11px; opacity: .4; transition: opacity .3s, background .3s; }
.launch-item.active { opacity: 1; background: var(--paper); }
.launch-item.done { opacity: 1; }
.launch-item .li-name { font-weight: 600; font-size: 14px; flex: 1; line-height: 1.2; }
.launch-item .li-name small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.launch-item .li-status { font-size: 12.5px; color: var(--muted); font-family: var(--mono); display: flex; align-items: center; gap: 6px; }
.launch-item .li-status a { color: var(--brand); text-decoration: none; }
.launch-item .li-status a:hover { text-decoration: underline; }
.li-spinner { width: 15px; height: 15px; border: 2px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.li-check { width: 20px; height: 20px; border-radius: 50%; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; animation: check-pop .35s var(--ease-out); }
.li-check svg { width: 12px; height: 12px; }
@keyframes check-pop { 0% { transform: scale(0); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
.launch-done { text-align: center; padding-top: 6px; }
.launch-done .big-check { width: 60px; height: 60px; border-radius: 50%; background: var(--ok-tint); color: var(--ok); display: flex; align-items: center; justify-content: center; margin: 6px auto 14px; animation: check-pop .45s var(--ease-out); }
.launch-done .big-check svg { width: 30px; height: 30px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 401; }

/* ---------- cards / lists / grids (views) ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.stat-c { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px; }
.stat-c .lbl { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat-c .val { font-family: var(--sans); font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-c .delta { font-size: 12.5px; font-weight: 600; margin-top: 2px; display: inline-flex; align-items: center; gap: 3px; }
.stat-c .delta.up { color: var(--ok); }
.stat-c .delta.down { color: var(--danger); }

.filters { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-sel { border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 11px; font-size: 13px; font-weight: 500; background: var(--card); color: var(--ink-2); }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-s); transition: transform .15s, box-shadow .15s; cursor: pointer; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.post-card .pc-media { height: 150px; background: var(--paper-2); position: relative; overflow: hidden; }
.post-card .pc-media img, .post-card .pc-media video, .post-card .pc-media .fake-media { width: 100%; height: 100%; object-fit: cover; }
.post-card .pc-media .no-media { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--line-2); background: repeating-linear-gradient(45deg, var(--paper), var(--paper) 10px, var(--paper-2) 10px, var(--paper-2) 20px); }
.post-card .pc-media .no-media svg { width: 30px; height: 30px; }
.post-card .pc-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card .pc-caption { font-size: 13.5px; line-height: 1.4; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .pc-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.post-card .pc-avatars { display: flex; }
.post-card .pc-avatars .pf-avatar { margin-left: -6px; border: 2px solid var(--card); box-shadow: none; }
.post-card .pc-avatars .pf-avatar:first-child { margin-left: 0; }
.post-card .pc-when { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.status-chip { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.status-chip.scheduled { background: var(--brand-tint); color: var(--brand-2); }
.status-chip.posted { background: var(--ok-tint); color: #0d7a3d; }
.status-chip.draft { background: var(--paper-2); color: var(--muted); }

.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state .es-ic { width: 56px; height: 56px; margin: 0 auto 16px; color: var(--line-2); }
.empty-state h3 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.empty-state p { max-width: 40ch; margin: 0 auto 18px; }

/* connections */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 16px; }
.conn-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-s); }
.conn-card .cc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.conn-card .cc-top .pf-avatar { width: 38px; height: 38px; }
.conn-card .cc-top b { font-size: 15px; }
.conn-card .cc-top small { display: block; color: var(--muted); font-size: 12.5px; }
.conn-acct { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.conn-acct .ca-av { width: 30px; height: 30px; border-radius: 50%; background: var(--paper-2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; color: var(--ink-2); flex: none; }
.conn-acct .ca-meta { flex: 1; line-height: 1.2; }
.conn-acct .ca-meta b { font-size: 13.5px; font-weight: 600; }
.conn-acct .ca-meta small { display: block; font-size: 12px; color: var(--muted); }
.conn-acct .ca-refresh { border: none; background: none; color: var(--muted); padding: 6px; border-radius: 7px; }
.conn-acct .ca-refresh:hover { background: var(--paper-2); color: var(--ink); }
.conn-acct .ca-refresh svg { width: 16px; height: 16px; }
.conn-card .cc-add { margin-top: 12px; width: 100%; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-head h3 { font-size: 18px; margin: 0; min-width: 190px; }
.cal-nav { border: 1px solid var(--line-2); background: var(--card); width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.cal-nav:hover { border-color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.cal-dow { padding: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; position: relative; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.dim { background: var(--paper); }
.cal-cell .cd-num { font-size: 12.5px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-cell.today .cd-num { background: var(--brand); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cal-event { margin-top: 4px; font-size: 11px; padding: 3px 6px; border-radius: 6px; background: var(--brand-tint); color: var(--brand-2); display: flex; align-items: center; gap: 4px; cursor: pointer; overflow: hidden; }
.cal-event.posted { background: var(--ok-tint); color: #0d7a3d; }
.cal-event .pf-avatar { width: 12px; height: 12px; }
.cal-event .ce-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal-week { display: flex; flex-direction: column; gap: 8px; }
.cal-week-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; }
.cal-week-row .wr-time { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 4px; }
.cal-week-row .wr-slot { border-top: 1px solid var(--line); padding: 8px 0; min-height: 42px; }

/* api keys */
.key-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 10px; }
.key-row .kr-meta { flex: 1; }
.key-row .kr-meta b { font-size: 14.5px; }
.key-row .kr-key { font-family: var(--mono); font-size: 13px; color: var(--ink-2); background: var(--paper-2); padding: 4px 9px; border-radius: 7px; display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.key-row .kr-meta small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }

/* settings / forms */
.settings-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 16px; max-width: 620px; }
.settings-card h3 { font-size: 16px; margin-bottom: 4px; }
.settings-card p.desc { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); transition: background .15s; border: none; flex: none; cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow-s); }
.toggle.on { background: var(--brand); }
.toggle.on::after { transform: translateX(18px); }
.set-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: none; }
.set-row .sr-meta { flex: 1; }
.set-row .sr-meta b { font-size: 14px; font-weight: 600; }
.set-row .sr-meta small { display: block; color: var(--muted); font-size: 12.5px; }

/* bulk */
.bulk-drop { border: 2px dashed var(--line-2); border-radius: 16px; padding: 44px; text-align: center; transition: all .15s; cursor: pointer; }
.bulk-drop:hover, .bulk-drop.drag { border-color: var(--brand); background: var(--brand-tint); }
.bulk-queue { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.bulk-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.bulk-item .bi-thumb { width: 64px; height: 44px; border-radius: 7px; background: var(--paper-2); overflow: hidden; flex: none; }
.bulk-item .bi-thumb .fake-media, .bulk-item .bi-thumb video { width: 100%; height: 100%; object-fit: cover; }
.bulk-item .bi-meta { flex: 1; }
.bulk-item .bi-meta b { font-size: 13.5px; }
.bulk-item .bi-meta small { display: block; color: var(--muted); font-size: 12px; }
.bulk-bar { height: 5px; background: var(--paper-2); border-radius: 3px; overflow: hidden; margin-top: 6px; width: 160px; }
.bulk-bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .3s; }

/* analytics */
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; --chart-text: var(--muted); --chart-grid: rgba(20,22,28,.08); --chart-c1: #3b32ff; --chart-c2: #12a150; --chart-c3: #e1306c; --chart-c4: #ff0000; --chart-c5: #1185fe; --chart-c6: #b7791f; --chart-tooltip-bg: #14161c; --chart-tooltip-text: #fff; }
.chart-card h3 { font-size: 15px; margin-bottom: 2px; }
.chart-card .cc-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.analytics-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.pf-perf { display: flex; flex-direction: column; gap: 10px; }
.pf-perf-row { display: flex; align-items: center; gap: 12px; }
.pf-perf-row .ppr-name { display: flex; align-items: center; gap: 8px; width: 120px; font-size: 13px; font-weight: 550; }
.pf-perf-row .ppr-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.pf-perf-row .ppr-bar i { display: block; height: 100%; border-radius: 4px; }
.pf-perf-row .ppr-val { font-family: var(--mono); font-size: 12px; width: 60px; text-align: right; color: var(--ink-2); }

/* modal */
.modal-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(20,22,28,.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade-in .2s; }
.modal { width: min(560px, 94vw); background: var(--card); border-radius: 18px; box-shadow: var(--shadow-l); max-height: 88vh; overflow-y: auto; animation: launch-pop .3s var(--ease-out); }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.icon-btn { border: none; background: none; padding: 8px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.form-done { text-align: center; padding: 20px; }
.form-done .fd-check { width: 52px; height: 52px; border-radius: 50%; background: var(--ok-tint); color: var(--ok); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.form-done .fd-check svg { width: 26px; height: 26px; }

/* mobile app */
@media (max-width: 860px) {
  body.app { overflow: auto; }
  .app-shell { grid-template-columns: 1fr; height: auto; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 200; transform: translateX(-100%); transition: transform .25s var(--ease-out); box-shadow: var(--shadow-l); }
  .sidebar.open { transform: none; }
  .main { height: auto; min-height: 100vh; }
  .mobile-topbar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 50; }
  .mobile-topbar .mt-burger { border: 1px solid var(--line-2); border-radius: 9px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--card); }
  .mobile-topbar .mt-burger svg { width: 20px; height: 20px; }
  .topbar { display: none; }
  .view { overflow: visible; }
  .composer { grid-template-columns: 1fr; height: auto; }
  .compose-pane { border-right: none; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
  .preview-pane { padding-bottom: 140px; }
  .compose-bar { right: 0; position: fixed; }
  .stat-cards { grid-template-columns: repeat(2,1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
  .sb-backdrop { position: fixed; inset: 0; background: rgba(20,22,28,.4); z-index: 150; }
  .view-pad { padding: 18px 16px 80px; }
}
@media (min-width: 861px) { .sb-backdrop { display: none; } }
