/* BSM AI Office — styles */
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,system-ui,sans-serif;min-height:100vh;background:#f5f5f5;color:#222;overflow-x:hidden}

/* Loading */
#loading{position:fixed;inset:0;background:#f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:1000;gap:12px;font-size:16px;color:#555}
.spinner{width:36px;height:36px;border:3px solid #e0e0e0;border-top-color:#1a237e;border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* Header */
.header{background:linear-gradient(135deg,#1a237e,#283593);color:#fff;padding:16px 16px 10px}
.header-top h1{font-size:20px}
.header-sub{font-size:13px;opacity:.85;margin-top:3px}

/* Channel tabs */
#channel-strip{display:flex;gap:6px;padding:8px 8px 0;background:#fff;border-bottom:1px solid #eee}
.channel-tab{display:inline-flex;align-items:center;gap:4px;padding:7px 14px;font-size:13px;font-weight:500;cursor:pointer;border-radius:10px 10px 0 0;border:1px solid transparent;border-bottom:none;background:transparent;transition:.15s;user-select:none}
.channel-tab.active{background:#f0f0ff;border-color:#ddd;color:#1a237e;font-weight:600}
.channel-tab:hover{background:#f5f5ff}

/* Agent chips */
#agent-strip{padding:10px 8px;display:flex;flex-wrap:wrap;gap:6px;border-bottom:1px solid #eee;background:#fff}
.agent-chip{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;border-radius:20px;background:#f5f5f5;font-size:13px;font-weight:500;cursor:pointer;border:2px solid transparent;transition:.15s}
.agent-chip.active{border-color:#1a237e;background:#e8eaf6;font-weight:600}

/* Channel context bar */
#channel-context{display:none;align-items:center;gap:8px;padding:8px 12px;background:#e8eaf6;border-bottom:1px solid #ddd;font-size:13px;font-weight:500;color:#283593}
.back-btn{background:none;border:none;color:#1a237e;font-size:13px;font-weight:600;cursor:pointer;padding:4px 8px;border-radius:6px}
.back-btn:hover{background:#d0d4f0}

/* Channel grid — красивые карточки */
.channel-grid-title{padding:20px 16px 8px;font-size:13px;color:#888;text-transform:uppercase;letter-spacing:.5px;font-weight:600}
.channel-grid{display:grid;grid-template-columns:1fr;gap:14px;padding:0 12px 16px}
.channel-tile{background:#fff;border-radius:18px;padding:0;overflow:hidden;cursor:pointer;box-shadow:0 2px 12px rgba(0,0,0,.06);transition:transform .2s,box-shadow .2s;border:none;position:relative}
.channel-tile:active{transform:scale(.97)}
.channel-tile .tile-bg{padding:20px 20px 16px;display:flex;align-items:flex-start;gap:14px}
.channel-tile .tile-icon{width:50px;height:50px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:26px;flex-shrink:0}
.channel-tile .tile-body{flex:1}
.channel-tile .tile-name{font-size:17px;font-weight:600;color:#222;margin-bottom:3px}
.channel-tile .tile-desc{font-size:13px;color:#777;margin-bottom:4px}
.channel-tile .tile-tg{display:inline-block;font-size:11px;color:#aaa;background:#f5f5f5;padding:2px 8px;border-radius:8px;font-family:monospace}
.channel-tile .tile-arrow{color:#ccc;font-size:20px;margin-left:auto;flex-shrink:0;align-self:center}
.channel-tile.holmikld39 .tile-icon{background:linear-gradient(135deg,#e3f2fd,#bbdefb)}
.channel-tile.holmy_home .tile-icon{background:linear-gradient(135deg,#fce4ec,#f8bbd0)}

/* Channel workspace */
.channel-workspace{}
.ws-header{font-size:18px;font-weight:600;padding:14px 12px 4px;color:#222}
.ws-tg{font-size:12px;color:#999;font-weight:400}
#ws-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:8px 12px 16px}

/* Channel context badge in forms */
.channel-context{display:flex;align-items:center;gap:6px;padding:8px 12px;background:#e8eaf6;border-radius:10px;font-size:12px;color:#283593;margin-bottom:8px;font-weight:500}

/* Actions grid (non-channel profiles) */
#action-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px}
.action-card{background:#fff;border-radius:14px;padding:20px 12px;text-align:center;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.05);transition:.15s}
.action-card:active{transform:scale(.96)}
.action-card .icon{font-size:30px}
.action-card .label{font-weight:600;font-size:14px;margin-top:6px}
.action-card .desc{font-size:11px;color:#999;margin-top:2px}

/* Chat */
#chat-view{display:none;padding:12px}
.chat-back{background:none;border:none;font-size:14px;cursor:pointer;color:#666;padding:6px 0;display:block}
.chat-header{font-weight:600;font-size:16px;margin:6px 0 10px;text-align:center}
.chat-msgs{background:#fff;border-radius:12px;padding:12px;min-height:160px;margin:6px 0;font-size:14px;line-height:1.5;max-height:50vh;overflow-y:auto}
.chat-row{display:flex;gap:8px}
.chat-row input{flex:1;padding:10px 16px;border:1px solid #ddd;border-radius:22px;font-size:14px;outline:none}
.chat-row button{width:40px;height:40px;border-radius:50%;border:none;background:#1a237e;color:#fff;font-size:18px;cursor:pointer}
.msg-user{text-align:right;margin:8px 0}
.msg-user span{background:#e8eaf6;padding:8px 14px;border-radius:16px 16px 4px 16px;display:inline-block;max-width:85%}
.msg-bot{margin:8px 0}
.msg-bot span{background:#f5f5f5;padding:8px 14px;border-radius:16px 16px 16px 4px;display:inline-block;max-width:85%}
.msg-typing{margin:8px 0;color:#999;font-style:italic}

/* Form view */
#form-view{display:none;padding:12px}
.form-title{font-size:18px;font-weight:600;margin:6px 0 12px}
.form-field{margin-bottom:10px}
.form-field label{font-size:13px;font-weight:600;display:block;margin-bottom:4px}
.form-field input,.form-field textarea,.form-field select{width:100%;padding:10px;border:1px solid #ddd;border-radius:10px;font-size:14px;background:#fff}
.form-field textarea{resize:vertical;min-height:60px}
.form-submit{width:100%;padding:14px;border:none;border-radius:12px;color:#fff;font-size:15px;font-weight:600;cursor:pointer;margin-top:6px}
.form-submit.primary{background:#1a237e}
.form-submit:disabled{opacity:.6;cursor:default}

/* Result block */
.action-result{display:none;margin-top:12px}
.action-result .output{background:#fff;border-radius:12px;padding:14px;font-size:14px;line-height:1.6;white-space:pre-wrap;margin-bottom:8px}
.action-result .copy-btn{width:100%;padding:10px;border:none;border-radius:10px;background:#e8eaf6;color:#1a237e;font-size:13px;font-weight:600;cursor:pointer}

/* Error */
#error{text-align:center;padding:60px 20px;color:#e53935;font-size:15px;line-height:1.6}
/* BSM AI Office — extended styles (v2) */

/* ===== CHANNEL WORKSPACE ===== */
.ws-top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-bottom: 1px solid #eee;
}
.ws-back {
  background: none; border: none; color: #1a237e;
  font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 6px 10px; border-radius: 8px;
}
.ws-back:hover { background: #e8eaf6; }
.ws-title { font-size: 16px; font-weight: 600; color: #222; }
.ws-tg { font-size: 11px; color: #999; font-weight: 400; }

/* Tabs */
.ws-tabs {
  display: flex; gap: 0; padding: 0 8px;
  background: #fff; border-bottom: 1px solid #eee;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.ws-tab {
  flex-shrink: 0; padding: 10px 14px; font-size: 13px;
  font-weight: 500; cursor: pointer; color: #888;
  border-bottom: 2px solid transparent; transition: .15s;
  user-select: none;
}
.ws-tab.active { color: #1a237e; border-bottom-color: #1a237e; font-weight: 600; }
.ws-tab:hover { color: #444; }

/* ===== CALENDAR ===== */
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 8px;
}
.cal-title { font-size: 15px; font-weight: 600; color: #333; }
.cal-prev, .cal-next {
  background: none; border: 1px solid #ddd; border-radius: 8px;
  padding: 6px 12px; font-size: 14px; cursor: pointer; color: #555;
}
.cal-prev:hover, .cal-next:hover { background: #f5f5f5; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; padding: 0 8px 8px;
}
.cal-cell {
  background: #fff; border-radius: 10px; padding: 6px 4px;
  text-align: center; cursor: pointer; border: 2px solid transparent;
  min-height: 52px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: .1s;
}
.cal-cell:active { transform: scale(.95); }
.cal-cell.today { border-color: #1a237e33; background: #f0f0ff; }
.cal-cell.has-posts { background: #fafaff; }
.cal-cell.selected { border-color: #1a237e; background: #e8eaf6; }
.cal-dow { font-size: 10px; color: #999; text-transform: uppercase; }
.cal-day { font-size: 18px; font-weight: 700; color: #222; line-height: 1.2; }
.cal-dots { font-size: 6px; color: #1a237e; letter-spacing: 2px; line-height: 1; margin-top: 2px; }

/* Day posts */
.cal-posts { padding: 4px 12px 16px; }
.day-title { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 8px; }
.day-count { font-size: 12px; font-weight: 400; color: #999; }
.day-loading { text-align: center; color: #888; padding: 20px; }
.day-empty { text-align: center; color: #999; padding: 20px; font-size: 14px; }
.day-add-btn {
  display: block; margin: 10px auto 0; background: #1a237e;
  color: #fff; border: none; border-radius: 20px; padding: 8px 20px;
  font-size: 13px; cursor: pointer;
}
.day-add-btn:hover { background: #283593; }

/* Post cards */
.post-card {
  background: #fff; border-radius: 12px; padding: 12px 14px;
  margin-bottom: 8px; cursor: pointer; border-left: 3px solid #ddd;
  box-shadow: 0 1px 4px rgba(0,0,0,.04); transition: .1s;
}
.post-card:active { transform: scale(.98); }
.post-card.status-draft { border-left-color: #ff9800; }
.post-card.status-scheduled { border-left-color: #2196f3; }
.post-card.status-published { border-left-color: #4caf50; }
.post-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; color: #222; }
.post-preview { font-size: 12px; color: #888; line-height: 1.4; margin-bottom: 5px; }
.post-meta { display: flex; gap: 8px; align-items: center; }
.post-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.post-status.draft { background: #fff3e0; color: #e65100; }
.post-status.scheduled { background: #e3f2fd; color: #1565c0; }
.post-status.published { background: #e8f5e9; color: #2e7d32; }
.post-time { font-size: 11px; color: #aaa; }

/* Post detail */
.post-detail { padding: 12px; }
.pd-status { font-size: 12px; padding: 4px 12px; border-radius: 10px; display: inline-block; margin-bottom: 8px; }
.pd-status.draft { background: #fff3e0; color: #e65100; }
.pd-status.scheduled { background: #e3f2fd; color: #1565c0; }
.pd-status.published { background: #e8f5e9; color: #2e7d32; }
.pd-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 10px; }
.pd-content { font-size: 14px; line-height: 1.7; color: #333; white-space: pre-wrap; margin-bottom: 16px; }
.pd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-btn {
  padding: 8px 16px; border: 1px solid #ddd; border-radius: 10px;
  background: #fff; font-size: 13px; cursor: pointer; color: #444;
}
.pd-btn.primary { background: #1a237e; color: #fff; border-color: #1a237e; }
.pd-btn.danger { background: #fff; color: #e53935; border-color: #e53935; }
.pd-btn:hover { background: #f5f5f5; }
.pd-btn.primary:hover { background: #283593; }
.pd-btn.danger:hover { background: #ffebee; }

/* ===== FORM VIEW INLINE ===== */
.form-view-inline { padding: 12px; }
.form-view-inline .form-desc { font-size: 13px; color: #888; margin-bottom: 12px; }
.form-row { display: flex; gap: 8px; margin-bottom: 10px; }
.form-row input, .form-row select { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 10px; font-size: 14px; }
.form-submit.primary { background: #1a237e; }
.form-submit:hover:not(:disabled) { opacity: .9; }
.output {
  background: #fff; border-radius: 12px; padding: 14px;
  font-size: 14px; line-height: 1.6; white-space: pre-wrap;
  margin-top: 10px; margin-bottom: 8px;
}

/* ===== DIGEST ===== */
.dig-result-title { font-size: 15px; font-weight: 600; color: #2e7d32; margin: 10px 0; }
.dig-posts { display: flex; flex-direction: column; gap: 6px; }
.dig-post-item {
  background: #f5f5f5; border-radius: 8px; padding: 8px 12px;
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.dig-date { font-size: 11px; color: #1a237e; font-weight: 600; white-space: nowrap; }

/* ===== SOURCES ===== */
.sources-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.source-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.source-info { display: flex; align-items: center; gap: 8px; flex: 1; }
.source-type { font-size: 16px; }
.source-name { font-weight: 500; font-size: 13px; color: #333; }
.source-url { font-size: 11px; color: #999; font-family: monospace; }
.source-del {
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: #f5f5f5; color: #e53935; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.source-del:hover { background: #ffebee; }

/* ===== CHAT INLINE ===== */
.chat-view-inline { padding: 12px; display: flex; flex-direction: column; min-height: 60vh; }
.chat-header-inline { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.chat-msgs-inline {
  background: #fff; border-radius: 12px; padding: 12px;
  flex: 1; font-size: 14px; line-height: 1.5;
  max-height: 55vh; overflow-y: auto; margin-bottom: 8px;
}
.chat-row-inline { display: flex; gap: 8px; }
.chat-row-inline input {
  flex: 1; padding: 10px 16px; border: 1px solid #ddd;
  border-radius: 22px; font-size: 14px; outline: none;
}
.chat-row-inline button {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: #1a237e; color: #fff; font-size: 18px; cursor: pointer;
}

/* ===== ERROR MESSAGE ===== */
.error-msg { text-align: center; color: #e53935; padding: 20px; font-size: 14px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
  .ws-tab { padding: 10px 10px; font-size: 12px; }
  .cal-cell { min-height: 44px; padding: 4px 2px; }
  .cal-day { font-size: 16px; }
}


/* Post media */
.pd-media { margin: 10px 0; padding: 10px; background: #fafafa; border-radius: 10px; }
.pd-media-title { font-size: 12px; color: #888; font-weight: 600; margin-bottom: 6px; }
.pd-media-item { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.pd-media-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-btn-small { border: none; background: none; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.pd-btn-small.danger { color: #e53935; }
.pd-btn-small.danger:hover { background: #ffebee; }
/* ===== FORM TABS ===== */
.form-tabs { display: flex; gap: 0; margin: 12px 0; border: 1px solid #e0e0e0; border-radius: 10px; overflow: hidden; }
.form-tab { flex: 1; text-align: center; padding: 10px; cursor: pointer; font-size: 13px; font-weight: 500; background: #f5f5f5; color: #666; transition: all .2s; }
.form-tab.active { background: #1a237e; color: #fff; }
.form-tab:hover:not(.active) { background: #e8e8e8; }
.form-tab-content { display: none; }
.form-tab-content.active { display: block; }

/* ===== FILE UPLOAD ===== */
.file-upload-area { margin: 12px 0; padding: 12px; background: #fafafa; border: 2px dashed #ddd; border-radius: 10px; transition: border-color .2s; }
.file-upload-area:hover { border-color: #1a237e; }
.file-upload-header { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 8px; }
.file-empty { font-size: 12px; color: #aaa; text-align: center; padding: 12px; }
.file-previews { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.file-preview { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #fff; border-radius: 8px; border: 1px solid #eee; }
.file-preview-thumb { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; background: #f0f0f0; }
.file-thumb { width: 40px; height: 40px; object-fit: cover; }
.file-preview-info { flex: 1; min-width: 0; }
.file-preview-name { font-size: 12px; font-weight: 500; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-size { font-size: 10px; color: #999; }
.file-purpose-toggle { display: flex; align-items: center; gap: 4px; cursor: pointer; font-size: 11px; white-space: nowrap; }
.file-purpose-toggle input { width: 14px; height: 14px; cursor: pointer; }
.file-purpose-toggle .toggle-label { color: #555; }
.file-remove { border: none; background: none; color: #e53935; cursor: pointer; font-size: 16px; padding: 4px; border-radius: 4px; line-height: 1; }
.file-remove:hover { background: #ffebee; }
.file-add-btn { padding: 6px 14px; border: 1px solid #1a237e; border-radius: 8px; background: #fff; color: #1a237e; cursor: pointer; font-size: 12px; font-weight: 500; }
.file-add-btn:hover { background: #e8eaf6; }
.file-upload-actions { display: flex; gap: 8px; align-items: center; }

/* ===== TASK PROGRESS ===== */
.task-progress { display: flex; align-items: center; gap: 10px; padding: 14px; background: #e3f2fd; border-radius: 10px; margin: 10px 0; }
.task-progress.done { background: #e8f5e9; }
.task-progress-spinner { font-size: 24px; flex-shrink: 0; }
.task-progress-text { font-size: 13px; color: #555; line-height: 1.4; }

/* ===== TASK NOTIFICATION ===== */
.task-notification { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #e8f5e9; border-radius: 10px; margin: 0 0 10px; cursor: pointer; border: 1px solid #c8e6c9; transition: background .2s; }
.task-notification:hover { background: #c8e6c9; }
.task-notif-icon { font-size: 20px; flex-shrink: 0; }
.task-notif-body { flex: 1; }
.task-notif-title { font-size: 12px; font-weight: 600; color: #2e7d32; }
.task-notif-text { font-size: 13px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-notif-close { border: none; background: none; color: #999; cursor: pointer; font-size: 16px; padding: 4px; }
.task-notif-close:hover { color: #333; }

/* ===== USER MANAGEMENT ===== */
.users-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.user-card { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.user-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.user-card-info { flex: 1; }
.user-card-name { font-size: 16px; font-weight: 600; color: #222; }
.user-card-you { font-size: 11px; color: #999; font-weight: 400; }
.user-card-meta { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.user-card-id { font-size: 11px; color: #aaa; font-family: monospace; }
.user-card-role { font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 500; }
.user-card-role.admin { background: #fff3e0; color: #e65100; }
.user-card-role.user { background: #e8f5e9; color: #2e7d32; }
.user-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.user-card-btn { width: 32px; height: 32px; border: none; border-radius: 8px; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; background: transparent; }
.user-card-btn:hover { background: #f5f5f5; }
.user-card-btn.delete:hover { background: #ffebee; }
.user-card-profiles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.user-badge { font-size: 11px; padding: 3px 8px; background: #e8eaf6; color: #283593; border-radius: 6px; }
.user-no-profiles { font-size: 11px; color: #bbb; }
.user-card-edit { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; }
.user-edit-form .form-field { margin-bottom: 8px; }
.user-edit-form .form-field label { font-size: 12px; }
.user-edit-buttons { display: flex; gap: 8px; margin-top: 8px; }
.user-profiles-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.user-check { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; padding: 4px 8px; background: #f5f5f5; border-radius: 6px; }
.user-check input { width: 14px; height: 14px; }
.user-add-section { border: 1px solid #e0e0e0; border-radius: 12px; overflow: hidden; }
.user-add-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 500; color: #333; background: #fafafa; }
.user-add-header:hover { background: #f0f0f0; }
|.user-add-arrow { font-size: 18px; color: #999; transition: transform .2s; }
|.user-add-form { padding: 12px 14px; }

/* Telegram-style video */
.pp-video-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin: 8px 0;
  cursor: pointer;
  background: #000;
  max-width: 100%;
}
.pp-video {
  width: 100%;
  display: block;
  border-radius: 12px;
  max-height: 60vh;
  object-fit: contain;
}
.pp-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  pointer-events: none;
  transition: transform 0.15s, background 0.15s;
}
.pp-video-wrap:hover .pp-video-play {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(0,0,0,0.75);
}

/* Unassigned posts */
.unassigned-section { margin: 16px 0; padding: 12px; background: #fafafa; border-radius: 10px; border: 1px dashed #ddd; }
.unassigned-title { font-size: 14px; font-weight: 600; color: #555; margin-bottom: 8px; }
.unassigned-more { font-size: 12px; color: #999; text-align: center; padding: 8px; }

/* Publish success state */
.pp-actions button.published { background: #e8f5e9 !important; color: #2e7d32 !important; cursor: default; }

/* Post Preview Card — Telegram-style */
.post-preview-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin: 12px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.pp-status {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
}
.pp-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: #111;
  line-height: 1.3;
}
.pp-body {
  font-size: 15px;
  line-height: 1.6;
  color: #222;
  word-wrap: break-word;
}
.pp-body p { margin: 0 0 12px 0; }
.pp-body strong { font-weight: 600; }
.pp-body em { font-style: italic; }
.pp-body code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 14px;
}
.pp-body pre {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
}
.pp-body ul, .pp-body ol {
  margin: 8px 0;
  padding-left: 20px;
}
.pp-body li { margin: 4px 0; }

/* Formatting toolbar */
.fmt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px;
  background: #f0f0f0;
  border-radius: 8px 8px 0 0;
  border: 1px solid #ddd;
  border-bottom: none;
}
.fmt-toolbar button {
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.fmt-toolbar button:hover {
  background: #e3f2fd;
  border-color: #1a237e;
}
.fmt-sep {
  width: 1px;
  background: #ccc;
  margin: 4px 4px;
}

/* Emoji picker */
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-top: none;
  max-width: 100%;
}
.emoji-picker button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  padding: 0;
}
.emoji-picker button:hover {
  background: #e3f2fd;
}

/* Textarea below toolbar — remove top border-radius */
.fmt-toolbar + .emoji-picker + textarea,
.fmt-toolbar + textarea {
  border-radius: 0 0 8px 8px;
}
.pp-media { margin: 12px 0; }
.pp-media-item {
  position: relative;
  margin: 8px 0;
}
.pp-media-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s;
}
.pp-media-item:hover .pp-media-delete {
  opacity: 1;
}
.pp-media-delete:hover {
  background: rgba(220, 50, 50, 0.85);
}
.pp-image {
  max-width: 100%;
  max-height: 50vh;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
  object-fit: contain;
}
.pp-doc {
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 8px;
  margin: 4px 0;
  font-size: 14px;
}
.pp-doc a { color: #1a237e; text-decoration: none; }
.pp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}
.pp-actions button {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  background: #f0f0f0;
  color: #333;
}
.pp-actions button.primary { background: #43a047; color: #fff; }
.pp-actions button.danger { background: #fff; color: #e53935; border: 1px solid #e53935; }
