/* ═══════════════════════════════════════════════════════════════
   WA Gateway — Professional UI Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── Brand Tokens ─────────────────────────────────────────────── */
:root {
  --primary: oklch(0.596 0.145 163.225);
  --primary-foreground: oklch(0.985 0.002 247.858);
  --ring: oklch(0.596 0.145 163.225);
  --sidebar-primary: oklch(0.596 0.145 163.225);
  --sidebar-ring: oklch(0.596 0.145 163.225);

  --wagw-success: oklch(0.62 0.17 145);
  --wagw-warn: oklch(0.75 0.15 75);
  --wagw-danger: oklch(0.58 0.2 25);
  --wagw-info: oklch(0.62 0.14 230);

  --wagw-radius-lg: calc(var(--radius) + 4px);
  --wagw-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04), 0 1px 3px rgb(0 0 0 / 0.06);
  --wagw-shadow-md: 0 4px 12px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.04);
  --wagw-shadow-lg: 0 8px 30px rgb(0 0 0 / 0.08);
}

html.dark {
  --primary: oklch(0.696 0.17 162.48);
  --ring: oklch(0.696 0.17 162.48);
  --sidebar-primary: oklch(0.696 0.17 162.48);
  --wagw-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.2);
  --wagw-shadow-md: 0 4px 12px rgb(0 0 0 / 0.25);
  --wagw-shadow-lg: 0 8px 30px rgb(0 0 0 / 0.35);
}

/* ── Sidebar Enhancements ─────────────────────────────────────── */
.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}
.app-sidebar-brand::before {
  content: "";
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--primary), oklch(0.52 0.12 163));
  flex-shrink: 0;
  box-shadow: 0 2px 8px oklch(0.596 0.145 163.225 / 0.35);
}
.app-sidebar-brand .accent { color: var(--primary); font-weight: 700; }

.nav-link {
  border-radius: calc(var(--radius) - 2px);
  transition: background 0.15s, color 0.15s;
}
.nav-link.active {
  background: oklch(from var(--primary) l c h / 0.12);
  color: var(--primary);
  font-weight: 600;
}
.nav-link.active .nav-icon { color: var(--primary); }

.app-sidebar-nav { padding-bottom: 1.5rem; }

/* ── Topbar ───────────────────────────────────────────────────── */
.app-topbar-title { display: none; }
.app-content { max-width: 80rem; margin-inline: auto; width: 100%; }

/* ── Page Hero ────────────────────────────────────────────────── */
.page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-hero-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}
.page-hero-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--foreground);
}
.page-hero-desc {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  max-width: 36rem;
}
.page-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Info Tips ────────────────────────────────────────────────── */
.info-tip {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--wagw-radius-lg);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
}
.info-tip-icon {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.1rem;
}
.info-tip-icon .nav-icon { width: 100%; height: 100%; }
.info-tip-body { flex: 1; min-width: 0; }
.info-tip-body strong { font-weight: 600; }
.info-tip--primary {
  background: oklch(from var(--primary) l c h / 0.08);
  border-color: oklch(from var(--primary) l c h / 0.18);
  color: var(--foreground);
}
.info-tip--primary .info-tip-icon { color: var(--primary); }
.info-tip--warn {
  background: oklch(from var(--wagw-warn) l c h / 0.1);
  border-color: oklch(from var(--wagw-warn) l c h / 0.25);
}
.info-tip--warn .info-tip-icon { color: var(--wagw-warn); }
.info-tip--neutral {
  background: var(--muted);
  border-color: var(--border);
  color: var(--muted-foreground);
}
.info-tip--neutral .info-tip-icon { color: var(--muted-foreground); }

/* ── KPI Cards ────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.kpi-card {
  position: relative;
  padding: 1rem 1.125rem;
  border-radius: var(--wagw-radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--wagw-shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.kpi-card:hover {
  box-shadow: var(--wagw-shadow-md);
  border-color: oklch(from var(--primary) l c h / 0.2);
}
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--primary));
  opacity: 0.85;
}
.kpi-card--success { --kpi-accent: var(--wagw-success); }
.kpi-card--warn { --kpi-accent: var(--wagw-warn); }
.kpi-card--danger { --kpi-accent: var(--wagw-danger); }
.kpi-card--info { --kpi-accent: var(--wagw-info); }

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  letter-spacing: 0.01em;
}
.kpi-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(from var(--kpi-accent, var(--primary)) l c h / 0.12);
  color: var(--kpi-accent, var(--primary));
}
.kpi-icon .nav-icon { width: 0.9375rem; height: 0.9375rem; }
.kpi-value {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--foreground);
}
.kpi-value--sm { font-size: 1.125rem; }
.kpi-meta {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.kpi-bar {
  margin-top: 0.625rem;
  height: 4px;
  border-radius: 2px;
  background: var(--muted);
  overflow: hidden;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--kpi-accent, var(--primary));
  transition: width 0.4s ease;
}

/* ── Section Cards ────────────────────────────────────────────── */
.section-card {
  border-radius: var(--wagw-radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--wagw-shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.section-card:last-child { margin-bottom: 0; }
.section-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.section-card-head-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}
.section-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: oklch(from var(--primary) l c h / 0.1);
  color: var(--primary);
}
.section-card-icon .nav-icon { width: 1.125rem; height: 1.125rem; }
.section-card-icon--warn {
  background: oklch(from var(--wagw-warn) l c h / 0.12);
  color: var(--wagw-warn);
}
.section-card-icon--info {
  background: oklch(from var(--wagw-info) l c h / 0.12);
  color: var(--wagw-info);
}
.section-card-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--foreground);
}
.section-card-desc {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.45;
}
.section-card-body { padding: 1.25rem; }
.section-card-body--flush { padding: 0; }
.section-card-body--flush .table-wrap { border: none; border-radius: 0; }

