/* =====================================================================
   Console (/app/*) — shell, shared components and page-specific parts.
   Loaded after styles.css. All colours come from the tokens below, so
   re-theming the dashboard is a single edit.
   ===================================================================== */

:root {
  --c-bg: #f3f6fb;
  --c-surface: #ffffff;
  --c-line: #e5eaf2;
  --c-ink: #0f172a;
  --c-text: #334155;
  --c-muted: #64748b;
  --c-primary: #2563eb;
  --c-primary-600: #1d4ed8;
  --c-primary-soft: #eaf1ff;
  --c-side-top: #0a1b4d;
  --c-side-bottom: #1646b3;
  --c-accent: #c9f24d;
  --c-wa: #22c55e;
  --c-marketing: #7c3aed;
  --c-marketing-soft: #f3edff;
  --c-utility: #0369a1;
  --c-utility-soft: #e0f2fe;
  --side-w: 258px;
  --side-w-mini: 78px;
  --appbar-h: 66px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.14);
}

body.console {
  padding: 0;
  background: var(--c-bg);
  color: var(--c-ink);
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: var(--side-w);
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  background: linear-gradient(180deg, var(--c-side-top) 0%, var(--c-side-bottom) 100%);
  color: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  transition: width 0.2s ease;
}

/* a soft glow so the rail doesn't read as a flat block of blue */
.sidebar::before {
  content: '';
  position: absolute;
  left: -80px;
  bottom: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 242, 77, 0.16), transparent 70%);
  pointer-events: none;
}

.side-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
  color: #fff;
  text-decoration: none;
}

.side-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--c-accent);
  color: var(--c-side-top);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(201, 242, 77, 0.25);
}

.side-mark svg {
  width: 19px;
  height: 19px;
}

.side-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.side-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-section {
  margin: 18px 0 6px;
  padding: 0 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}

.side-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.side-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.side-item:hover,
summary.side-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.side-item.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.side-item.is-active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--c-accent);
}

.side-item.is-soon {
  cursor: default;
  color: rgba(255, 255, 255, 0.5);
}

.side-soon {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.side-group > summary {
  list-style: none;
}

.side-group > summary::-webkit-details-marker {
  display: none;
}

.side-chevron {
  display: grid;
  margin-left: auto;
  transition: transform 0.15s ease;
}

.side-chevron svg {
  width: 14px;
  height: 14px;
}

.side-group[open] .side-chevron {
  transform: rotate(180deg);
}

.side-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 4px 21px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.side-sub .side-item {
  padding: 8px 11px;
  font-size: 13px;
}

.side-sub .side-item svg {
  width: 17px;
  height: 17px;
}

.side-sub .side-item.is-active::before {
  width: 3px;
}

.side-foot {
  position: relative;
  margin-top: auto;
  padding-top: 18px;
}

.side-setup {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.side-setup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.side-setup-head span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 11.5px;
}

.side-setup-bar {
  height: 5px;
  margin: 10px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.side-setup-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--c-accent);
  transition: width 0.3s ease;
}

.side-setup ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-setup a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 4px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  text-decoration: none;
}

.side-setup a:hover {
  background: rgba(255, 255, 255, 0.07);
}

.side-setup .is-done a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
}

.setup-tick {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
}

.is-done .setup-tick {
  border-color: var(--c-accent);
  background: var(--c-accent);
  color: var(--c-side-top);
}

.setup-tick svg {
  width: 10px;
  height: 10px;
}

.side-links {
  display: flex;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0 8px;
  font-size: 11px;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.35);
}

.side-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.side-links a:hover {
  color: #fff;
}

/* icon-only rail */

.app.is-mini .sidebar {
  width: var(--side-w-mini);
  padding-left: 12px;
  padding-right: 12px;
}

.app.is-mini .side-name,
.app.is-mini .side-label,
.app.is-mini .side-soon,
.app.is-mini .side-chevron,
.app.is-mini .side-foot,
.app.is-mini .side-group > summary {
  display: none;
}

.app.is-mini .side-brand {
  padding-left: 9px;
}

.app.is-mini .side-section {
  height: 1px;
  margin: 12px 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.14);
}

.app.is-mini .side-section span {
  display: none;
}

.app.is-mini .side-item {
  justify-content: center;
  padding: 11px;
}

.app.is-mini .side-item.is-active::before {
  left: -12px;
}

.app.is-mini .side-sub {
  margin: 0;
  padding: 0;
  border: 0;
}

/* ---------- top bar ---------- */

.app-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--appbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-line);
}

.appbar-toggle {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--c-line);
  border-radius: 11px;
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
}

.appbar-toggle:hover {
  background: #f8fafc;
}

.appbar-toggle svg {
  width: 19px;
  height: 19px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  color: var(--c-muted);
  white-space: nowrap;
}

