/* teamworkbot: CSS con variabili, mobile first. Tema: automatico (prefers-color-scheme) oppure scelto
   dall'utente con data-theme="light|dark" su <html> (head.php lo imposta da localStorage prima del CSS). */

:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #FAFAFB;
  --border: #E3E5EA;
  --border-strong: #D5D8DF;
  --divider: #EEF0F3;
  --text: #16181D;
  --muted: #59606E;
  --accent: #1F5FD1;
  --accent-strong: #174AA6;
  --accent-soft: #EAF0FB;
  --warn: #B45309;
  --warn-soft: #FFF4E5;
  --warn-border: #F3D3A6;
  --warn-text: #6B3407;
  --danger: #BE123C;
  --danger-soft: #FDECEF;
  --success: #0F766E;
  --success-soft: #E6F4F2;
  --logo-back: #16181D;
  --logo-eye: #FFFFFF;
  --logo-stroke: #FFFFFF;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --nav-w: 260px;
  --approval: #F08A24;
  --av-edge: rgba(0, 0, 0, 0);
  color-scheme: light;
}

/* Le stesse variabili scure valgono per il tema automatico di notte e per la scelta "scuro". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1115;
    --surface: #171A20;
    --surface-2: #13161B;
    --border: #2A2F38;
    --border-strong: #3A404B;
    --divider: #222730;
    --text: #E8EAEE;
    --muted: #9AA2B1;
    --accent: #5B8DEF;
    --accent-strong: #8AB0F5;
    --accent-soft: #1A2740;
    --warn: #E8913A;
    --warn-soft: #2A1E10;
    --warn-border: #5A3B17;
    --warn-text: #F3C48C;
    --danger: #F06A86;
    --danger-soft: #2E1419;
    --success: #4FC1B3;
    --success-soft: #10241F;
    --logo-back: #E8EAEE;
    --logo-eye: #171A20;
    --logo-stroke: #171A20;
    --av-edge: rgba(255, 255, 255, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1115;
  --surface: #171A20;
  --surface-2: #13161B;
  --border: #2A2F38;
  --border-strong: #3A404B;
  --divider: #222730;
  --text: #E8EAEE;
  --muted: #9AA2B1;
  --accent: #5B8DEF;
  --accent-strong: #8AB0F5;
  --accent-soft: #1A2740;
  --warn: #E8913A;
  --warn-soft: #2A1E10;
  --warn-border: #5A3B17;
  --warn-text: #F3C48C;
  --danger: #F06A86;
  --danger-soft: #2E1419;
  --success: #4FC1B3;
  --success-soft: #10241F;
  --logo-back: #E8EAEE;
  --logo-eye: #171A20;
  --logo-stroke: #171A20;
  --av-edge: rgba(255, 255, 255, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; margin-top: 20px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- layout */

.app { min-height: 100vh; min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.brand b, .brand-name b { color: var(--accent); font-weight: 600; }

.sidenav {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: min(var(--nav-w), 85vw);
  display: flex; flex-direction: column; gap: 20px;
  padding: 20px 14px; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform .2s ease;
}
.sidenav.is-open { transform: none; }
.nav-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.35); }

