:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #d8dee4;
  --text: #1f2933;
  --muted: #5f6b7a;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --sidebar: #111827;
  --sidebar-text: #e5e7eb;
  --accent: #2563eb;
  --notice-bg: #eff6ff;
  --notice-border: #93c5fd;
  --dev-banner: #fef3c7;
  --dev-border: #f59e0b;
}

* { box-sizing: border-box; }

/* Class display rules (e.g. flex) otherwise override the HTML hidden attribute. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.muted { color: var(--muted); }

.app-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; flex-direction: column; min-width: 10rem; }
.brand strong { font-size: 1.1rem; }

.client-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.client-selector select {
  min-width: 16rem;
  padding: 0.35rem 0.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-label { color: var(--muted); font-size: 0.9rem; }

.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 1rem 0.75rem;
}

.nav-section {
  margin: 1rem 0 0.35rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.15rem;
  border-radius: 0.35rem;
  color: var(--sidebar-text);
  text-decoration: none;
}

.nav-link.nav-product {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.08); }
.nav-link.active { background: var(--accent); color: #fff; }

.content { padding: 1.5rem; }

.page-header h1 { margin: 0 0 0.25rem; }
.page-header p { margin: 0 0 1rem; }

.page-header-with-logo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.page-header-with-logo .page-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.page-header-with-logo .page-header-text p {
  margin-bottom: 0;
}

.page-header-with-instance,
.page-header-with-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.page-header-with-instance .page-header-text,
.page-header-with-controls .page-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.page-header-with-instance .page-header-text p,
.page-header-with-controls .page-header-text p {
  margin-bottom: 0;
}

.page-header-trailing {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  flex: 0 0 auto;
}

.instance-registration {
  text-align: right;
  flex: 0 0 auto;
  margin-left: auto;
}

.instance-status-text,
.client-service-status {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  max-width: 18rem;
  color: var(--muted, #6b7280);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.75rem;
  height: 2.15rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}

.status-badge:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-badge-red {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.status-badge-green {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.client-service-controls-root {
  text-align: right;
  flex: 0 0 auto;
}

.client-service-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.client-service-controls .status-badge,
.client-service-controls .btn-danger.status-badge-sized {
  min-width: 6.75rem;
  height: 2.15rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  box-sizing: border-box;
}

/* Smaller than Register/Connect/Deregister; 2× gap before Deregister (gap 1rem + 1rem). */
.client-service-controls .client-service-resend {
  min-width: 0;
  height: 1.75rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 1rem;
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

.client-service-controls .client-service-resend:hover:not(:disabled) {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.client-service-controls .btn-danger {
  margin-right: 0;
}

.btn-danger {
  background: #b91c1c;
  color: #fff;
  border: 1px solid #991b1b;
}

.btn-danger:hover:not(:disabled) {
  background: #991b1b;
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.15rem 0.55rem;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: default;
}

button.pn-badge {
  cursor: pointer;
}

button.pn-badge:disabled {
  opacity: 0.6;
  cursor: wait;
}

.pn-badge-yes {
  background: #dcfce7;
  color: #15803d;
}

.pn-badge-no {
  background: #fee2e2;
  color: #7f1d1d;
}

.emails-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.email-item {
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
}

.email-item summary {
  display: grid;
  grid-template-columns: 10rem 1fr 1.4fr auto;
  gap: 0.75rem;
  cursor: pointer;
  align-items: baseline;
}

.email-body-text,
.email-body-html {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.sms-meta {
  display: grid;
  grid-template-columns: 10rem 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
}

.sms-item .email-body-text {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.75rem 0 0;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
}

.switch {
  position: relative;
  display: inline-block;
  width: 2.6rem;
  height: 1.4rem;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 1.05rem;
  width: 1.05rem;
  left: 0.18rem;
  top: 0.175rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.switch input:checked + .switch-slider {
  background: #15803d;
}

.switch input:checked + .switch-slider::before {
  transform: translateX(1.15rem);
}

.client-logo-slot {
  flex: 0 0 auto;
  width: 200px;
  height: 60px;
  padding: 0;
  border: 1px dashed var(--border);
  border-radius: 0.4rem;
  background: #f8fafc;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  color: inherit;
}

.client-logo-slot:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.client-logo-slot:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.client-logo-slot:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.client-logo-slot img {
  width: 200px;
  height: 60px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.client-logo-placeholder {
  color: #94a3b8;
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

.page-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  background: #e8edf2;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  width: fit-content;
  max-width: 100%;
}

.page-tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  padding: 0.45rem 1rem;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.page-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.55); }

.page-tab.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.tab-panel.is-hidden,
.tab-panel[hidden] { display: none !important; }

.monitor-hint { margin: 0 0 0.75rem; font-size: 0.9rem; }

.comms-monitor-log {
  min-height: 28rem;
  height: calc(100vh - 16rem);
  max-height: 70vh;
  overflow: auto;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: #fafbfc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.35;
}

.monitor-entry { margin: 0 0 0.9rem; }
.monitor-entry:last-child { margin-bottom: 0; }

.monitor-heading {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.monitor-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}

.monitor-out { color: #14532d; }
.monitor-in { color: #111827; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

.phase-notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.dev-banner {
  background: var(--dev-banner);
  border: 1px solid var(--dev-border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.btn {
  border: 1px solid transparent;
  border-radius: 0.35rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.inline-form { display: inline; margin: 0; }

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
}

.login-card h1 { margin: 0 0 0.25rem; }
.login-card form { display: grid; gap: 0.5rem; margin-top: 1.25rem; }
.login-card input {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
}

.password-form {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.password-form input[type="password"] {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
}

.password-form label {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

code {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: #f1f5f9;
  border-radius: 0.25rem;
  font-size: 0.85rem;
}

/* ---------- Graice page ---------- */

.panel-block { margin-bottom: 1rem; }

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading h2 { margin: 0; }
.heading-actions { display: flex; gap: 0.5rem; }

.invite-delivery {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  margin: 0.65rem 0 0.25rem;
  padding: 0.45rem 0.15rem;
  font-size: 0.9rem;
}

.invite-delivery-label {
  color: var(--muted, #6b7280);
  font-weight: 500;
}

.invite-delivery-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.invite-delivery-option input {
  margin: 0;
}

.dev-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.upload-row,
.search-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 0 0.5rem;
  flex-wrap: wrap;
}

.search-row input[type="text"] {
  flex: 1;
  min-width: 16rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
}

.op-result {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.35rem;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.9rem;
}

.op-success { border-color: #86efac; background: #f0fdf4; }
.op-error { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }

.table-wrap { overflow-x: auto; margin-top: 0.75rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.actions-cell { white-space: nowrap; }

.btn-small { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-grey { background: #e5e7eb; color: #374151; }
.badge-blue-light { background: #eff6ff; color: #60a5fa; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-green-light { background: #f0fdf4; color: #4ade80; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red-light { background: #fef2f2; color: #f87171; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-black { background: #111827; color: #f9fafb; }

.match-card {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  background: #fff;
}

.match-best { border-color: var(--accent); box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15); }
.match-title { font-weight: 600; font-size: 1rem; }
.match-title a { color: var(--primary); text-decoration: none; }
.match-title a:hover { text-decoration: underline; }
.match-section {
  margin-top: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text, #111827);
}
.match-excerpt,
.bot-source-excerpt {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}
.match-excerpt summary,
.bot-source-excerpt summary {
  cursor: pointer;
  color: var(--muted, #6b7280);
}
.bot-source-section {
  margin-top: 0.2rem;
  font-weight: 600;
}
.bot-source-doc { margin-bottom: 0.55rem; }
.bot-source-sections {
  list-style: none;
  margin: 0.25rem 0 0;
  padding-left: 0.75rem;
}
.bot-source-section-item { margin-top: 0.2rem; }

.activity-log {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: 14rem;
  overflow-y: auto;
  font-size: 0.88rem;
}

.activity-log li { padding: 0.25rem 0; border-bottom: 1px dashed var(--border); }
.activity-error { color: #b91c1c; }

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 1.5rem;
}

.modal {
  background: var(--surface);
  border-radius: 0.6rem;
  width: 100%;
  max-width: 46rem;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 1rem 1.2rem; overflow-y: auto; }
.modal-body h4 { margin: 1rem 0 0.4rem; }
.modal-body h4:first-child { margin-top: 0; }

.icon-btn {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 0.2rem 0.4rem;
}

.file-preview {
  width: 100%;
  height: 22rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: #f8fafc;
}

.file-preview-img {
  max-width: 100%;
  max-height: 22rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
}

.file-summary {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.6rem 0.8rem;
}

.meta-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.meta-table th {
  text-align: left;
  padding: 0.3rem 0.75rem 0.3rem 0;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  vertical-align: top;
}
.meta-table td { padding: 0.3rem 0; word-break: break-all; }

/* ---------- Graice Knowledge Bot ---------- */

.graice-bot {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 70;
}

.bot-launcher {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.bot-launcher-label {
  background: #1d6ef2;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  white-space: nowrap;
}

.bot-launcher-btn {
  width: 84px;
  height: 84px;
  padding: 0;
  border: 4px solid #1d6ef2;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  background: #0b1020;
  box-shadow: 0 0 18px rgba(29, 110, 242, 0.65);
  transition: transform 0.15s ease;
}

.bot-launcher-btn:hover { transform: scale(1.05); }

.bot-launcher-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bot-popup {
  width: 24rem;
  max-width: calc(100vw - 3rem);
  height: 34rem;
  max-height: calc(100vh - 6rem);
  background: #f7f8fa;
  border-radius: 0.75rem;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bot-popup-expanded {
  width: 34rem;
  height: 44rem;
}

.bot-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #1d6ef2;
  color: #fff;
  padding: 0.8rem 1rem;
}

.bot-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #0b1020;
}

.bot-header-titles { display: flex; flex-direction: column; flex: 1; }
.bot-subtitle { font-size: 0.85rem; opacity: 0.9; }
.bot-title { font-size: 1.35rem; font-weight: 700; }

.bot-header-actions { display: flex; align-items: center; gap: 0.15rem; }
.bot-icon { color: #fff; font-size: 1.1rem; }
.bot-icon:hover { opacity: 0.8; }

.bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.bot-msg { margin-bottom: 0.9rem; display: flex; flex-direction: column; }
.bot-msg-user { align-items: flex-end; }
.bot-msg-bot { align-items: flex-start; }

.bot-bubble {
  max-width: 85%;
  padding: 0.7rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.4;
  background: #eceef1;
  color: var(--text);
}

.bot-msg-user .bot-bubble {
  background: #1d6ef2;
  color: #fff;
}

.bot-msg-time {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
  padding: 0 0.25rem;
}

.bot-sources { margin-top: 0.6rem; font-size: 0.88rem; }
.bot-sources ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.bot-sources a { color: var(--primary); }
.bot-msg-user + .bot-msg .bot-sources a { color: inherit; }

.bot-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-style: italic;
}
.bot-typing-dots {
  display: inline-flex;
  gap: 0.22rem;
  align-items: center;
}
.bot-typing-dots i {
  display: block;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  animation: bot-typing-pulse 1.1s ease-in-out infinite;
}
.bot-typing-dots i:nth-child(2) { animation-delay: 0.18s; }
.bot-typing-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes bot-typing-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-1px); }
}
.bot-error { color: #b91c1c; }

.bot-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fff;
  border-top: 1px solid var(--border);
}

.bot-input-row input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 2px solid #bfdbfe;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

.bot-input-row input:focus {
  outline: none;
  border-color: #1d6ef2;
}

.bot-send {
  width: 44px;
  height: 40px;
  border: none;
  border-radius: 0.5rem;
  background: #1d6ef2;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bot-send:hover { background: var(--primary-hover); }
.bot-send:disabled { opacity: 0.6; cursor: default; }

/* ---------- Frontline pages ---------- */

.editor-form {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #f8fafc;
}

.editor-form h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.65rem 0.85rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.form-grid input,
.form-grid select,
.heading-actions input,
.heading-actions select {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
  margin-top: 1.4rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.65rem 0.8rem;
  background: #f8fafc;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.stat-value {
  display: block;
  margin-top: 0.25rem;
  font-weight: 600;
  word-break: break-word;
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.status-chip {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.8rem;
}

.payload-pre {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  max-height: 28rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.note-cell {
  white-space: pre-wrap;
  max-width: 28rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.small-id {
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.sql-import-textarea,
.block-label textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #0f172a;
  color: #e2e8f0;
  resize: vertical;
  box-sizing: border-box;
}

.block-label {
  display: block;
  margin-top: 0.75rem;
}

.list-limit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.65rem;
}

.list-limit-meta {
  margin: 0;
  font-size: 0.875rem;
}

.list-limit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.list-limit-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.875rem;
}

.list-limit-size select {
  font: inherit;
  padding: 0.15rem 0.35rem;
}

.list-limit-page {
  min-width: 5.5rem;
  text-align: center;
  font-size: 0.875rem;
}
