:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --sidebar-bg: #16233f;
  --sidebar-text: #c3ccdb;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-active: rgba(255, 255, 255, 0.12);
  --border: #e6e8ec;
  --text: #1f2937;
  --muted: #6b7280;
  --faint: #9ca3af;
  --brand-navy: #1f59a4;
  --primary: #1f59a4;
  --primary-hover: #184a87;
  --primary-soft: #eef2f8;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
  --offline: #dc2626;
  --online: #16a34a;
  --error: #ca8a04;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: none;
  padding: 1.25rem 0.75rem 1rem;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.2s ease, width 0.2s ease, padding 0.2s ease;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0 1.5rem;
}

.brand-logo {
  width: 150px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-signout {
  color: var(--sidebar-text);
  opacity: 0.8;
}

.nav-signout:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
  opacity: 1;
}

@media (max-width: 900px) {
  .app-shell:not(.sidebar-open) .sidebar {
    transform: translateX(-100%);
  }
}

.app-shell.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(15, 23, 42, 0.25);
}

.app-shell.sidebar-open .sidebar-backdrop {
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 1;
}

.nav-icon-photo {
  object-fit: contain;
  border-radius: 3px;
}

.nav-label {
  line-height: 1.3;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-left: 240px;
  transition: margin-left 0.2s ease;
  overflow: hidden;
}

@media (max-width: 900px) {
  .app-main {
    margin-left: 0;
  }
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  font-size: 1.25rem;
  flex-shrink: 0;
}

@media (min-width: 901px) {
  .app-shell.sidebar-open .sidebar-backdrop,
  .sidebar-backdrop {
    display: none !important;
  }

  /* Collapsed sidebar: reduce to icons only, freeing width for the content / embedded apps. */
  .app-shell.sidebar-collapsed .sidebar {
    width: 64px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .app-shell.sidebar-collapsed .app-main {
    margin-left: 64px;
  }
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .brand-logo {
    display: none;
  }
  .app-shell.sidebar-collapsed .sidebar-brand {
    padding: 0.25rem 0 0.75rem;
    min-height: 1.25rem;
  }
  .app-shell.sidebar-collapsed .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
  }
}

.view-panel.hidden {
  display: none !important;
}

/* Embedded File Browser: the iframe fills the whole central content area and only its
   own contents scroll — so it reads as a built-in app, not a scrolled-in web page. */
#view-files:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.filebrowser-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: var(--bg);
  display: block;
}
/* When the File Browser is active, stop the outer content area from scrolling/padding so the
   iframe sits flush and edge-to-edge; scrolling happens inside the File Browser itself. */