.brand-block { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.brand-lg { font-size: 24px; }

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: 15px;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); font-weight: 600; }
.badge { background: var(--warn); color: #FFF; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 8px; }

.nav-footer { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 6px; }
.space-switch { display: flex; flex-direction: column; gap: 4px; }
.user-row { display: flex; align-items: center; gap: 8px; }
.user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

.main { padding: 16px; max-width: 980px; }

/* Bot nella barra laterale, raggruppati per reparto (mockup docs/teamworkbot.com, interfaccia e logo.html). */
.nav-bots { display: flex; flex-direction: column; gap: 14px; }
.nav-bot-group { display: flex; flex-direction: column; gap: 2px; }
.nav-bot-group .section-label { padding: 0 10px 4px; }
.nav-bot { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.nav-bot:hover { background: var(--bg); color: var(--text); }
.nav-bot.is-active { background: var(--bg); }
.avatar-nav { width: 32px; height: 32px; font-size: 14px; }
.nav-bot-text { display: flex; flex-direction: column; min-width: 0; }
.nav-bot-name { font-size: 14px; font-weight: 600; }
.nav-bot-status { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-bot-status.is-busy { color: var(--accent); }
.nav-bot-status.is-waiting { color: var(--warn); }

/* Barra in basso su mobile: Bot, Approvazioni, Attività, Altro (apre il menu). */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 25;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; border: 0; background: none; font: inherit; font-size: 12px; color: var(--muted); text-decoration: none; cursor: pointer;
}
.tab.is-active { color: var(--accent); font-weight: 600; }
.tab-badge { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--warn); color: #FFF; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 6px; }
.main { padding-bottom: 80px; }
.app:has(.chat-page) .tabbar { display: none; }
.app:has(.chat-page) .main { padding-bottom: 0; }

@media (min-width: 900px) {
  .topbar, .nav-backdrop, [data-nav-toggle] { display: none !important; }
  .tabbar { display: none; }
  .main { padding-bottom: 28px; }
  .sidenav { transform: none; width: var(--nav-w); transition: none; }
  .main { margin-left: var(--nav-w); padding: 28px 32px; }
}

/* ---------------------------------------------------------------- componenti */

.page { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px;
}
.card > h2 { margin-bottom: 12px; }
.card.empty { text-align: left; }

.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--avatar, var(--muted)); color: #FFF; font-weight: 600;
}
.avatar-sm { width: 28px; height: 28px; font-size: 13px; }

.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); padding: 0 6px 6px;
}
.bot-section { display: flex; flex-direction: column; }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-row {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  color: var(--text); text-decoration: none; border-bottom: 1px solid var(--divider);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); color: var(--text); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-title { font-weight: 600; }
.list-sub { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #FFF; }
.btn-primary:hover { background: var(--accent-strong); color: #FFF; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); font-weight: 500; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.link-btn { border: 0; background: none; padding: 4px; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field-wide, .form-actions { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: 16px; /* 16px evita lo zoom automatico su iOS */
  min-height: 44px; padding: 10px 12px; width: 100%;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px;
}
input:disabled, select:disabled { background: var(--bg); color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 20px; min-height: 20px; height: 20px; }
.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.inline-form input { flex: 1; }

.flash { border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; border: 1px solid; }
.flash-success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.flash-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.flash-info { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }

.tag { display: inline-block; background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: 0 8px; font-size: 12px; }

.secret-list, .plain-list { list-style: none; margin: 0 0 8px; padding: 0; }
.secret-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.secret-meta { display: flex; flex-direction: column; min-width: 0; }
.secret-actions summary { list-style: none; }
.secret-actions summary::-webkit-details-marker { display: none; }
.secret-actions[open] { flex-basis: 100%; }
.plain-list li { padding: 6px 0; }
.audit-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; border-bottom: 1px solid var(--divider); }

/* ---------------------------------------------------------------- pagine ospite */

.guest-main { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.guest-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; padding: 28px 24px; }
.guest-card .brand-block { justify-content: center; }

/* ---------------------------------------------------------------- elenco bot */

.list-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.status-busy { font-size: 12px; font-weight: 500; color: var(--accent-strong); }

/* ---------------------------------------------------------------- chat */

.main:has(.chat-page) { max-width: none; padding: 0; }
.chat-page { display: flex; min-height: calc(100dvh - 61px); }
.chat-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.chat-head {
  position: sticky; top: 61px; z-index: 10;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-title h1 { font-size: 17px; font-weight: 600; }
.chat-title .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 5px 10px;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status-pill .dot, .dots::after { animation: none !important; } }

