/* «Автоматизации»: плитки, карточки, форма, журнал запусков, окно «Расписание чата».
   Только переменные desk.css: обе темы сами. */

/* --- плитки и фильтр ------------------------------------------------------------------------------------ */
.pa-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pa-tile {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.pa-tile-label { font-size: 12.5px; color: var(--muted); }
.pa-tile b { font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pa-tile-hint { font-size: 11.5px; line-height: 1.35; }

.pa-scope { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.pa-scope .select { width: auto; min-width: 160px; max-width: 260px; height: 34px; }
.tabs .pa-count { margin-left: 6px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* --- карточки ------------------------------------------------------------------------------------------- */
.pa-card { min-width: 0; }
.pa-card h3 { overflow-wrap: anywhere; }
.pa-card .meta > span { min-width: 0; overflow-wrap: anywhere; }
.pa-card .meta .icon { vertical-align: -2px; margin-right: 4px; }
.pa-card .meta a { color: var(--accent-text); }
.pa-card.pa-off h3 { color: var(--ink-2); }
.pa-card.pa-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pa-prompt { white-space: pre-wrap; overflow-wrap: anywhere; }
.pa-error { color: var(--bad); font-size: 12.5px; overflow-wrap: anywhere; }
.pa-hook { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.pa-hook .mono { font-size: 12px; overflow-wrap: anywhere; }
.pa-switch { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

/* --- журнал --------------------------------------------------------------------------------------------- */
.pa-journal { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pa-journal .card-head h3 { font-size: 15px; }
.pa-journal-note { font-size: 12.5px; }
.pa-runs {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.pa-run { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.pa-run:last-child { border-bottom: 0; }
.pa-run-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; min-width: 0; }
.pa-run-title { min-width: 0; overflow-wrap: anywhere; }
.pa-spacer { flex: 1; }
.pa-run-cause { font-size: 12px; overflow-wrap: anywhere; }
.pa-run-error { color: var(--bad); font-size: 12.5px; overflow-wrap: anywhere; }
.pa-run-result { color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }

/* --- форма ---------------------------------------------------------------------------------------------- */
.pa-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pa-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pa-section h4 { margin: 0; font-size: 13px; font-weight: 600; }
.pa-hint { margin: 0; font-size: 12.5px; line-height: 1.45; }
.pa-wide { grid-column: 1 / -1; }
.pa-seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; align-self: flex-start; max-width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--sunken);
}
.pa-seg button {
  border: 0; background: transparent; min-height: 30px; padding: 4px 12px; border-radius: 5px;
  cursor: pointer; color: var(--ink-2); font-size: 13px; text-align: left;
}
.pa-seg button:hover { color: var(--ink); }
.pa-seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.pa-steps { display: flex; flex-direction: column; gap: 10px; }
.pa-step { display: flex; flex-direction: column; gap: 6px; }
.pa-step-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; font-size: 12.5px; color: var(--muted); }
.pa-step .textarea { min-height: 76px; }
.pa-add { align-self: flex-start; }
.pa-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.pa-chip {
  height: 24px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--ink-2); font-family: var(--mono); font-size: 12px;
}
.pa-chip:hover { background: var(--raised); color: var(--ink); }
.pa-preview {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; font-size: 13px;
  background: var(--sunken); border-radius: var(--radius-sm); overflow-wrap: anywhere;
}
.pa-preview.bad { background: var(--bad-soft); color: var(--bad); }
.pa-note {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; font-size: 13px;
  background: var(--sunken); border-radius: var(--radius-sm); overflow-wrap: anywhere;
}
.pa-note p { margin: 0; }
.pa-note .mono { font-size: 12px; }
.pa-enabled { align-self: center; padding-top: 18px; }
.pa-code {
  margin: 8px 0; padding: 10px; background: var(--surface); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* --- окно «Расписание чата» --------------------------------------------------------------------------------- */
.pa-chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pa-chat-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.pa-chat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; overflow-wrap: anywhere; }
.pa-chat-meta { font-size: 12.5px; overflow-wrap: anywhere; }
.pa-chat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* --- пакеты Контура ----------------------------------------------------------------------------------------- */
.pa-packages { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pa-subhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.pa-subhead p { margin: 0; }
.pa-subhead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* --- телефон ------------------------------------------------------------------------------------------------ */
@media (max-width: 900px) {
  .pa-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pa-tile { padding: 12px; }
  .pa-tile b { font-size: 20px; }
  .pa-scope { width: 100%; }
  .pa-scope .select { flex: 1; min-width: 0; max-width: none; }
  .pa-run-line .pa-spacer { display: none; }
  .pa-enabled { padding-top: 0; }
}