.crumbs a {
  color: inherit;
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--c-primary);
}

.crumbs svg {
  width: 13px;
  height: 13px;
  color: #cbd5e1;
}

.crumbs strong {
  color: var(--c-ink);
  font-weight: 600;
}

.appbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--c-text);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.wa-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

.wa-pill.is-on {
  background: #e9fbef;
  color: #15803d;
}

.wa-pill.is-on i {
  background: var(--c-wa);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.wa-pill.is-off {
  background: #fff7e6;
  color: #a16207;
}

.wa-pill.is-off i {
  background: #f59e0b;
}

.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.user-btn:hover {
  background: #f8fafc;
}

.user-meta strong,
.user-meta small {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta strong {
  font-size: 12.5px;
  font-weight: 600;
}

.user-meta small {
  color: var(--c-muted);
  font-size: 11px;
}

.user-chevron {
  display: grid;
}

.user-chevron svg {
  width: 14px;
  height: 14px;
  color: var(--c-muted);
}

.user-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}

.user-pop a,
.user-pop button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--c-text);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.user-pop a:hover,
.user-pop button:hover {
  background: #f1f5f9;
  color: var(--c-ink);
}

.user-pop svg {
  width: 17px;
  height: 17px;
}

.user-pop #sign-out {
  color: #b91c1c;
}

.avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), #60a5fa);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.side-backdrop {
  display: none;
}

/* ---------- page area ---------- */

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 30px 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--c-ink);
}

.topbar p {
  margin: 4px 0 0;
  color: var(--c-muted);
  font-size: 12.5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- shared components, console flavour ---------- */

.console .card {
  border-color: var(--c-line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.console .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
}

.btn-primary {
  background: var(--c-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
  background: var(--c-primary-600);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.console .btn-ghost {
  border-color: var(--c-line);
  color: var(--c-text);
}

.console .btn-ghost:hover {
  background: #f8fafc;
}

.console .btn-danger {
  color: #b91c1c;
}

.console .icon-btn {
  display: inline-grid;
  place-items: center;
  border-color: var(--c-line);
  color: var(--c-muted);
}

.console .icon-btn:hover {
  background: #f8fafc;
  color: var(--c-ink);
}

.console .icon-btn svg {
  width: 15px;
  height: 15px;
}

.console .icon-btn.is-danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.console .field input,
.console .field select,
.console .field textarea {
  border-color: var(--c-line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.console .field input:focus,
.console .field select:focus,
.console .field textarea:focus,
.console .tpl-button input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.console .seg button.is-on,
.console .logic.is-on {
  background: var(--c-primary-soft);
  border-color: var(--c-primary);
  color: var(--c-primary-600);
}

.console .chip {
  background: #f1f5f9;
  color: #475569;
}

.console .chip-green {
  background: #dcfce7;
  color: #15803d;
}

.console .promo {
  border: 0;
  background: linear-gradient(140deg, var(--c-side-bottom) 0%, var(--c-primary) 100%);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.25);
}

.console .table th {
  color: var(--c-muted);
}

.console .table td {
  border-top-color: var(--c-line);
}

/* ---------- info callout ---------- */

.callout {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #cfe0ff;
  border-radius: 16px;
  background: linear-gradient(120deg, #eef4ff, #f6f9ff);
}

.callout-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--c-primary);
  color: #fff;
  display: grid;
  place-items: center;
}

.callout-icon svg {
  width: 18px;
  height: 18px;
}

.callout-body {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--c-text);
}

.callout-body strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13.5px;
  color: var(--c-ink);
}

.callout-body p {
  margin: 0;
}

.callout-note {
  margin-top: 8px !important;
  padding-top: 8px;
  border-top: 1px dashed #cfe0ff;
  color: var(--c-muted);
}

.console .callout .icon-btn {
  background: transparent;
  border-color: transparent;
}

/* ---------- table card (templates list) ---------- */

.console .table-card {
  padding: 0;
  overflow: hidden;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--c-line);
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(320px, 100%);
  padding: 0 12px;
  border: 1px solid var(--c-line);
  border-radius: 11px;
  background: #f8fafc;
}

.search:focus-within {
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--c-muted);
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--c-ink);
}

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: #f1f5f9;
}