/* ── Layout Grids ─────────────────────────────────────────────── */
.layout-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.layout-split--wide-left { grid-template-columns: 1.2fr 0.8fr; }
.layout-stack { display: flex; flex-direction: column; gap: 1.25rem; }

/* ── Status Pill ──────────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.status-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: wagw-pulse 2s ease infinite;
}
.status-pill--online {
  background: oklch(from var(--wagw-success) l c h / 0.12);
  color: var(--wagw-success);
  border-color: oklch(from var(--wagw-success) l c h / 0.25);
}
.status-pill--offline {
  background: oklch(from var(--wagw-danger) l c h / 0.1);
  color: var(--wagw-danger);
  border-color: oklch(from var(--wagw-danger) l c h / 0.2);
}
.status-pill--pairing {
  background: oklch(from var(--wagw-warn) l c h / 0.12);
  color: var(--wagw-warn);
  border-color: oklch(from var(--wagw-warn) l c h / 0.25);
}
@keyframes wagw-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Field Hints ──────────────────────────────────────────────── */
.field-hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}
.field-hint code {
  font-size: 0.6875rem;
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: var(--muted);
  font-family: ui-monospace, monospace;
}

/* ── Copy Box ─────────────────────────────────────────────────── */
.copy-box {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.copy-box code {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  word-break: break-all;
  font-family: ui-monospace, monospace;
  color: var(--foreground);
}

/* ── Live Feed ────────────────────────────────────────────────── */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 22rem;
  overflow-y: auto;
}
.feed-item {
  display: flex;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
}
.feed-item-type {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.feed-item-time {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}
.feed-item pre {
  margin: 0.25rem 0 0;
  font-size: 0.6875rem;
  white-space: pre-wrap;
  color: var(--muted-foreground);
  font-family: ui-monospace, monospace;
}
.feed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  gap: 0.5rem;
}
.feed-empty-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
}
.feed-empty-icon .nav-icon { width: 1.25rem; height: 1.25rem; }

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}
.empty-state-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: oklch(from var(--primary) l c h / 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
}
.empty-state-icon .nav-icon { width: 1.5rem; height: 1.5rem; }
.empty-state-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--foreground);
}
.empty-state-desc {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  max-width: 20rem;
  line-height: 1.5;
}

/* ── QR Pairing ───────────────────────────────────────────────── */
.qr-pairing-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}
.qr-pairing-canvas {
  padding: 1.25rem;
  border-radius: var(--wagw-radius-lg);
  background: #fff;
  border: 2px solid var(--border);
  box-shadow: var(--wagw-shadow-lg);
}
.qr-pairing-canvas img,
.qr-pairing-canvas canvas { display: block; border-radius: 0.25rem; }
.qr-pairing-steps {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.qr-pairing-steps li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  padding: 0.375rem 0.625rem;
  border-radius: 999px;
  background: var(--muted);
  border: 1px solid var(--border);
}
.qr-pairing-steps li span {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Quick Links ──────────────────────────────────────────────── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--wagw-radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none;
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.quick-link:hover {
  border-color: oklch(from var(--primary) l c h / 0.3);
  box-shadow: var(--wagw-shadow-sm);
  background: oklch(from var(--primary) l c h / 0.04);
}
.quick-link-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(from var(--primary) l c h / 0.1);
  color: var(--primary);
  flex-shrink: 0;
}
.quick-link-icon .nav-icon { width: 0.875rem; height: 0.875rem; }
.quick-link-text { line-height: 1.3; }
.quick-link-text small {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--muted-foreground);
  margin-top: 0.1rem;
}

/* ── Result Box ───────────────────────────────────────────────── */
.result-box {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  overflow: auto;
  max-height: 10rem;
  white-space: pre-wrap;
  color: var(--foreground);
}