.container.viewing-files {
  overflow: hidden;
  padding: 0;
  gap: 0;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.control-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.control-label {
  white-space: nowrap;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.view-toggle-btn {
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  color: var(--muted);
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.view-toggle-btn + .view-toggle-btn {
  border-left: 1px solid var(--border);
}

.view-toggle-btn.active {
  background: var(--primary);
  color: #fff;
}

.feedback-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 56px;
}

.feedback-note {
  margin: 0.6rem 0 1rem;
  font-size: 0.85rem;
}

.feedback-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: grab;
  user-select: none;
}

.feedback-chip {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  animation: chip-pop 0.16s ease;
}

.feedback-chip:hover {
  border-color: #cbd5e1;
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

.feedback-chip:active { cursor: grabbing; }
.feedback-chip.dragging { opacity: 0.4; transform: scale(0.96); }

@keyframes chip-pop {
  from { transform: scale(0.92); opacity: 0.4; }
  to   { transform: scale(1); opacity: 1; }
}

/* Chips adopt the tone of the column they're dropped into */
.feedback-zone.worked .feedback-chip {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.feedback-zone.improve .feedback-chip {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
}

.feedback-zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
}

.feedback-zone {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.feedback-zone h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.feedback-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.feedback-zone.worked h3 { background: rgba(22, 163, 74, 0.08); }
.feedback-zone.improve h3 { background: rgba(220, 38, 38, 0.07); }
.feedback-zone.worked .feedback-dot { background: #16a34a; }
.feedback-zone.improve .feedback-dot { background: #dc2626; }

.feedback-count {
  margin-left: auto;
  min-width: 1.4rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.feedback-dropzone {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  padding: 0.85rem;
  min-height: 96px;
  transition: background 0.15s, outline 0.15s;
}

.feedback-zone.worked .feedback-dropzone { background: rgba(22, 163, 74, 0.06); }
.feedback-zone.improve .feedback-dropzone { background: rgba(220, 38, 38, 0.05); }

/* Friendly placeholder while a column is empty */
.feedback-dropzone:empty::before {
  content: attr(data-empty);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.75;
}

.feedback-dropzone.drop-hover,
.feedback-pool.drop-hover {
  outline: 2px dashed var(--primary);
  outline-offset: -4px;
}

.feedback-actions {
  margin-top: 1rem;
}

.feedback-add {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0 0.25rem;
}

.feedback-add-input {
  flex: 1;
  max-width: 320px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
}

.feedback-add-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* User-added bubbles are visually distinct (dashed accent) from seeded ones. */
.feedback-chip.custom {
  border-style: dashed;
  border-color: var(--primary);
}

.feedback-chip.custom::before {
  content: "+ ";
  font-weight: 700;
  color: var(--primary);
}

.feedback-zone.worked .feedback-chip.custom::before,
.feedback-zone.improve .feedback-chip.custom::before {
  color: inherit;
}

/* --- Report a Bug --- */
.bug-scope-notice {
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
  color: #7f1d1d;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.bug-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 760px;
}

.bug-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bug-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}

.bug-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.bug-label em {
  color: #dc2626;
  font-style: normal;
}

.bug-field input,
.bug-field select,
.bug-field textarea {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

.bug-field textarea {
  resize: vertical;
  min-height: 110px;
}

.bug-field input:focus,
.bug-field select:focus,
.bug-field textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.bug-actions {
  margin-top: 0.25rem;
}

.panel-help {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: auto;
}

#sessions-table {
  min-width: 960px;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table input {
  width: 100%;
  min-width: 120px;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.col-actions {
  width: 100px;
  white-space: nowrap;
}

.session-user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.session-user-name {
  font-weight: 500;
}

.session-logoff-btn {
  flex-shrink: 0;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.alert.error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--danger);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 0.75rem;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.15;
}

.company-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.company-favicon {
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}

.uptime-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: #eff6ff;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
}

.uptime-row .metric-label {
  color: #1d4ed8;
  font-weight: 600;
}

.uptime-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e3a8a;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info { font-size: 0.85rem; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.8rem; }

.container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.75rem clamp(1rem, 2vw, 2rem) 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.view-panel:not(.hidden) {
  flex-shrink: 0;
}

.home-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  align-items: start;
}

.home-panels.single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.home-panels .view-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 1.5vw, 1.5rem);
  margin: 0;
}

.home-panels .card-header {
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.home-panels .card-header h2 {
  font-size: clamp(1rem, 1.1vw, 1.2rem);
}

.home-panels .resources-body {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.75rem);
}

.home-panels .metrics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 2rem);
  margin-bottom: 0;
  align-content: center;
  padding: clamp(0.5rem, 1vw, 1rem) 0;
}

.home-panels .progress-ring {
  width: clamp(96px, 8vw, 140px);
}

.home-panels .metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home-panels .uptime-row {
  margin-bottom: 0;
  padding: 0.65rem 0.85rem;
  flex-shrink: 0;
}

.home-panels .disk-list {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  gap: 0.65rem;
  padding-right: 0;
}

.home-panels .disk-row {
  font-size: 0.85rem;
  gap: 0.55rem;
}

.home-panels .disk-bar {
  height: 10px;
}