.chat-log { flex: 1 1 auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); overflow-y: auto; }
.chat-empty { align-self: center; margin-top: 24px; }
.msg-row { display: flex; gap: 10px; max-width: 100%; }
.msg-user { flex-direction: column; align-items: flex-end; align-self: flex-end; max-width: min(560px, 88%); }
.msg-bot { align-items: flex-start; max-width: min(680px, 94%); }
.msg-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg-note { align-self: center; max-width: 92%; }
.note { display: inline-block; font-size: 13px; color: var(--warn-text); background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: 10px; padding: 6px 12px; text-align: center; }
.bubble { padding: 10px 14px; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.bubble-user { background: var(--accent); color: #FFF; border-radius: 14px 14px 4px 14px; }
.bubble-bot { background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; }
.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 20px; }
.md .md-h { font-weight: 600; }
.msg-time { font-size: 12px; color: var(--muted); }
.typing { align-items: center; }
.dots::after { content: '…'; animation: pulse 1.4s ease-in-out infinite; }

.chat-form {
  position: sticky; bottom: 0;
  display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
}
.chat-form textarea { flex: 1; resize: none; min-height: 48px; max-height: 40vh; }
.send-btn { flex: none; width: 48px; height: 48px; border: 0; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.send-btn:disabled { opacity: .5; cursor: default; }

.chat-side { display: none; }
.side-card h2 { font-size: 14px; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

@media (min-width: 900px) {
  .chat-page { min-height: 100dvh; }
  .chat-head { top: 0; padding: 14px 24px; }
  .back-btn { display: none; }
  .chat-log { padding: 24px; }
  .chat-form { padding: 14px 24px; }
}
@media (min-width: 1200px) {
  .chat-side { display: flex; flex-direction: column; gap: 14px; flex: 0 0 300px; padding: 20px; border-left: 1px solid var(--border); }
  .chat-main { height: 100dvh; position: sticky; top: 0; }
}

/* ---------------------------------------------------------------- attività e costi */

.stat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 8px; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 26px; font-weight: 500; }
.meter { flex: 1 1 200px; height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--divider); }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.table .num { text-align: right; white-space: nowrap; }
.bar-col { width: 50%; }
.bar { display: block; height: 10px; min-width: 2px; background: var(--accent); border-radius: 4px; }
.dot-color { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--avatar, var(--muted)); margin-right: 8px; }