.tabs button {
  padding: 7px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--c-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.tabs button.is-on {
  background: var(--c-surface);
  color: var(--c-ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.tabs button span {
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 10.5px;
}

.table-card .table th {
  padding: 13px 18px;
  background: #f8fafc;
}

.table-card .table td {
  padding: 14px 18px;
  vertical-align: middle;
}

.table-card .table tbody tr:hover {
  background: #fafcff;
}

.tpl-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.tpl-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #f1f5f9 center / cover no-repeat;
  color: var(--c-muted);
  display: grid;
  place-items: center;
}

.tpl-thumb svg {
  width: 18px;
  height: 18px;
}

.tpl-cell strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.tpl-cell small {
  display: block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--c-muted);
  font-size: 11.5px;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.cat-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.cat-MARKETING {
  background: var(--c-marketing-soft);
  color: var(--c-marketing);
}

.cat-UTILITY {
  background: var(--c-utility-soft);
  color: var(--c-utility);
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.empty-state {
  padding: 46px 20px 50px;
  text-align: center;
}

.empty-art {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  display: grid;
  place-items: center;
}

.empty-art svg {
  width: 34px;
  height: 34px;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.empty-state p {
  max-width: 360px;
  margin: 0 auto 16px;
  color: var(--c-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------- template editor: category cards ---------- */

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px 40px 14px 14px;
  border: 1.5px solid var(--c-line);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice:hover {
  border-color: #cbd5e1;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice:has(input:checked) {
  border-color: var(--c-primary);
  background: #f7faff;
}

.choice:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.choice-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.choice-icon svg {
  width: 18px;
  height: 18px;
}

.choice-MARKETING .choice-icon {
  background: var(--c-marketing-soft);
  color: var(--c-marketing);
}

.choice-UTILITY .choice-icon {
  background: var(--c-utility-soft);
  color: var(--c-utility);
}

.choice strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.choice small {
  display: block;
  margin-top: 2px;
  color: var(--c-muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.choice-check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  transition: border 0.15s ease;
}

.choice:has(input:checked) .choice-check {
  border: 5px solid var(--c-primary);
}

.field-label {
  display: block;
  margin: 18px 0 9px;
  font-size: 12px;
  font-weight: 600;
  color: #3f444d;
}

/* ---------- template editor: media upload ---------- */

.dropzone {
  margin-top: 14px;
  border: 1.5px dashed #c7d2e3;
  border-radius: 16px;
  background: #fafcff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.is-over {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}

.dropzone.has-error {
  border-color: #fca5a5;
}

.dz-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 30px 16px;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.dz-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--c-surface);
  color: var(--c-primary);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--c-line);
}

.dz-icon svg {
  width: 22px;
  height: 22px;
}

.dz-empty strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-ink);
}

.dz-empty span {
  font-size: 12px;
  color: var(--c-muted);
}

.dz-empty span b {
  color: var(--c-primary);
  font-weight: 600;
}

.dz-empty small {
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
}

.dz-busy {
  padding: 26px 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--c-text);
}

.dz-progress {
  height: 6px;
  max-width: 280px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.dz-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--c-primary);
  transition: width 0.15s ease;
}

.dz-file {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.dz-thumb {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #e2e8f0 center / cover no-repeat;
  color: var(--c-muted);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.dz-thumb svg {
  width: 26px;
  height: 26px;
}

.dz-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dz-meta {
  flex: 1;
  min-width: 0;
}

.dz-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.dz-meta small {
  color: #15803d;
  font-size: 11.5px;
}

.dz-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.field-error {
  margin: 8px 0 0;
  color: #b91c1c;
  font-size: 12px;
}

.field-error:empty {
  display: none;
}

/* ---------- template editor: variables ---------- */

.var-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--c-line);
}

.var-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.var-panel-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.var-panel .hint {
  margin-bottom: 12px;
}

.var-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.var-tag {
  flex-shrink: 0;
  min-width: 52px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #dbeafe;
  color: #1e40af;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.var-input {
  position: relative;
  flex: 1;
  min-width: 0;
}

.var-input input {
  width: 100%;
  padding: 10px 56px 10px 12px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: var(--c-surface);
  color: var(--c-ink);
  font: inherit;
  font-size: 13px;
}

.var-input input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.var-input small {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 10.5px;
}

.var-field,
.var-label {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: var(--c-surface);
  color: var(--c-ink);
  font: inherit;
  font-size: 12.5px;
}

.var-field {
  flex: 1;
}

.var-label {
  flex: 1.2;
}

.var-field:focus,
.var-label:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.var-row.is-missing .var-field {
  border-color: #fcd34d;
  background: #fffbeb;
}

/* formatting bar under the body */

.body-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.body-tools-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--c-line);
  border-radius: 9px;
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.tool-btn:hover {
  background: #f1f5f9;
}

.tool-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  z-index: 6;
  padding: 8px;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}

.emoji-menu {
  left: 0;
  display: grid;
  grid-template-columns: repeat(8, 34px);
  gap: 2px;
}

.emoji-menu button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 18px;
  cursor: pointer;
}

.emoji-menu button:hover {
  background: #f1f5f9;
}

.var-menu {
  right: 0;
  width: 250px;
}

.var-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--c-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.var-menu button small {
  display: block;
  color: var(--c-muted);
  font-size: 11px;
  font-weight: 400;
}

.var-menu button:hover {
  background: #f1f5f9;
}

