/* ===== tabs/calendar.css =====
   Отвечает за: стили календарной сетки и модалки дня.
   Блоки: .cal-wrap, .cal-header, .cal-grid, .cal-day, .pill, .post-card, .editor, .ai-bar. */

.cal-wrap { max-width: 980px; margin: 24px auto; padding: 0 16px; width: 100%; }
.cal-header { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 16px; }
.cal-header h2 { font-size: 20px; min-width: 200px; text-align: center; }

/* Фиксированная сетка 7×6: колонки и строки не зависят от содержимого.
   Высота строк фиксированная — календарь никогда не «уезжает». */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(6, 92px);
  gap: 8px;
  background: var(--card); border-radius: 12px; padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.day-name { text-align: center; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 0; }
.cal-day {
  min-height: 0;
  min-width: 0;
  height: 92px;
  overflow: hidden;
  background: var(--bg); border-radius: 8px; padding: 6px;
  cursor: pointer; border: 1px solid transparent; display: flex; flex-direction: column; gap: 3px;
  transition: .15s;
}
.cal-day:hover { border-color: var(--accent); }
.cal-day.other { opacity: .38; }
.cal-day.today { border-color: var(--accent); }
.cal-day .num { font-weight: 600; font-size: 14px; flex-shrink: 0; }
.cal-day .pills {
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
}
.pill {
  font-size: 10px; line-height: 1.2; padding: 2px 5px; border-radius: 4px;
  background: rgba(0,119,255,.12); color: var(--accent-dark); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}
.pill.published { background: rgba(34,170,119,.15); color: #186; }
.pill.error { background: rgba(238,51,51,.15); color: #c22; }
.cal-day .more { font-size: 9px; color: var(--muted); padding: 1px 2px; flex-shrink: 0; }

/* Пост-карточка в модалке дня */
.post-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px;
  position: relative;
}
.post-card .time { font-weight: 700; color: var(--accent-dark); }
.post-card .status { font-size: 11px; color: var(--muted); }
.post-card .post-text { margin: 8px 0; font-size: 14px; white-space: pre-wrap; max-height: 120px; overflow: hidden; }
.post-card .post-text.expanded { max-height: none; }
.post-card img { max-width: 100%; border-radius: 8px; margin-top: 6px; max-height: 180px; object-fit: cover; }
.post-card .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.post-card .actions button { padding: 5px 10px; font-size: 12px; min-height: 28px; min-width: 0; }

/* Редактор поста */
.editor { margin-top: 10px; }
.editor .row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.editor label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; }
.editor textarea {
  width: 100%; min-height: 160px; padding: 10px; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; resize: vertical;
}
.ai-bar { background: #f0f6ff; border: 1px dashed var(--accent); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.ai-bar .row { margin-bottom: 0; }
.ai-bar .ai-result { margin-top: 8px; font-size: 13px; color: #333; }