.run-list { list-style: none; margin: 0; padding: 0; }
.run-list > li { border-bottom: 1px solid var(--divider); }
.run-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 0; cursor: pointer; list-style: none; }
.run-summary::-webkit-details-marker { display: none; }
.run-bot { font-weight: 600; }
.run-cost { margin-left: auto; }
.run-status { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--bg); color: var(--muted); }
.run-running, .run-queued { background: var(--accent-soft); color: var(--accent-strong); }
.run-succeeded { background: var(--success-soft); color: var(--success); }
.run-failed { background: var(--danger-soft); color: var(--danger); }
.run-detail { padding: 0 0 12px 20px; }
.event-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.event-list li { overflow-wrap: anywhere; }
.event-warning strong { color: var(--warn); }
.event-error strong { color: var(--danger); }
.event-payload { display: block; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- approvazioni */

.approval-card { display: flex; flex-direction: column; gap: 10px; }
.approval-card.status-pending { border-color: var(--warn-border); }
.approval-head { display: flex; align-items: center; gap: 10px; }
.approval-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.approval-impact { margin: 0; font-weight: 500; }
.approval-preview {
  margin: 0; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  font: 14px/1.5 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh; overflow: auto;
}
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.approval-actions .btn { min-width: 120px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.reject-box summary { list-style: none; }
.reject-box summary::-webkit-details-marker { display: none; }
.reject-box[open] { flex-basis: 100%; }
.reject-box form { margin-top: 10px; }
.pending-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 0;
  background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: 12px; color: var(--warn-text); text-decoration: none; font-weight: 600;
}
.pending-banner:hover { color: var(--warn-text); }
.pending-banner .count { width: 28px; height: 28px; border-radius: 50%; background: var(--warn); color: #FFF; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.status-waiting { font-size: 12px; font-weight: 500; color: var(--warn-text); }

/* ---------------------------------------------------------------- server MCP */

.mcp-server { border-top: 1px solid var(--divider); padding: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.mcp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mcp-bot { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.mcp-bot summary { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.mcp-tools { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mcp-tool { align-items: flex-start; }
.mcp-tool.is-blocked { opacity: .6; }
.mcp-desc { display: block; }
.tag-warn { background: var(--warn-soft); color: var(--warn-text); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.chat-pending { padding: 8px 12px 0; background: var(--surface); }
.vault-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; border-bottom: 1px solid var(--divider); }

/* ---------------------------------------------------------------- routine */

.routine-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--divider); }
.routine-row:last-child { border-bottom: 0; }
.routine-row.is-off { opacity: .65; }
.routine-main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.routine-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inbound-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; border-bottom: 1px solid var(--divider); }
.inbound-list li > div { flex-basis: 100%; }

/* ---------------------------------------------------------------- impostazioni bot */

.tool-list { display: flex; flex-direction: column; gap: 10px; }
.tool-item { align-items: flex-start; }
.history { margin-top: 10px; }
.history-item { margin: 8px 0 0 12px; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); }
.chat-head .settings-link { flex: none; }

/* ---------------------------------------------------------------- salute */

.health-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; border-bottom: 1px solid var(--divider); }
.health-ok { background: var(--success-soft); color: var(--success); }
.health-warning { background: var(--warn-soft); color: var(--warn-text); }
.health-error { background: var(--danger-soft); color: var(--danger); }
.budget-banner { display: block; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; text-decoration: none; }
.md .md-media, .note .md-media { display: block; max-width: 100%; max-height: 420px; border-radius: 10px; margin: 6px 0; background: var(--divider); }
.md audio.md-media { max-height: none; width: 100%; }

/* ---------------------------------------------------------------- chat, come nel mockup */

.head-btn { display: none; font-weight: 500; }
@media (min-width: 900px) {
  .head-btn { display: inline-flex; }
  .chat-head .settings-link { display: none; }
}
.approval-inline { max-width: min(680px, 94%); }
.inline-approval {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: 12px; padding: 12px 14px; color: var(--warn);
}
.inline-approval-text { flex: 1 1 240px; font-size: 14px; color: var(--warn-text); }
.btn-warn { background: var(--warn); color: #FFF; }
.btn-warn:hover { color: #FFF; filter: brightness(.95); }
.tool-used { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.tool-used li { display: flex; justify-content: space-between; gap: 8px; }
.tool-used .mono { overflow-wrap: anywhere; }
.chat-side { background: var(--bg); }

.msg-author { font-size: 12px; font-weight: 600; color: var(--muted); }
.mic-btn { flex: none; width: 48px; height: 48px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mic-btn.is-recording { background: var(--danger); border-color: var(--danger); color: #FFF; }
.mic-btn:disabled { opacity: .5; cursor: default; }
.rec-status { flex-basis: 100%; font-size: 13px; color: var(--danger); }
.chat-form { flex-wrap: wrap; }
.chat-form textarea { flex: 1 1 200px; }
.squad-avatar { background: var(--text); color: var(--surface); }

/* ---------------------------------------------------------------- approvazioni, come nel mockup */

.approvals-head { justify-content: space-between; align-items: flex-end; }
.approvals-head > div { flex: 1 1 360px; }
.approvals-head p { margin: 4px 0 0; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.tab-link { min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.tab-link.is-active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.approval-title { font-size: 16px; font-weight: 600; margin: 0; }
.approval-head .avatar { width: 36px; height: 36px; }
.field-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.approval-body { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .approval-body.has-actions { grid-template-columns: minmax(0, 3fr) minmax(240px, 2fr); } }
.approval-actions { display: flex; flex-direction: column; gap: 10px; }
.approval-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.approval-buttons .btn { flex: 1 1 120px; }

/* ---------------------------------------------------------------- attività, come nel mockup */

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 500; line-height: 1.1; }
.kpi .meter { flex: none; height: 8px; }
.kpi-alert .kpi-value { color: var(--danger); }
.activity-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 1100px) { .activity-grid { grid-template-columns: 3fr 2fr; } }
.bar-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bar-list li { display: flex; flex-direction: column; gap: 4px; }
.bar-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.bar-track { display: block; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-track .bar { height: 100%; border-radius: 999px; }
.health-mini { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.health-mini li { display: grid; grid-template-columns: 10px auto 1fr; gap: 10px; align-items: baseline; }
.health-mini .muted { text-align: right; overflow-wrap: anywhere; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); align-self: center; }
.health-dot-warning { background: var(--warn); }
.health-dot-error { background: var(--danger); }
.health-label { font-size: 14px; }
.main:has(.kpi-grid) { max-width: 1200px; }
.md-table { overflow-x: auto; margin: 0 0 8px; }
.md-table table { border-collapse: collapse; font-size: 14px; }
.md-table th, .md-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--divider); }
.md-table th { font-size: 12px; color: var(--muted); font-weight: 600; }

.replicate-catalog { margin: 8px 0 16px; }
.replicate-catalog summary { cursor: pointer; padding: 8px 0; }
.catalog-list { display: flex; flex-direction: column; }
.catalog-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.catalog-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.catalog-price { color: var(--accent-strong); font-weight: 500; }

/* Animazione di attesa mentre il bot lavora: tre puntini che saltano e cosa sta facendo. */
.typing-bubble {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 10px 14px;
}
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: typing-bounce 1.2s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
.typing-text { font-size: 14px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .typing-dots i { animation: pulse 1.6s ease-in-out infinite; transform: none; }
}

/* ---------------------------------------------------------------- casella di scrittura (+, allegati, insegna, microfono) */

.composer { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.composer-box {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 22px; padding: 6px 6px 6px 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.composer-box:focus-within { border-color: var(--accent); }
.composer-box.is-drop { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); }
.composer-box textarea {
  flex: 1 1 auto; min-height: 36px; max-height: 40vh; resize: none; border: 0; padding: 8px 4px; background: transparent; box-shadow: none; outline: none;
  font-size: 15px; line-height: 1.4;
}
.composer-box textarea:focus-visible { outline: none; }
.plus-wrap { position: relative; flex: none; }
.plus-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg); color: var(--muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.plus-btn:hover, .plus-btn[aria-expanded="true"] { background: var(--border); color: var(--text); }
.plus-menu {
  position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 30; min-width: 210px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); display: flex; flex-direction: column;
}
.plus-menu button {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-align: left;
}
.plus-menu button:hover, .plus-menu button:focus-visible { background: var(--bg); }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--danger); position: relative; }
.rec-dot::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--danger); }
.composer .mic-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--text); color: var(--surface); }
.composer .mic-btn.is-recording { background: var(--danger); color: #FFF; }
.composer .send-btn { width: 36px; height: 36px; border-radius: 50%; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 4px 6px 4px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; }
.attach-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-remove { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.teach-banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--text); font-size: 13px; }
.teach-tag { display: inline-block; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.2); border-radius: 999px; padding: 1px 8px; margin-bottom: 6px; }
.msg-attach { display: block; margin-top: 8px; }
.msg-attach img { max-width: 260px; max-height: 260px; border-radius: 10px; display: block; }
.msg-file { color: #FFF; text-decoration: underline; }
.chat-form.composer { background: var(--surface-2); border-top: 0; }

/* ---------------------------------------------------------------- account e "Connetti app" in fondo alla barra laterale */

.account-bar { display: flex; align-items: center; gap: 8px; }
.pop-wrap { position: relative; }
.pop-grow { flex: 1; min-width: 0; }
.account-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.account-btn[aria-expanded="true"], .account-btn:hover { background: var(--border); color: var(--text); }
.connect-btn {
  width: 100%; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: inherit; font-size: 14px; color: var(--text); cursor: pointer;
}
.connect-btn:hover, .connect-btn[aria-expanded="true"] { background: var(--bg); }
.connect-icons { display: inline-flex; gap: 2px; }
.app-icon {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 5px;
  background: var(--app); color: #FFF; font-size: 10px; font-weight: 700; letter-spacing: -.02em;
}
.app-icon.is-off { background: var(--border); color: var(--muted); }
/* Icone ufficiali dei servizi (public/assets/icons): fondo chiaro, logo a colori; spente in grigio. */
.app-icon-img { background: #FFF; border: 1px solid var(--border); padding: 2px; }
.app-icon-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.app-icon-img.is-off { background: #FFF; }
.app-icon-img svg { color: var(--accent); }
.connect-icons .app-icon-img { width: 18px; }
.connect-row .app-icon-img { width: 28px; padding: 4px; }

/* Impostazioni: indice a schede e pagine per connettore */
.settings-group { margin-bottom: 28px; }
.settings-group > h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.settings-tile {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); text-decoration: none;
}
.settings-tile:hover { border-color: var(--accent); color: var(--text); }
.settings-tile .app-icon { min-width: 40px; width: 40px; height: 40px; border-radius: 10px; font-size: 16px; flex: none; }
.settings-tile .app-icon-img { padding: 6px; }
.settings-tile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.settings-tile-text strong { font-size: 15px; }
.settings-tile .connect-state { margin-top: 2px; }
.settings-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 8px; }
.page-head .app-icon { min-width: 36px; width: 36px; height: 36px; border-radius: 10px; font-size: 15px; }
.page-head-title { display: flex; align-items: center; gap: 12px; }
.pop-menu {
  position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 50; width: 270px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); display: flex; flex-direction: column;
}
.pop-menu[hidden] { display: none; }
.pop-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--divider); margin-bottom: 4px; }
.pop-menu > a, .pop-menu form button, .pop-sub > summary, .pop-sub a {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 14px; color: var(--text); text-decoration: none; cursor: pointer; width: 100%; text-align: left;
}
.pop-menu > a:hover, .pop-menu form button:hover, .pop-sub > summary:hover, .pop-sub a:hover { background: var(--bg); color: var(--text); }
.pop-menu svg { color: var(--muted); flex: none; }
.pop-menu hr { border: 0; border-top: 1px solid var(--divider); margin: 4px 6px; }
.pop-sub > summary { list-style: none; }
.pop-sub > summary::-webkit-details-marker { display: none; }
.pop-sub .chev { margin-left: auto; transition: transform .15s; }
.pop-sub[open] .chev { transform: rotate(90deg); }
.pop-sub a { padding-left: 36px; font-size: 13px; }
.connect-menu { left: auto; right: 0; width: 300px; max-height: 70vh; overflow-y: auto; }
.connect-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.connect-row:hover { background: var(--bg); color: var(--text); }
.connect-row .app-icon { min-width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.connect-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.connect-state { font-size: 12px; font-weight: 600; color: var(--accent); }
.connect-state.is-on { color: var(--success); }
/* I menu prendono la larghezza della barra: la barra laterale scorre e taglierebbe ciò che esce dai suoi bordi. */
.account-bar { position: relative; }
.account-bar .pop-wrap { position: static; }
.account-bar .pop-menu { left: 0; right: 0; width: auto; }
/* Fondo della barra sempre visibile: scorre solo l'elenco dei bot; i menu possono uscire dalla barra. */
.sidenav { overflow: visible; }
.nav-bots { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.nav-footer { flex: none; }
.account-bar .pop-menu { left: 0; right: auto; width: 280px; }
.account-bar .connect-menu { width: 320px; }

/* Libreria: griglia di immagini, video e documenti */
.library-tabs { display: flex; gap: 8px; margin: 12px 0; }
.library-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.library-filters .field { min-width: 180px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.library-item { display: flex; flex-direction: column; gap: 6px; padding: 10px; min-width: 0; }
.library-preview { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--accent-soft); border-radius: 8px; overflow: hidden; }
.library-preview img, .library-preview video { width: 100%; height: 100%; object-fit: cover; }
.library-ext { font-weight: 700; color: var(--accent-strong); letter-spacing: .05em; }
.library-title { overflow-wrap: anywhere; }
.mcp-modes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }

/* Versione locale: etichetta fissa in basso a destra, non sposta il layout. */
.env-badge {
  position: fixed; right: 12px; bottom: 12px; z-index: 100;
  padding: 4px 10px; border-radius: 999px;
  background: var(--warn-soft); border: 1px solid var(--warn-border); color: var(--warn-text);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  pointer-events: auto; cursor: help;
}

/* Pagine legali: testo lungo leggibile, anche senza login. */
.legal-card { width: 100%; max-width: 760px; padding: 28px 24px; line-height: 1.6; }
.legal-card h1 { margin-top: 0; }
.legal-card h2 { font-size: 1.1rem; margin: 28px 0 8px; }
.legal-card ul { padding-left: 20px; }
.legal-card table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.legal-card th, .legal-card td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.legal-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.legal-links a { color: var(--muted); }
.check-top { align-items: flex-start; line-height: 1.45; }

/* Avatar dei bot (BotAvatar): forma × colore con gli occhi; lo stato è una classe is-*. */
.av { display: inline-block; flex: none; line-height: 0; vertical-align: middle; }
.av svg { width: 100%; height: auto; overflow: visible; display: block; }
.av .body { filter: drop-shadow(0 0 .7px var(--av-edge)); }
.av .bodyg, .av .eyes, .av .appr, .av .ripple { transform-box: fill-box; }
.av .bodyg { transform-origin: 50% 100%; }
.av .eyes, .av .appr, .av .ripple { transform-origin: center; }
.av .xeyes, .av .appr-g, .av .done-g { display: none; }
.av.is-idle .eyes { animation: av-blink 5.2s infinite; animation-delay: var(--d, 0s); }
@keyframes av-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.av.is-thinking .eyes { animation: av-look 2s ease-in-out infinite; }
.av.is-thinking .bodyg { animation: av-bob 1s ease-in-out infinite; }
@keyframes av-look { 0%, 100% { transform: translateX(-3px); } 45%, 55% { transform: translateX(3px); } }
@keyframes av-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-1.5px) scale(1.03, .96); } }
.av.is-approval .appr-g { display: inline; }
.av.is-approval .appr { animation: av-pulse 1.4s ease-in-out infinite; }
.av.is-approval .ripple { animation: av-ripple 1.4s ease-out infinite; }
@keyframes av-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes av-ripple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.4); opacity: 0; } }
.av.is-error .eyes { display: none; }
.av.is-error .xeyes { display: inline; }
.av.is-error .bodyg { filter: grayscale(.75) brightness(.95); }
.av.is-done svg { animation: av-hop .7s cubic-bezier(.3, 1.6, .5, 1) 1 both; }
.av.is-done .done-g { display: inline; animation: av-fade 1.8s ease-out 1 forwards; }
@keyframes av-hop { 0% { transform: translateY(0); } 35% { transform: translateY(-16%); } 65% { transform: translateY(0) scaleY(.93); } 100% { transform: none; } }
@keyframes av-fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .av *, .av svg { animation: none !important; }
  .av.is-thinking .eyes { transform: translateX(3px); }
  .av.is-approval .ripple { opacity: .35; transform: scale(1.6); }
  .av.is-done .done-g { opacity: 1; }
}