.var-menu button[data-field='custom'] {
  margin-top: 4px;
  border-top: 1px solid var(--c-line);
  border-radius: 0 0 9px 9px;
}

/* template library */

.console .library-card {
  width: min(980px, 100%);
  max-height: 88vh;
}

.library-card .card-head p {
  margin: 4px 0 0;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.library-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--c-line);
  border-radius: 16px;
}

.library-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.library-item h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}

.library-item .hint {
  margin: -4px 0 0;
}

.library-bubble {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  background: #efeae2;
  font-size: 12px;
  line-height: 1.6;
  color: #111b21;
}

.library-reply {
  display: block;
  margin-top: 6px;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
  color: #027eb5;
  text-align: center;
  font-weight: 500;
}

.var-row.is-missing .var-input input {
  border-color: #fcd34d;
  background: #fffbeb;
}

/* ---------- template editor: phone preview ---------- */

.tpl-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.tpl-preview {
  position: sticky;
  top: calc(var(--appbar-h) + 18px);
}

.preview-label {
  margin: 0 0 12px;
  text-align: center;
  color: var(--c-text);
  font-size: 13px;
  font-weight: 600;
}

.wa-phone {
  width: auto;
  height: min(720px, calc(100vh - var(--appbar-h) - 80px));
  min-height: 560px;
  max-width: 100%;
  aspect-ratio: 9 / 18.6;
  margin: 0 auto;
  padding: 11px;
  border-radius: 54px;
  background: linear-gradient(145deg, #2a2d33, #0b0c0e);
  box-shadow:
    inset 0 0 0 1.5px #3a3d44,
    inset 0 0 0 4px #0b0c0e,
    0 30px 60px rgba(15, 23, 42, 0.28),
    0 8px 18px rgba(15, 23, 42, 0.18);
}

.wa-phone-screen {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 44px;
  background: #efeae2;
}

.wa-phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 6px 26px 0 30px;
  background: #008069;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.wa-phone-island {
  width: 92px;
  height: 26px;
  border-radius: 999px;
  background: #0b0c0e;
}

.wa-phone-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.wa-phone-icons svg:nth-child(1) {
  width: 16px;
  height: 11px;
}

.wa-phone-icons svg:nth-child(2) {
  width: 15px;
  height: 11px;
}

.wa-phone-icons svg:nth-child(3) {
  width: 23px;
  height: 11px;
}

.wa-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px 6px;
  background: #008069;
  color: #fff;
  flex-shrink: 0;
}

.wa-head > svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.wa-head > svg:first-child {
  width: 24px;
  height: 24px;
}

.wa-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #dfe5e7;
  color: #54656f;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.wa-who {
  flex: 1;
  min-width: 0;
}

.wa-who strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.wa-who small {
  font-size: 11px;
  opacity: 0.85;
}

.wa-chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 16px;
  scrollbar-width: none;
  background-color: #efeae2;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.035) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 70%, rgba(0, 0, 0, 0.03) 0 3px, transparent 4px),
    radial-gradient(circle at 80% 20%, rgba(0, 0, 0, 0.025) 0 1.5px, transparent 2.5px);
  background-size: 46px 46px, 64px 64px, 38px 38px;
}

.wa-chat::-webkit-scrollbar {
  display: none;
}

.wa-day {
  width: fit-content;
  margin: 0 auto 10px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #fff;
  color: #54656f;
  font-size: 11px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.wa-encrypted {
  margin: 0 8px 14px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #ffeecd;
  color: #54656f;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.45;
}

.wa-bubble {
  position: relative;
  max-width: 88%;
  padding: 4px 4px 0;
  border-radius: 0 10px 10px 10px;
  background: #fff;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  color: #111b21;
  font-size: 13.5px;
}

.wa-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  border-top: 9px solid #fff;
  border-left: 9px solid transparent;
}

.wa-media {
  height: 150px;
  margin-bottom: 4px;
  border-radius: 7px;
  overflow: hidden;
  background: #e9edef;
  color: #8696a0;
  display: grid;
  place-items: center;
  font-size: 11.5px;
}

.wa-media.has-media {
  background: #d1d7db;
}

.wa-media img,
.wa-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wa-media svg {
  width: 32px;
  height: 32px;
}

.pv-media-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pv-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 0 12px;
  background: #f0f2f5;
  color: #111b21;
  text-align: left;
  font-size: 12px;
  word-break: break-all;
}

.pv-doc b {
  flex-shrink: 0;
  padding: 8px 6px;
  border-radius: 6px;
  background: #e53935;
  color: #fff;
  font-size: 9.5px;
}

.wa-media:has(.pv-doc) {
  height: 64px;
}

.wa-title {
  margin: 4px 6px 2px;
  font-weight: 700;
  line-height: 1.4;
}