/* ── Legend Row ───────────────────────────────────────────────── */
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ── Login Page ─────────────────────────────────────────────────── */
.login-brand {
  background: linear-gradient(160deg, oklch(0.38 0.1 163) 0%, oklch(0.32 0.08 200) 100%);
}
.login-brand-content h1 {
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.login-features li {
  backdrop-filter: blur(4px);
  background: rgb(255 255 255 / 0.06);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.375rem;
}
.login-intro h2 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.login-card {
  border: 1px solid var(--border);
  box-shadow: var(--wagw-shadow-md);
}
.login-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.75rem;
}
.login-footer-note::before {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0.5;
}

/* ── Form Grid ────────────────────────────────────────────────── */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Table Enhancements ───────────────────────────────────────── */
.section-card-body--flush .ui-table thead th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  font-weight: 600;
}
.section-card-body--flush .ui-table tbody td {
  font-size: 0.8125rem;
  vertical-align: middle;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
  .layout-split { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr; }
  .page-hero-title { font-size: 1.25rem; }
  .kpi-value { font-size: 1.375rem; }
}

/* ── API Clients grid & dialog ─────────────────────────────────── */
.mono-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 0.15rem 0.45rem;
  border-radius: 0.375rem;
  background: color-mix(in oklch, var(--muted) 80%, transparent);
  color: var(--foreground);
}
.cell-truncate {
  display: block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.text-muted-sm {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.ui-label .req {
  color: var(--accent-red, #ef4444);
}
.api-key-reveal {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid color-mix(in oklch, var(--accent-warn, #f59e0b) 35%, var(--border));
  background: color-mix(in oklch, var(--accent-warn, #f59e0b) 8%, var(--card));
}
.api-key-reveal code {
  flex: 1;
  font-size: 0.8125rem;
  word-break: break-all;
  line-height: 1.45;
}
.attachment-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 40%, transparent);
  font-size: 0.8125rem;
}
.section-card-body--flush .data-grid-shell.is-embedded {
  border: none;
  border-radius: 0;
}
.section-card-body--flush .data-grid-toolbar {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}
.ui-dialog.is-danger {
  max-width: 28rem;
}
.ui-dialog.is-danger .ui-dialog-header {
  background: linear-gradient(180deg, color-mix(in oklch, var(--accent-red, #ef4444) 10%, transparent), transparent 70%);
}

/* Data grid — status & message cells */
.cell-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  border: 1px solid transparent;
}
.cell-status--sent,
.cell-status--delivered,
.cell-status--read {
  color: #047857;
  background: color-mix(in oklch, #10b981 14%, transparent);
  border-color: color-mix(in oklch, #10b981 28%, transparent);
}
.cell-status--queued {
  color: #475569;
  background: color-mix(in oklch, var(--muted) 70%, transparent);
  border-color: var(--border);
}
.cell-status--delayed {
  color: #b45309;
  background: color-mix(in oklch, #f59e0b 14%, transparent);
  border-color: color-mix(in oklch, #f59e0b 28%, transparent);
}
.cell-status--failed,
.cell-status--rejected {
  color: #b91c1c;
  background: color-mix(in oklch, #ef4444 12%, transparent);
  border-color: color-mix(in oklch, #ef4444 26%, transparent);
}
.cell-status--simulated,
.cell-status--simulated_delayed,
.cell-status--cancelled {
  color: var(--muted-foreground);
  background: color-mix(in oklch, var(--muted) 55%, transparent);
  border-color: var(--border);
}
.cell-message-preview {
  cursor: pointer;
  color: var(--foreground);
  text-decoration: underline dotted color-mix(in oklch, var(--primary) 35%, transparent);
  text-underline-offset: 0.15em;
}
.cell-message-preview:hover {
  color: var(--primary);
}
.cell-phone {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.cell-phone-name {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.3;
}
.cell-message-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.cell-message-row > span:last-child {
  min-width: 0;
}
.cell-attachment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.35rem;
  color: var(--muted-foreground);
  background: color-mix(in oklch, var(--muted) 45%, transparent);
}
.cell-attachment-icon .nav-icon {
  width: 0.875rem;
  height: 0.875rem;
}
.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.5rem;
}
.theme-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--card);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.theme-choice-btn:hover {
  border-color: color-mix(in oklch, var(--primary) 35%, var(--border));
}
.theme-choice-btn.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary) 25%, transparent);
}
.theme-choice-btn strong {
  font-size: 0.8125rem;
}
.theme-choice-btn span {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.message-full-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 0;
}

.contact-suggest-name {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Rate rules — On toggle with check icon */
.rule-status-toggle.is-on input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
.rule-status-toggle .rule-status-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: #059669;
}
.rule-status-toggle .rule-status-check svg {
  width: 0.875rem;
  height: 0.875rem;
}
.rule-status-toggle.is-on {
  border-color: color-mix(in oklch, #10b981 45%, var(--input));
  background: color-mix(in oklch, #10b981 8%, transparent);
}

/* Warmup schedule — highlight current active day */
.warmup-row--active td {
  background: color-mix(in oklch, var(--primary) 7%, var(--background));
}
.warmup-row--active td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}