/* Scelta dell'avatar (impostazioni del bot): forme e colori come radio. */
.av-picker { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.av-preview .av { width: 96px; }
.av-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 520px; margin: 0; padding: 0; border: 0; }
.av-options legend { width: 100%; text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.av-opt { position: relative; display: inline-grid; place-items: center; cursor: pointer; }
.av-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.av-opt .av { width: 40px; padding: 4px; box-sizing: content-box; border-radius: 12px; }
.av-opt .swatch { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
.av-opt input:checked + .av { box-shadow: 0 0 0 2px var(--accent); }
.av-opt input:checked + .swatch { box-shadow: 0 0 0 2px var(--accent); }
.av-opt input:focus-visible + * { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Scelta del tema nel menu dell'account. */
.theme-switch { display: flex; gap: 4px; padding: 6px 10px; }
.theme-switch button { flex: 1; font: inherit; font-size: 12px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-switch button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.bot-new-card { max-width: 640px; margin: 0 auto; }
.page-head .head-actions { margin-left: auto; }
.brand-home { text-decoration: none; color: inherit; }

/* Zona di trascinamento dei file (Import): l'input resta dentro, trasparente, per il clic e la tastiera. */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 16px; text-align: center; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); }
.dropzone.is-drop { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.dropzone.has-file { border-style: solid; border-color: var(--success); color: var(--text); }
.dropzone-text { color: var(--text); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Catalogo bot */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.catalog-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.catalog-card p { margin: 0; }
.catalog-card form, .catalog-card > .btn { margin-top: auto; align-self: flex-start; }
.catalog-card.is-in { opacity: .75; }
.catalog-head { display: flex; align-items: center; gap: 12px; }
.catalog-head h2 { margin: 0; font-size: 16px; }
.catalog-import { margin-bottom: 16px; }