.wa-text {
  margin: 4px 6px 0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.wa-text.is-placeholder {
  color: #8696a0;
}

.wa-footer {
  margin: 4px 6px 0;
  color: #667781;
  font-size: 12px;
}

.wa-time {
  display: block;
  padding: 2px 6px 5px;
  text-align: right;
  color: #667781;
  font-size: 10.5px;
}

.pv-var {
  padding: 0 2px;
  border-radius: 4px;
  background: #d9fdd3;
  color: #0b6b3a;
  font-weight: 500;
}

.pv-var.is-raw {
  background: #dbeafe;
  color: #1e40af;
}

.wa-buttons:empty {
  display: none;
}

.wa-buttons {
  margin: 0 -4px;
}

.wa-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border-top: 1px solid #e9edef;
  color: #027eb5;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
}

.wa-button svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.wa-input {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px 24px;
  background: #efeae2;
  flex-shrink: 0;
}

.wa-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: #fff;
  color: #8696a0;
  font-size: 13.5px;
}

.wa-field svg {
  width: 20px;
  height: 20px;
}

.wa-mic {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  display: grid;
  place-items: center;
}

.wa-mic svg {
  width: 19px;
  height: 19px;
}

.wa-phone-home {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 120px;
  height: 4.5px;
  border-radius: 999px;
  background: #111;
  transform: translateX(-50%);
}

@media (max-width: 1100px) {
  .tpl-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tpl-preview {
    position: static;
  }

  .wa-phone {
    width: min(340px, 100%);
    height: auto;
    min-height: 0;
  }
}

/* ---------- toasts & confirm dialog ---------- */

.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #16a34a;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  animation: toast-in 0.2s ease;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.toast-error {
  background: #dc2626;
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  animation: fade 0.15s ease;
}

.dialog {
  width: min(400px, 100%);
  padding: 26px 24px 22px;
  border-radius: 20px;
  background: var(--c-surface);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.dialog-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid #fcd9a8;
  color: #f59e0b;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 600;
}

.dialog-icon.is-danger {
  border-color: #fecaca;
  color: #ef4444;
}

.dialog h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.dialog p {
  margin: 0 0 20px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.55;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.btn-danger-solid {
  background: #dc2626;
  color: #fff;
  font-weight: 600;
}

.btn-danger-solid:hover {
  background: #b91c1c;
}

/* ---------- switch ---------- */

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
  pointer-events: none;
}

.switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}

.switch input:checked + i {
  background: var(--c-wa);
}

.switch input:checked + i::after {
  transform: translateX(18px);
}

.switch input:focus-visible + i {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 41px;
  font-size: 12.5px;
}

/* ---------- automations list ---------- */

.auto-list.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.console .auto-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.console .auto-card.is-off {
  opacity: 1;
}

.auto-card.is-off .auto-icon {
  background: #f1f5f9;
  color: var(--c-muted);
}

.auto-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.auto-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  display: grid;
  place-items: center;
}

.auto-icon svg {
  width: 19px;
  height: 19px;
}

.auto-top h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
}

.auto-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.console .chip-trigger {
  background: #f3edff;
  color: #6d28d9;
}

.auto-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--c-muted);
  font-size: 11.5px;
}

.auto-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.auto-stats svg {
  width: 14px;
  height: 14px;
}

.console .auto-card .auto-summary,
.console .auto-card .auto-desc {
  margin: 0;
}

.auto-foot {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.auto-foot .btn-primary {
  flex: 1;
}

.auto-foot .btn svg {
  width: 16px;
  height: 16px;
}

.console .auto-foot .icon-btn {
  width: 38px;
  height: 38px;
}

/* ---------- builder header fields ---------- */

.console .builder-bar {
  margin-bottom: 14px;
}

.console .builder-meta {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.8fr) minmax(200px, 2fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px 18px;
}

.builder-meta #b-trigger {
  background: #f8fafc;
  color: var(--c-text);
  cursor: default;
}