.home-panels #view-printers-preview {
  display: flex;
  flex-direction: column;
}

.home-panels #printer-preview-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-panels #printer-preview-grid .printer-card {
  display: flex;
  flex-direction: column;
}

.home-panels #printer-preview-grid .printer-body {
  padding: 0.85rem 1rem;
}

.home-panels .metric-label {
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.home-panels .metric-value {
  font-size: clamp(1rem, 1.3vw, 1.4rem);
}

.home-panels .printer-preview-footer {
  margin-top: 0.35rem;
  padding-top: 0;
  flex-shrink: 0;
}

.home-panels .printer-meta {
  font-size: 0.78rem;
}

.overview-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.25rem 0 0.5rem;
}

.overview-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.overview-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.refresh-select-inline {
  display: inline-block;
  width: auto;
  min-width: 4.25rem;
  padding: 0.15rem 1.75rem 0.15rem 0.45rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  vertical-align: baseline;
  margin: 0 0.1rem;
}

#last-updated {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 500;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: clamp(0.6rem, 1vw, 1rem);
  margin-bottom: 0.25rem;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: clamp(0.75rem, 1.2vw, 1.15rem) clamp(0.85rem, 1.2vw, 1.25rem);
}

.stat-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.stat-value {
  margin: 0.35rem 0 0.2rem;
  font-size: clamp(1.5rem, 1.8vw, 2.1rem);
  font-weight: 700;
  line-height: 1.1;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.stat-desc {
  margin: 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

@media (min-width: 1400px) {
  .brand h1 {
    font-size: 1.45rem;
  }

  .card-header h2 {
    font-size: 1.2rem;
  }

  .data-table {
    font-size: 0.95rem;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card.narrow { max-width: 420px; text-align: center; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.hidden { display: none !important; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.metric { text-align: center; }
.metric-label { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }

.progress-ring {
  position: relative;
  width: 100px;
  margin: 0 auto;
}

.progress-ring svg { width: 100%; height: auto; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #e2e8f0; stroke-width: 3; }
.ring-fill { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.4s ease; }

.metric-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.disk-list { display: flex; flex-direction: column; gap: 0.75rem; }

.disk-row {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.disk-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.disk-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.printer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.printer-preview-footer {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding-top: 0.25rem;
}

.btn-view-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.view-more-icon {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
}

.printer-card {
  display: flex;
  flex-direction: column;
  background: #eef2f6;
  border: 1px solid #d8dee6;
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.printer-status-bar {
  display: block;
  width: 100%;
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  border-radius: 0;
  border: none;
}

.printer-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: #f8fafc;
}

.printer-header {
  display: none;
}

.printer-name { font-weight: 600; margin: 0; word-break: break-word; }

.printer-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.available-badge {
  background: rgba(22, 163, 74, 0.12);
  color: var(--online);
  flex-shrink: 0;
}

.printer-footer {
  margin-top: auto;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: #fffbeb;
}

.printer-footer.offline-footer {
  background: #fef2f2;
}

.printer-message {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}

.printer-message + .printer-message {
  margin-top: 0.4rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge.online { background: rgba(22, 163, 74, 0.12); color: var(--online); }
.badge.offline { background: rgba(220, 38, 38, 0.1); color: var(--offline); }
.badge.error { background: rgba(202, 138, 4, 0.12); color: var(--error); }
.badge.unknown { background: rgba(100, 116, 139, 0.12); color: var(--muted); }

.printer-meta { font-size: 0.8rem; color: var(--muted); margin: 0; }

.printer-card .btn-sm {
  margin-top: 0.75rem;
  align-self: flex-start;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
}

.detail-grid dt { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.15rem; }
.detail-grid dd { margin: 0; font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: #cbd5e1; background: var(--surface-2); }
.btn-warning { background: #fefce8; color: var(--warning); border: 1px solid #fde047; }
.btn-warning:hover:not(:disabled) { background: #fef9c3; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.alert.success { background: rgba(22, 163, 74, 0.1); border: 1px solid rgba(22, 163, 74, 0.25); color: #15803d; }
.alert.error { background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.25); color: var(--danger); }
.alert.info { background: var(--primary-soft); border: 1px solid rgba(31, 89, 164, 0.25); color: var(--primary); }

.terminal-id-input { text-transform: uppercase; max-width: 6rem; }

.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 1.5rem;
  max-width: 480px;
  box-shadow: var(--shadow);
}

.modal::backdrop { background: rgba(15, 23, 42, 0.35); }
.modal h3 { margin-top: 0; }
.warning-text { color: var(--warning); font-size: 0.9rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; margin: 1rem 0; font-size: 0.9rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1rem; }

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  flex-shrink: 0;
}

.footer-logo {
  max-height: 64px;
  max-width: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}

.refresh-label { color: var(--muted); font-size: 0.85rem; }

.refresh-select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
}

.refresh-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

@media (max-width: 900px) {
  .home-panels {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  body.dashboard-home .container {
    overflow-y: auto;
  }

  .topbar { flex-wrap: wrap; gap: 0.5rem; }
}

@media (max-width: 600px) {
  .overview-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-meta {
    justify-content: flex-start;
  }

  .topbar { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .admin-actions { width: 100%; }
  .admin-actions .btn { width: 100%; }
}

/* Pagination controls */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.pager.hidden { display: none; }

.pager-info {
  color: var(--muted, #64748b);
  font-size: 0.875rem;
  white-space: nowrap;
}

.pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Blocking loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.loading-overlay.hidden { display: none; }

.loading-overlay-card {
  background: var(--surface, #fff);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 240px;
  text-align: center;
}

.loading-overlay-text {
  margin: 0;
  font-weight: 600;
  color: var(--text, #1e293b);
}

/* Brand coin-flip: the Jonas disc + "J" (inline SVG, no image load) flips like a coin. */
.loading-jflip {
  width: 56px;
  height: 56px;
  perspective: 220px;
}

.jflip-coin {
  width: 100%;
  height: 100%;
  display: block;
  transform-style: preserve-3d;
  animation: j-coinflip 1.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.18));
}

/* Themeable brand color (overrides the literal fill in the markup). */
.jflip-coin circle { fill: var(--brand-navy, #1f59a4); }

@keyframes j-coinflip {
  to { transform: rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .jflip-coin { animation-duration: 3s; }
}

/* Visually-hidden label */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Brume device ping tool */
.ping-tool {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, #e2e8f0);
}

.ping-tool h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.ping-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  max-width: 420px;
}

.ping-input {
  flex: 1 1 220px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  font-size: 0.95rem;
}

.ping-input:focus {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 1px;
}

.ping-result {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.ping-result.hidden { display: none; }
.ping-result.success { color: var(--success, #16a34a); }
.ping-result.error { color: var(--danger, #dc2626); }

/* Printer search */
.printer-search-wrap { display: flex; align-items: center; }
.printer-search {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  min-width: 200px;
}
.printer-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
@media (max-width: 600px) {
  .printer-search { min-width: 0; width: 100%; }
  .printer-search-wrap { width: 100%; }
}

/* Topbar tour button */
.tour-btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.tour-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
}
@media (max-width: 600px) {
  .tour-btn-label { display: none; }
}

/* Guided tour overlay */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: auto;
}
.tour-overlay.hidden { display: none; }
.tour-overlay.tour-centered { background: rgba(15, 23, 42, 0.55); }

.tour-spotlight {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
  pointer-events: none;
  z-index: 2001;
}

.tour-popover {
  position: fixed;
  z-index: 2002;
  width: min(340px, calc(100vw - 24px));
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.32);
  padding: 1.1rem 1.2rem;
}
.tour-title { margin: 0 0 0.45rem; font-size: 1.05rem; padding-right: 1.5rem; }
.tour-body { margin: 0 0 1rem; font-size: 0.9rem; line-height: 1.55; color: var(--text); }
.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.tour-progress { font-size: 0.78rem; color: var(--muted); }
.tour-actions { display: flex; gap: 0.5rem; }
.tour-close {
  position: absolute;
  top: 0.45rem;
  right: 0.6rem;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.tour-close:hover { color: var(--text); background: var(--surface-2, #f1f5f9); }
.tour-back:disabled { opacity: 0.5; cursor: default; }

/* ── Customer Journey (WIZ-style module grid + detail drawer) ─────────────── */
.cj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.cj-head h2 { margin: 0 0 0.15rem; font-size: 1.35rem; font-weight: 600; }
.cj-head .muted { max-width: 70ch; }

.cj-overall { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1.15rem; margin-bottom: 0.75rem; }
.cj-overall-lbl { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.cj-track { flex: 1; height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cj-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #3b82f6); border-radius: 999px; transition: width 0.3s ease; }
.cj-overall-pct { font-weight: 700; color: var(--primary); }

.cj-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 0.75rem; }
@media (max-width: 700px) { .cj-modules { grid-template-columns: 1fr; } }

.cj-module { display: grid; grid-template-columns: 40px 1fr auto; gap: 0.85rem; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1rem; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .05s; }
.cj-module:hover { border-color: #c7d2e4; box-shadow: 0 4px 14px rgba(15,23,42,0.08); }
.cj-module:active { transform: translateY(1px); }
.cj-m-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.cj-m-icon svg { width: 20px; height: 20px; }
.cj-m-main { min-width: 0; }
.cj-m-name { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cj-owner { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.1rem 0.4rem; border-radius: 999px; }
.cj-owner.customer { background: var(--primary-soft); color: var(--primary); }
.cj-owner.impl { background: rgba(100,116,139,0.14); color: #475569; }
.cj-seg { display: flex; gap: 3px; margin: 0.5rem 0 0.3rem; }
.cj-seg span { height: 6px; flex: 1; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.cj-seg span.on { background: var(--primary); border-color: var(--primary); }
.cj-seg span.on.done { background: var(--success); border-color: var(--success); }
.cj-m-sub { font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 0.5rem; }
.cj-m-issues { color: var(--warning); font-weight: 600; }
.cj-m-meta { display: flex; gap: 1.1rem; align-items: center; text-align: center; }
.cj-meta-cell { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; min-width: 60px; }
.cj-dot { width: 9px; height: 9px; border-radius: 50%; display: block; }
.cj-mc-lbl { font-size: 0.66rem; color: var(--faint); white-space: nowrap; }
.cj-mc-lbl.set { color: var(--muted); font-weight: 600; }
.cj-avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.6rem; font-weight: 700; color: #fff; }
.cj-avatar.none { background: var(--surface-2); color: var(--faint); border: 1px dashed var(--border); }
@media (max-width: 900px) { .cj-m-meta { display: none; } }

.cj-st { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.cj-st-notstarted { background: rgba(100,116,139,0.14); color: #475569; }
.cj-st-running { background: var(--primary-soft); color: var(--primary); }
.cj-st-completed { background: rgba(22,163,74,0.12); color: var(--success); }
.cj-st-blocked { background: rgba(220,38,38,0.1); color: var(--danger); }

/* Drawer */
.cj-drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.cj-drawer-backdrop.open { opacity: 1; pointer-events: auto; }
/* Every stage opens as a centered modal, questionnaire or not, so the panel always shows up
   in the same place. Unlike a side drawer it can't hide itself by sliding off-screen, so it
   must be explicitly taken out of the hit-test and the tab order when closed, or it sits
   invisibly over the module grid and swallows clicks. */
.cj-drawer { position: fixed; top: 50%; left: 50%; width: min(720px, 94vw); max-height: 92vh;
  background: var(--surface); border-radius: 14px; box-shadow: 0 24px 60px rgba(15,23,42,0.28);
  z-index: 70; display: flex; flex-direction: column; overflow-y: auto;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  transition: transform .22s ease, opacity .22s ease, visibility 0s linear .22s; }
.cj-drawer.open { opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  transition: transform .22s ease, opacity .22s ease, visibility 0s; }
/* Field-heavy stages (the Questionnaire) get a wider modal so their many inputs lay out in
   columns rather than one long single-column scroll. */
.cj-drawer.cj-wide { width: min(1080px, 94vw); }
.cj-drawer.cj-wide .cj-fsection { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem 1rem; align-items: start; }
.cj-drawer.cj-wide .cj-fsection > .cj-sechead,
.cj-drawer.cj-wide .cj-fsection > .cj-tablefield,
.cj-drawer.cj-wide .cj-fsection > .cj-field-wide { grid-column: 1 / -1; }
.cj-drawer-head { display: flex; align-items: flex-start; gap: 0.85rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.cj-drawer-title { flex: 1; min-width: 0; }
.cj-drawer-title h2 { margin: 0; font-size: 1.15rem; }
.cj-drawer-title .cj-sub { font-size: 0.78rem; color: var(--muted); }
.cj-icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 0.9rem; }
.cj-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.cj-drawer-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.15rem; }
.cj-drawer-desc { font-size: 0.9rem; margin: 0; }
.cj-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; padding: 0.9rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.cj-meta-field label { display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; margin-bottom: 0.3rem; }
.cj-meta-field select, .cj-meta-field input { width: 100%; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; font-size: 0.85rem; color: var(--text); }
.cj-meta-field.readonly select, .cj-meta-field.readonly input { background: var(--surface-2); color: var(--muted); pointer-events: none; }
.cj-notes-field label { display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; margin-bottom: 0.35rem; }
.cj-notes-field textarea { width: 100%; min-height: 74px; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.88rem; resize: vertical; }
.cj-notes-field textarea[readonly] { background: var(--surface-2); color: var(--muted); }
.cj-readiness h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.cj-prog-line { font-size: 0.8rem; color: var(--muted); margin: 0 0 0.5rem; }
.cj-steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cj-step-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); }
.cj-step-row:last-child { border-bottom: none; }
.cj-step-check { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--border); display: grid; place-items: center; color: transparent; background: transparent; padding: 0; cursor: default; }
.cj-step-check.editable { cursor: pointer; }
.cj-step-row.done .cj-step-check { background: var(--success); border-color: var(--success); color: #fff; }
.cj-step-row.blocked .cj-step-check { border-color: var(--danger); }
.cj-step-check svg { width: 12px; height: 12px; }
.cj-step-name { flex: 1; font-size: 0.9rem; font-weight: 500; }
.cj-step-row.done .cj-step-name { color: var(--muted); }
.cj-step-detail { font-size: 0.8rem; color: var(--muted); text-align: right; }
.cj-edit-hint { font-size: 0.72rem; margin: 0.4rem 0 0; }
.cj-drawer-foot { margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.5rem; position: sticky; bottom: 0; background: var(--surface); }

/* ── Journey questionnaire fields (dynamic forms + grid) ──────────────────── */
.cj-fields { display: flex; flex-direction: column; gap: 1.25rem; margin: 0.25rem 0 0.5rem; }
.cj-fsection { display: flex; flex-direction: column; gap: 0.75rem; }
.cj-sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border); }
.cj-fsection h3 { margin: 0; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.cj-secclear { flex: none; }
.cj-field { display: flex; flex-direction: column; gap: 0.3rem; }
.cj-field > label { font-size: 0.72rem; font-weight: 700; color: #475569; }
.cj-req { color: #dc2626; margin-left: 2px; }
/* Autosave marker: a hollow circle until the field is captured into the session draft,
   green once it is. It means "held for this session", NOT "stored on the server" — that is
   what Confirm changes does, and the draft is gone on reload. */
.cj-ind { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.4rem;
  font-weight: 500; text-transform: none; letter-spacing: 0; vertical-align: middle; }
.cj-ind > i { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid #cbd5e1; background: #fff; transition: background 0.15s, border-color 0.15s; }
.cj-ind.on > i { border-color: #16a34a; background: #16a34a; }
.cj-ind-txt { font-size: 0.64rem; font-weight: 600; color: #16a34a; white-space: nowrap; }
.cj-fhelp { font-size: 0.7rem; color: #94a3b8; line-height: 1.35; }
.cj-input { width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.86rem; background: var(--surface); }
.cj-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cj-input:disabled { background: var(--surface-2); color: var(--muted); }
.cj-check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.86rem; }

.cj-tablefield { gap: 0.5rem; }
.cj-table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.cj-grid { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.cj-grid th { text-align: left; padding: 0.45rem 0.55rem; background: var(--surface-2); color: #475569; font-weight: 700; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; border-bottom: 1px solid var(--border); }
/* Per-column example under the heading. The heading itself is nowrap, so the hint has to
   opt back into wrapping and cap its width or one long example widens the whole column. */
.cj-colhint { display: block; margin-top: 0.2rem; max-width: 24ch; font-size: 0.66rem; font-weight: 500;
  text-transform: none; letter-spacing: 0; color: #94a3b8; white-space: normal; line-height: 1.3; }
.cj-grid td { padding: 0.25rem 0.35rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cj-grid tr:last-child td { border-bottom: none; }
/* Cells carry a visible box at rest — an empty transparent input is invisible, so users
   couldn't tell a new row had appeared or where to click. */
.cj-cell { width: 100%; min-width: 90px; padding: 0.35rem 0.45rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 0.8rem; background: var(--surface); cursor: text; }
select.cj-cell { cursor: pointer; }
/* Guided row entry: locked until the cells before it are filled, and the next expected
   cell is outlined. `.cj-cell:focus` outranks both, so focus styling still wins. */
.cj-cell-locked { background: var(--surface-2); color: var(--muted); border-color: var(--border); cursor: not-allowed; }
.cj-cell-next { border-color: var(--danger); background: var(--surface); box-shadow: 0 0 0 2px rgba(220,38,38,0.16); }
/* The row being filled in, so a wide grid shows where the user is. */
.cj-grid tr.cj-row-active > td { background: rgba(220,38,38,0.035); }
.cj-cell:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 2px var(--primary-soft); }
.cj-rowdel { border: none; background: transparent; color: #94a3b8; cursor: pointer; font-size: 0.9rem; padding: 0.2rem 0.4rem; border-radius: 6px; }
.cj-rowdel:hover { color: #dc2626; background: #fef2f2; }
.cj-lock { font-size: 0.7rem; }
.cj-tbar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.15rem; }

/* ── Trust Center ─────────────────────────────────────────────────────────── */
.tc-groups { display: flex; flex-direction: column; gap: 1.5rem; }
.tc-group-title { margin: 0 0 0.75rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; }
.tc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.75rem; }
.tc-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 0.85rem; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; box-shadow: var(--shadow); }
.tc-card-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.tc-card-icon svg { width: 22px; height: 22px; }
.tc-card-main { min-width: 0; }
.tc-card-title { font-weight: 600; font-size: 0.92rem; }
.tc-card-desc { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.tc-card-meta { display: flex; gap: 0.9rem; margin-top: 0.35rem; font-size: 0.72rem; color: var(--faint); }
.tc-dl { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; text-decoration: none; }
.tc-dl svg { width: 15px; height: 15px; }
@media (max-width: 560px) { .tc-card { grid-template-columns: 44px 1fr; } .tc-dl { grid-column: 2; justify-content: center; margin-top: 0.5rem; } }
