/* Studio — "Останні сесії" panel (collapsible, searchable, status-filtered).
   Layered on top of style.css's shared tokens (--panel/--panel-2/--border/
   --border-soft, --text та похідні, --radius/--t-fast/--ease/--sans/--grad-brand) and
   🛑 Не писати тут `--text` із зірочкою впритул до слеша: послідовність
   «зірочка + слеш» ЗАКРИВАЄ коментар посеред речення, решта тексту стає
   «кодом», і браузер відкидає перше справжнє правило файлу — .st-recent-wrap
   зникав з CSSOM, а панель виглядала правильно лише тому, що елемент має ще
   й клас .panel зі style.css. Виявлено перевіркою балансу дужок 2026-08-02.
   reuses .panel/.chip/.badge/.btn. This file adds the panel-specific chrome
   (header row, search, filter row, responsive grid, card hover) so the block
   reads as a polished, self-contained module. Loaded after style.css.
   Scope: studio.js's renderRecent()/wireRecentChrome() only. */

/* ── Panel shell ─────────────────────────────────────────────────────────── */
.st-recent-wrap{
  margin: 30px 0 14px;
  padding: 16px 18px 18px;
  border-radius: var(--radius, 16px);
  border: 1px solid var(--border-soft);
  background: var(--panel);
  box-shadow: var(--card-shadow);
}

/* ── Header row ──────────────────────────────────────────────────────────── */
.st-recent-head{
  display: flex; align-items: center; gap: var(--sp-12); flex-wrap: wrap;
}

.st-recent-toggle{
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: none; padding: 4px 6px 4px 0; margin: 0;
  cursor: pointer; color: var(--text);
  font: 700 var(--fs-15)/1.2 var(--sans); letter-spacing: -.01em;
  border-radius: var(--ctl-radius-sm);
  transition: opacity var(--t-fast) var(--ease);
}
.st-recent-toggle:hover{ opacity: .85; }

.st-recent-chev{
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: var(--radius-xs);
  background: var(--panel-2); color: var(--text-mute);
  font-size:  var(--fs-11); line-height: 1;
  transition: transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.st-recent-wrap.collapsed .st-recent-chev{ transform: rotate(-90deg); }
.st-recent-toggle:hover .st-recent-chev{ color: var(--text); }

.st-recent-title{ color: var(--text); }
.st-recent-title span{
  font: 600 var(--fs-12)/1 var(--sans); color: var(--text-mute);
  margin-left: 3px; letter-spacing: 0;
}

/* Search — pill with brand-tinted focus ring */
.st-recent-search{
  flex: 1 1 200px; max-width: 280px; margin-left: auto;
  height: 34px; padding: 0 14px; border-radius: 999px; box-sizing: border-box;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font: 500 var(--fs-13)/normal var(--sans);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.st-recent-search::placeholder{ color: var(--text-mute); }
.st-recent-search:focus{
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

/* ── Filter chips ────────────────────────────────────────────────────────── */
.st-recent-filters{
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-top: 14px;
}
.st-recent-filters .chip{
  height: 29px; padding: 0 13px; font-size:  var(--fs-11); font-weight: 600;
  border-radius: 999px;
}

/* ── Body: responsive grid, capped + scrollable when expanded ────────────── */
.st-recent-body{ margin-top: 14px; }

.st-recent-body .st-recent-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--sp-12);
  max-height: 66vh; overflow-y: auto;
  padding: 2px 4px 2px 2px; margin: -2px;
  scrollbar-width: thin;
}
.st-recent-body .st-recent-grid::-webkit-scrollbar{ width: 8px; }
.st-recent-body .st-recent-grid::-webkit-scrollbar-thumb{
  background: var(--border); border-radius: 999px;
}

/* Premium card feel — elevation + lift on hover, brand accent on the active
   session. Interior markup comes from style.css's .st-recent-card. */
.st-recent-body .st-recent-card{
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  transition: transform var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.st-recent-body .st-recent-card:hover{
  transform: translateY(-2px);
  border-color: var(--border);
  box-shadow: var(--shadow-2);
}
.st-recent-body .st-recent-card.current{
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-t-edge-hi), var(--shadow-2);
}

/* WS-change flash (kept in sync with style.css's .ws-flash intent — same
   brand-pink tint as the wsFlash keyframe, not the old off-brand indigo). */
.st-recent-body .st-recent-card.ws-flash{
  animation: stRecentFlash 1.1s var(--ease);
}
@keyframes stRecentFlash{
  0%   { box-shadow: 0 0 0 2px var(--accent-t-glow); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb),0); }
}

/* Empty / no-results state sits centered, muted */
.st-recent-body .empty,
.st-recent-body .empty-state{ margin: 8px auto; }

/* ── "Показати всі" ──────────────────────────────────────────────────────── */
.st-recent-more{
  display: flex; justify-content: center; margin-top: 14px;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 860px){
  .st-recent-wrap{ padding: 14px 13px 15px; }
  .st-recent-search{ margin-left: 0; max-width: none; order: 3; flex-basis: 100%; }
  .st-recent-body .st-recent-grid{
    grid-template-columns: 1fr 1fr; max-height: none; overflow: visible;
  }
}
@media (max-width: 520px){
  .st-recent-body .st-recent-grid{ grid-template-columns: 1fr; }
}