@media (max-width: 1000px) {
  .console .builder-meta {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ---------- inspector bits ---------- */

.inspector-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 11px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 11.5px;
  line-height: 1.55;
}

.inspector-note.is-purple {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

.delay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.delay-total {
  margin: 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #155e75;
  font-size: 12px;
}

.console .field small.ok-note {
  color: #15803d;
}

.mini-product {
  display: grid;
  place-items: center;
  height: 90px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #6d28d9;
  font-size: 11.5px;
  font-weight: 600;
}

.node-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}

.node-badges span {
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 9.5px;
  font-weight: 500;
}

.node-badges .is-product {
  background: #7c3aed;
  color: #fff;
}

.node-badges .is-ok {
  background: #dcfce7;
  color: #15803d;
}

.node-badges .is-draft {
  background: #fef3c7;
  color: #92400e;
  text-transform: capitalize;
}

.badge-no_answer {
  background: #ffedd5;
  color: #c2410c;
}

/* ---------- assign user ---------- */

.icon-assign {
  background: #8b5cf6;
  font-size: 12px;
}

.node-assign .node-head {
  background: #8b5cf6;
}

.node-agent {
  display: flex;
  align-items: center;
  gap: 7px;
}

.agent-dot {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #ede9fe;
  color: #6d28d9;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}

.agent-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 500;
}

/* ---------- run history ---------- */

.drawer.drawer-wide {
  width: min(560px, 100%);
}

.drawer-head small {
  display: block;
  margin-top: 2px;
}

.console .drawer-head .icon-btn + .icon-btn {
  margin-left: 0;
}

.run {
  margin-bottom: 10px;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  background: var(--c-surface);
  overflow: hidden;
}

.run[open] {
  box-shadow: var(--shadow-sm);
}

.run > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
}

.run > summary::-webkit-details-marker {
  display: none;
}

.run > summary:hover {
  background: #f8fafc;
}

.run-status {
  flex-shrink: 0;
  min-width: 64px;
  padding: 4px 9px;
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}

.run-status.is-running {
  background: var(--c-primary-soft);
  color: var(--c-primary-600);
}

.run-status.is-waiting {
  background: #fef3c7;
  color: #92400e;
}

.run-status.is-done {
  background: #dcfce7;
  color: #15803d;
}

.run-status.is-failed {
  background: #fee2e2;
  color: #b91c1c;
}

.run-who {
  flex: 1;
  min-width: 0;
}

.run-who strong,
.run-who small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-who strong {
  font-size: 13px;
  font-weight: 600;
}

.run-who small {
  color: var(--c-muted);
  font-size: 11.5px;
}

.run > summary time {
  flex-shrink: 0;
  color: var(--c-muted);
  font-size: 11.5px;
}

.run-steps {
  list-style: none;
  margin: 0;
  padding: 4px 14px 14px;
  border-top: 1px solid var(--c-line);
}

.run-steps li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--c-text);
}

.run-steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 12.5px;
  top: 34px;
  bottom: -4px;
  width: 1px;
  background: var(--c-line);
}

.run-steps li > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
}

.run-step-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.run-steps li.is-bad .run-step-icon {
  background: #fee2e2;
}

.run-steps li.is-bad {
  color: #b91c1c;
}

.run-steps time {
  flex-shrink: 0;
  padding-top: 4px;
  color: #94a3b8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ---------- team page ---------- */

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.member-empty {
  grid-column: 1 / -1;
}

.console .member-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.member-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar.avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.member-name {
  flex: 1;
  min-width: 0;
}

.member-name h3 {
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 600;
}

.member-name small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--c-muted);
  font-size: 11.5px;
}

.member-name small svg {
  width: 13px;
  height: 13px;
}

.member-contacts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--c-line);
  font-size: 12.5px;
  color: var(--c-muted);
}

.member-contacts a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-contacts a:hover {
  color: var(--c-primary);
}

.member-contacts svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--c-muted);
}

/* ---------- automation builder: send-message node ---------- */

.console .seg-full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 16px;
}

.node-tpl {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  font-size: 11.5px;
}

.node-tpl b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-tpl .cat-badge {
  padding: 2px 7px;
  font-size: 9.5px;
}

.node-thumb {
  display: block;
  width: 100%;
  height: 70px;
  margin-bottom: 6px;
  border-radius: 8px;
  object-fit: cover;
}

.mini-bubble {
  padding: 6px;
  border-radius: 12px;
  background: #efeae2;
}

.mini-bubble img {
  display: block;
  width: 100%;
  height: 110px;
  border-radius: 8px 8px 0 0;
  object-fit: cover;
}

.mini-bubble p {
  margin: 0;
  padding: 8px 10px;
  border-radius: 0 0 8px 8px;
  background: #fff;
  font-size: 12px;
  line-height: 1.55;
  color: #111b21;
}

.mini-bubble img + p {
  border-radius: 0 0 8px 8px;
}

.mini-bubble p:first-child {
  border-radius: 8px;
}

.mini-reply {
  display: block;
  margin-top: 4px;
  padding: 7px;
  border-radius: 8px;
  background: #fff;
  color: #027eb5;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
}

.status-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: #fffbeb;
  color: #92400e;
  font-size: 11.5px;
  line-height: 1.55;
}

.status-note b {
  text-transform: capitalize;
}

.status-note.is-ok {
  background: #ecfdf3;
  color: #166534;
}

.var-map-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 10px;
}

.var-map-row .var-tag {
  min-width: 44px;
  padding: 6px 8px;
  font-size: 11px;
}

.var-map-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}

.var-map-row select {
  grid-column: 1 / -1;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: var(--c-surface);
  color: var(--c-ink);
  font: inherit;
  font-size: 12px;
}

/* ---------- apps page ---------- */

.apps-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.console .app-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.app-stat-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 13px;
  display: grid;
  place-items: center;
}

.app-stat-icon svg {
  width: 21px;
  height: 21px;
}

.app-stat strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.app-stat small {
  color: var(--c-muted);
  font-size: 12px;
}

.apps-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.cat-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-filter button {
  padding: 7px 13px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.cat-filter button.is-on {
  border-color: var(--c-ink);
  background: var(--c-ink);
  color: #fff;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.console .app-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.console .app-card:not(.is-soon):not(.app-request):hover {
  transform: translateY(-2px);
  border-color: #d5deeb;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.console .app-card.is-connected {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f5fdf8 0%, var(--c-surface) 45%);
}

.app-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.app-logo {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.app-logo svg {
  width: 26px;
  height: 26px;
}

.app-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.app-status.is-available {
  background: var(--c-primary-soft);
  color: var(--c-primary-600);
}

.app-status.is-connected {
  background: #dcfce7;
  color: #15803d;
}

.app-status.is-connected::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-wa);
  animation: pulse 1.8s ease-out infinite;
}

.app-status.is-soon {
  background: #fef3c7;
  color: #a16207;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  }
  100% {
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
}

.app-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.app-card p {
  margin: 0;
  color: var(--c-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--c-line);
}

.app-meta {
  color: var(--c-muted);
  font-size: 11.5px;
}

.app-card.is-soon .app-logo {
  filter: grayscale(0.35);
  opacity: 0.8;
}

.console .app-card .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.console .app-request {
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.5px dashed #cbd5e1;
  background: transparent;
  box-shadow: none;
}

.app-request .app-logo {
  background: var(--c-primary-soft);
  color: var(--c-primary);
}

.apps-empty {
  grid-column: 1 / -1;
  padding: 30px;
  text-align: center;
  color: var(--c-muted);
}

/* ---------- drawer (app setup) ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.42);
  animation: fade 0.18s ease;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.18);
  animation: slide-in 0.22s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes slide-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--c-line);
}

.drawer-head h2 {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 600;
}

.drawer-head .icon-btn {
  margin-left: auto;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.drawer-body > p {
  margin: 0 0 16px;
  color: var(--c-text);
  font-size: 13px;
  line-height: 1.65;
}

.drawer-body h3 {
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 600;
}

.perks {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perks li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text);
}

.perks svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--c-wa);
}

.setup-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.setup-steps > li {
  position: relative;
  counter-increment: step;
  padding: 0 0 20px 42px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--c-text);
}

.setup-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-primary-soft);
  color: var(--c-primary-600);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.setup-steps > li::after {
  content: '';
  position: absolute;
  left: 13.5px;
  top: 30px;
  bottom: 4px;
  width: 1px;
  background: var(--c-line);
}

.setup-steps > li:last-child::after {
  display: none;
}

.setup-steps strong {
  color: var(--c-ink);
  font-weight: 600;
}

.copy-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--c-line);
  border-radius: 11px;
  background: #f8fafc;
}

.copy-field code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 11.5px;
  color: var(--c-ink);
}

.console .copy-field .btn {
  padding: 6px 11px;
  font-size: 11.5px;
}

.activity-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  font-size: 12.5px;
  color: var(--c-text);
}

.activity-box strong {
  display: block;
  color: var(--c-ink);
  font-size: 13px;
}

.activity-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f59e0b;
}

.activity-box.is-live .activity-dot {
  background: var(--c-wa);
  animation: pulse 1.8s ease-out infinite;
}

.drawer-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-top: 1px solid var(--c-line);
}

/* ---------- console responsive ---------- */

@media (max-width: 1100px) {
  .choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .app.side-open .sidebar {
    transform: none;
    box-shadow: 20px 0 50px rgba(15, 23, 42, 0.25);
  }

  .app.side-open .side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, 0.45);
  }

  .appbar {
    gap: 10px;
    padding: 0 16px;
  }

  .crumbs a,
  .crumbs > svg:first-of-type,
  .user-meta,
  .user-chevron {
    display: none;
  }

  .user-btn {
    padding: 3px;
  }

  .main {
    padding: 20px 16px 30px;
  }

  .apps-stats,
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .wa-pill span,
  .crumbs {
    display: none;
  }

  .wa-pill {
    padding: 11px;
  }
}

/* ---------- chatbots ---------- */

.icon-image { background: #0ea5e9; }
.icon-video { background: #e11d48; }
.icon-audio { background: #0d9488; }
.icon-tag { background: #db2777; font-weight: 700; }

.node-image .node-head { background: #0ea5e9; }
.node-video .node-head { background: #e11d48; }
.node-audio .node-head { background: #0d9488; }
.node-tag .node-head { background: #db2777; }

.node-file {
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: none;
}

.node-file svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #0d9488;
}

.node-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

video.node-thumb {
  background: #0f172a;
}

.kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.kw-chip.is-more {
  border-color: var(--c-line);
  background: #f8fafc;
  color: var(--c-muted);
}

.kw-chip.is-edit {
  padding-right: 4px;
  font-size: 12.5px;
}

.kw-chip button,
.tag-pill button {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(91, 33, 182, 0.1);
  color: inherit;
  font-size: 9px;
  cursor: pointer;
}

.kw-chip button:hover,
.tag-pill button:hover {
  background: rgba(225, 29, 72, 0.15);
  color: #be123c;
}

.kw-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.kw-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* upload box inside the inspector */

.bot-drop {
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.bot-drop.is-over {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}

.bot-drop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 20px 12px;
  border: 0;
  background: transparent;
  color: var(--c-muted);
  font: inherit;
  cursor: pointer;
}

.bot-drop-empty svg {
  width: 26px;
  height: 26px;
  color: var(--c-primary);
}

.bot-drop-empty b {
  color: var(--c-ink);
  font-size: 13px;
  font-weight: 600;
}

.bot-drop-empty small {
  font-size: 11px;
}

.bot-drop-busy {
  display: grid;
  gap: 9px;
  padding: 18px 14px;
  font-size: 12px;
  color: var(--c-text);
}

.bot-drop-busy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-bar {
  height: 6px;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}

.bot-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--c-primary);
  transition: width 0.15s;
}

.bot-drop-full img,
.bot-drop-full video {
  display: block;
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  background: #0f172a;
}

.bot-drop-full audio {
  display: block;
  width: calc(100% - 16px);
  margin: 10px 8px 0;
}

.bot-drop-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
}

.bot-drop-actions span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--c-muted);
}

.bot-drop-actions .btn {
  padding: 6px 11px;
  font-size: 12px;
}

.form-error {
  color: #be123c;
}

.form-error:empty {
  display: none;
}

/* chat statuses, shared by the builder and the Contacts page */

.chat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.chat-open { background-color: #e0f2fe; color: #0369a1; }
.chat-pending { background-color: #fef3c7; color: #b45309; }
.chat-confirmed { background-color: #dcfce7; color: #15803d; }
.chat-solved { background-color: #ccfbf1; color: #0f766e; }
.chat-blacklist { background-color: #1e293b; color: #f8fafc; }
.chat-call_later { background-color: #ede9fe; color: #6d28d9; }
.chat-cancelled { background-color: #ffe4e6; color: #be123c; }
.chat-closed { background-color: #e2e8f0; color: #475569; }

.status-grid,
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.status-grid .chat-badge {
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.55;
}

.status-grid .chat-badge.is-on {
  opacity: 1;
  border-color: currentColor;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid #fbcfe8;
  border-radius: 999px;
  background: #fdf2f8;
  color: #be185d;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-pill:has(button) {
  padding-right: 3px;
}

.tag-grid .tag-pill {
  padding: 6px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tag-grid .tag-pill.is-on {
  border-color: #db2777;
  background: #db2777;
  color: #fff;
}

.node-tagrow {
  text-transform: none;
}

/* ---------- contacts page ---------- */

.status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.strip-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--c-line);
  border-radius: 13px;
  background: var(--c-surface);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.strip-card b {
  color: var(--c-ink);
  font-size: 17px;
}

.strip-card:hover {
  border-color: #cbd5e1;
}

.strip-card.is-on {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ct-filters {
  display: flex;
  gap: 8px;
}

.ct-filters select {
  padding: 9px 12px;
  border: 1px solid var(--c-line);
  border-radius: 11px;
  background: #f8fafc;
  color: var(--c-ink);
  font: inherit;
  font-size: 13px;
}

.ct-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 180px;
}

.ct-cell strong {
  display: block;
  color: var(--c-ink);
}

.ct-cell small {
  display: block;
  color: var(--c-muted);
  direction: ltr;
}

.ct-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), #60a5fa);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}

.ct-status-select {
  padding: 5px 26px 5px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.ct-status-select option {
  background: #fff;
  color: var(--c-ink);
}

.ct-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 160px;
}

.tag-add {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 50%;
  background: transparent;
  color: var(--c-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.tag-add:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.tag-input {
  width: 110px;
  padding: 4px 9px;
  border: 1px solid var(--c-primary);
  border-radius: 999px;
  outline: none;
  font: inherit;
  font-size: 12px;
}

.ct-source,
.ct-last {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text);
}

.ct-source {
  max-width: 200px;
  color: var(--c-muted);
}

@media (max-width: 700px) {
  .ct-filters {
    width: 100%;
  }

  .ct-filters select {
    flex: 1;
    min-width: 0;
  }
}
