:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-muted: #f1f2f7;
  --surface-hover: #f7f8fc;
  --border: #e6e8f0;
  --border-strong: #d7dae6;
  --text: #1c1e2a;
  --text-secondary: #5b6072;
  --text-tertiary: #666b80;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-text: #ffffff;
  --primary-soft: #eef1ff;
  --primary-soft-border: #d9deff;

  --success: #15803d;
  --success-hover: #116a32;
  --success-soft: #eafbf0;
  --success-border: #bfe8cc;

  --danger: #c62828;
  --danger-hover: #a91f1f;
  --danger-soft: #fdeeee;
  --danger-border: #f5c6c6;

  --warning: #a15c00;
  --warning-soft: #fff6e5;
  --warning-border: #f3dfa8;

  --slack-soft: #f0eaff;
  --slack-color: #6b3fd4;
  --email-soft: #e6f2ff;
  --email-color: #1568c9;
  --push-soft: #fff0e6;
  --push-color: #c25a10;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(20, 24, 43, 0.05);
  --shadow-md: 0 6px 16px rgba(20, 24, 43, 0.08);
  --shadow-lg: 0 20px 48px rgba(20, 24, 43, 0.18);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: "SF Mono", "Menlo", "Consolas", ui-monospace, monospace;

  --sidebar-w: 232px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Sign-in screen                                                       */
/* ------------------------------------------------------------------ */

.signin-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.signin-screen.hidden {
  display: none;
}

.signin-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 32px;
}

.signin-card .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin: 0 auto 18px;
}

.signin-card .brand-mark .icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

.signin-card h1 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.signin-card p {
  color: var(--text-secondary);
  font-size: 13.75px;
  margin: 0 0 22px;
}

.signin-card .btn {
  width: 100%;
  justify-content: center;
}

/* ------------------------------------------------------------------ */
/* App shell                                                           */
/* ------------------------------------------------------------------ */

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

.app-shell.hidden {
  display: none;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(155deg, #6a61ef, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-mark .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.brand-text .brand-name {
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text .brand-sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

nav.tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px 8px;
}

nav.tabs button.tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 13.75px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s ease, color 0.12s ease;
}

nav.tabs button.tab-btn .icon {
  width: 17px;
  height: 17px;
  color: var(--text-tertiary);
  transition: color 0.12s ease;
}

nav.tabs button.tab-btn[hidden] { display: none; }

.tab-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
nav.tabs button.tab-btn.active .tab-badge { background: #fff; }

nav.tabs button.tab-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

nav.tabs button.tab-btn:hover .icon {
  color: var(--text-secondary);
}

nav.tabs button.tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

nav.tabs button.tab-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

nav.tabs button.tab-btn.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

nav.tabs button.tab-btn.active .icon {
  color: var(--primary);
}

/* "About this service" pre-read, anchored above the user area. */
.sidebar-note {
  margin: auto 12px 12px;
  padding: 14px;
  border: 1px solid var(--primary-soft-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--primary-soft), #f8f9ff);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.sidebar-note-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--primary);
}
.sidebar-note-title .icon { width: 15px; height: 15px; }
.sidebar-note p { margin: 0 0 8px; }
.sidebar-note-lead { font-size: 13px; font-weight: 650; line-height: 1.35; color: var(--text); letter-spacing: -0.01em; }
.sidebar-note-list { margin: 0 0 10px; padding: 0; list-style: none; }
.sidebar-note-list li { margin-bottom: 7px; }
.sidebar-note-list strong { display: block; color: var(--text); font-weight: 600; }
.sidebar-note-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sidebar-note-link .icon { width: 13px; height: 13px; transition: transform 0.12s ease; }
.sidebar-note-link:hover .icon { transform: translateX(3px); }
.sidebar-note-link:focus-visible { outline: none; text-decoration: underline; }

.sidebar-footer {
  position: relative;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--surface-hover); }
.user-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.user-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(155deg, #6a61ef, #4f46e5);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.sidebar-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--text-tertiary);
}
.user-chip-caret { width: 15px; height: 15px; margin-left: auto; flex-shrink: 0; color: var(--text-tertiary); }

.user-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% - 6px);
  z-index: 20;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.user-menu[hidden] { display: none; }
.user-menu-role {
  padding: 6px 8px 8px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
}
.user-menu-item:hover { background: var(--danger-soft); color: var(--danger); }
.user-menu-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.user-menu-item .icon { width: 15px; height: 15px; }

.app-main {
  flex: 1;
  min-width: 0;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 40px 96px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
}

.page-head p.sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 6px 0 0;
  max-width: 560px;
}

.page-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

button.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 13.75px;
  font-weight: 550;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

button.btn[hidden] {
  display: none;
}

button.btn:hover {
  background: var(--surface-hover);
  border-color: var(--text-tertiary);
}

button.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

button.btn.primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

button.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

button.btn.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

button.btn.danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

button.btn.success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

button.btn.success:hover {
  background: var(--success-hover);
  border-color: var(--success-hover);
}

button.btn.subtle-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-border);
}

button.btn.subtle-danger:hover {
  background: var(--danger-soft);
}

button.btn.small {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 7px;
}

button.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.linklike {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 2px;
}

button.linklike:hover {
  color: var(--primary);
}

button.linklike.danger {
  color: var(--danger);
}

button.linklike.danger:hover {
  color: var(--danger-hover);
}

.status-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.status-cell .linklike {
  font-size: 12px;
  padding: 0;
}

/* ------------------------------------------------------------------ */
/* Cards / tables                                                       */
/* ------------------------------------------------------------------ */

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 16px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 13.75px;
}

thead th {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--text-tertiary);
  text-align: left;
  padding: 13px 20px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th:first-child {
  border-top-left-radius: var(--radius-lg);
}

thead th:last-child {
  border-top-right-radius: var(--radius-lg);
}

tbody td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--surface-hover);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.active {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-border);
}

.pill.inactive {
  color: var(--text-tertiary);
  background: var(--surface-muted);
  border-color: var(--border);
}

.pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.pill.warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: var(--warning-border);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Applications table: each application is a summary row plus a hidden
   details row that expands below it (see renderApplications in app.js). */
th.col-toggle {
  width: 40px;
}

tr.app-row {
  cursor: pointer;
}

.app-activity {
  width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-tertiary);
  font-size: 11px;
  white-space: nowrap;
}

.app-activity svg {
  width: 180px;
  height: 48px;
  display: block;
  pointer-events: none;
}

.app-activity-area {
  fill: #4f46e5;
  fill-opacity: 0.17;
}

.app-activity-line {
  fill: none;
  stroke: #4f46e5;
  stroke-width: 2;
  stroke-linejoin: round;
}

tr.app-row-details td {
  padding: 16px 20px 18px;
  background: var(--surface-muted);
}

tr.app-row-details.hidden {
  display: none;
}

tr.app-row-details.hidden td {
  padding: 0;
  border-bottom: none;
}

.row-toggle {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
}

.row-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.row-toggle .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.row-toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

.empty-state,
.loading-state,
.error-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13.75px;
}

.empty-state .icon,
.loading-state .icon {
  display: block;
  margin: 0 auto 10px;
  width: 28px;
  height: 28px;
  color: var(--text-tertiary);
  opacity: 0.7;
}

.error-state {
  color: var(--danger);
}

/* ------------------------------------------------------------------ */
/* Toasts                                                               */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 13.5px;
  z-index: 999;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.18s ease;
}

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

.toast .icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--success);
  flex-shrink: 0;
}

.toast.error .icon {
  color: var(--danger);
}

.toast.error {
  border-color: var(--danger-border);
}

/* ------------------------------------------------------------------ */
/* Modals                                                               */
/* ------------------------------------------------------------------ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 35, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 20px;
  overflow-y: auto;
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.16s ease;
}

@keyframes modal-in {
  from {
    transform: translateY(8px) scale(0.99);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal.wide {
  max-width: 660px;
}

/* A modal whose body can hold an unbounded number of items (the failed
   log): the header/filters and footer actions stay pinned, only the
   middle section scrolls, so a long list never pushes the Close button
   or the channel filter out of reach. */
.modal.modal-scroll {
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  padding: 0;
}

.modal.modal-scroll .modal-scroll-head {
  padding: 28px 28px 16px;
  flex-shrink: 0;
}

.modal.modal-scroll .modal-scroll-body {
  padding: 0 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal.modal-scroll .modal-scroll-foot {
  padding: 16px 28px 24px;
  flex-shrink: 0;
  margin-top: 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.modal h2 {
  font-size: 17px;
  font-weight: 650;
  margin: 0 0 6px;
  padding-right: 24px;
}

.modal p.desc {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: 0 0 20px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.5;
}

.field .hint code {
  font-family: inherit;
  white-space: nowrap;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.75px;
  padding: 10px 13px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

/* Long-form text: a fixed, roomy default height; the corner handle expands it and
   anything longer scrolls inside. */
.field textarea {
  height: 320px;
  min-height: 160px;
  max-height: 70vh;
  resize: vertical;
  overflow-y: auto;
  line-height: 1.5;
}

.field input::placeholder {
  color: var(--text-tertiary);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.field.suffix-field .suffix-input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field.suffix-field .suffix-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.field.suffix-field input {
  border: none;
  background: none;
  flex: 1;
  min-width: 0;
}

.field.suffix-field input:focus {
  box-shadow: none;
}

.field.suffix-field .suffix {
  padding: 0 13px;
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
  background: var(--surface-muted);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12.75px;
  color: var(--text-secondary);
}

.checkbox-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.credential-box {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.callout {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  background: var(--surface-muted);
  font-size: 12.75px;
  color: var(--text-secondary);
  margin-top: 14px;
  line-height: 1.55;
}

.callout .tag {
  flex-basis: 100%;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text);
}

.callout .icon {
  margin-top: 1px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.callout.danger {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: #7a1f1f;
}

.callout.danger .icon {
  color: var(--danger);
}

.form-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  color: #7a1f1f;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.75px;
  margin-top: -4px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.form-error.visible {
  display: flex;
}

.form-error .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--danger);
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Failed-notification log                                             */
/* ------------------------------------------------------------------ */

.log-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}


/* One unified box per failure - no separate "header box" floating over a
   second nested fields box. The toggle button is just the box's first
   row; Channel/Timestamp are ordinary fields inside the same box, not a
   specially-styled header. */
.log-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: var(--surface-muted);
  overflow: hidden;
}

.log-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 13px 16px;
  text-align: left;
  font-family: var(--sans);
  color: var(--text);
}

.log-toggle:hover {
  background: var(--surface-hover);
}

.log-toggle .log-toggle-text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-toggle .log-toggle-time {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.log-toggle .chevron {
  width: 15px;
  height: 15px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.log-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.log-entry .channel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}

.log-entry .channel-badge .icon {
  width: 13px;
  height: 13px;
}

.log-entry .channel-badge.slack {
  background: var(--slack-soft);
  color: var(--slack-color);
}

.log-entry .channel-badge.email {
  background: var(--email-soft);
  color: var(--email-color);
}

.log-entry .channel-badge.push {
  background: var(--push-soft);
  color: var(--push-color);
}

.log-fields {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 12px;
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding: 14px 16px 16px;
}

.log-fields.hidden {
  display: none;
}

.log-fields dt {
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 2px;
}

.log-fields dd {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-fields code.error-code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--danger-soft);
  color: #8a1f1f;
  border: 1px solid var(--danger-border);
  border-radius: 5px;
  padding: 2px 7px;
}

.expand-link {
  color: var(--primary);
  font-size: 11.75px;
  font-weight: 550;
  cursor: pointer;
  margin-top: 2px;
  display: inline-block;
}

.expand-link:hover {
  text-decoration: underline;
}

/* One notification's fan-out deliveries (Slack destinations, Push
   devices), nested inside its .log-fields as the "Deliveries" row - see
   renderLogs in app.js. Deliberately a plain list, not a second <table>:
   this already sits inside a modal that's narrower than the page's own
   tables (which have a 640px min-width made for the full-width page
   layout), and a notification's fan-out is rarely more than a handful of
   targets. The left border color is the only per-item status signal
   (green/red) - each item's own text already says success or failure, so
   this stays a quiet accent rather than a second competing badge. */
.log-delivery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-delivery-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.log-delivery-item.success {
  border-left-color: var(--success);
}

.log-delivery-item.partial {
  border-left-color: var(--warning);
}

.log-delivery-item.failed {
  border-left-color: var(--danger);
}

.log-delivery-target {
  font-family: var(--mono);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-delivery-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.log-delivery-detail {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ------------------------------------------------------------------ */
/* Observability                                                       */
/* ------------------------------------------------------------------ */

.filters-bar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  gap: 10px;
  margin: 0 0 10px;
  padding: 12px 0 14px;
  flex-wrap: wrap;
  background: linear-gradient(var(--bg) 78%, rgba(245, 246, 250, 0));
}

.filters-bar select,
.log-filters select {
  appearance: none;
  min-width: 160px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6072' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 38px 9px 13px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.filters-bar select:focus,
.log-filters select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.metric-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.metric-tile .metric-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.metric-tile .metric-icon .icon {
  width: 14px;
  height: 14px;
}

.metric-tile.tone-success .metric-icon {
  background: var(--success-soft);
  color: var(--success);
}

.metric-tile.tone-warning .metric-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.metric-tile.tone-info .metric-icon {
  background: var(--email-soft);
  color: var(--email-color);
}

.metric-tile .metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.metric-tile .metric-value {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.metric-tile .metric-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 3px;
  line-height: 1.4;
}

.section-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 32px 0 12px;
}

.obs-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}

.obs-chart {
  position: relative;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.obs-chart h3 { margin: 0 0 10px; font-size: 14px; }
.obs-chart svg { display: block; width: 100%; height: auto; cursor: crosshair; }
.obs-chart-hover-line { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 4 4; visibility: hidden; pointer-events: none; }
.obs-chart-hover-line.visible { visibility: visible; }
.obs-chart-tooltip {
  position: fixed;
  z-index: 10;
  min-width: 210px;
  max-width: min(420px, calc(100vw - 16px));
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  pointer-events: none;
}
.obs-chart-tooltip[hidden] { display: none; }
.obs-chart-tooltip-time { font-weight: 650; margin-bottom: 7px; }
.obs-chart-tooltip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; }
.obs-chart-tooltip-row i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.obs-chart-tooltip-row span { min-width: 0; overflow-wrap: anywhere; }
.obs-chart-tooltip-row strong { margin-left: auto; white-space: nowrap; font-weight: 600; }
.obs-chart-ytitle { margin: 2px 0 6px; font-size: 11px; color: var(--text-secondary); }
.obs-chart-plot { display: grid; grid-template-columns: 46px minmax(0, 1fr); }
.obs-chart-yticks { position: relative; }
.obs-chart-yticks span {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 11px;
  line-height: 1;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.obs-chart-xticks { position: relative; height: 30px; margin: 6px 0 0 46px; }
.obs-chart-xticks.single { height: 16px; }
.obs-chart-xticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-secondary);
  white-space: nowrap;
  text-align: center;
}
.obs-chart-xticks em { display: block; font-style: normal; opacity: 0.75; }
.obs-chart-xticks span:first-child { transform: none; }
.obs-chart-xticks span:last-child:not(:first-child) { transform: translateX(-100%); }
.obs-chart-xtitle { margin: 2px 0 0 46px; font-size: 11px; color: var(--text-secondary); text-align: center; }
.obs-chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12px; }
.obs-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.obs-chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }

.obs-error-details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

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

.obs-error-details > summary::before {
  content: "▸";
  font-size: 15px;
}

.obs-error-details[open] > summary::before {
  content: "▾";
}

.obs-error-details > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.obs-error-total {
  margin-left: auto;
  color: var(--text);
  letter-spacing: normal;
  text-transform: none;
}

.health-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  border-radius: 4px;
  background: var(--surface-muted);
  overflow: hidden;
  vertical-align: middle;
  margin-right: 8px;
}

.health-bar > span {
  display: block;
  height: 100%;
  background: var(--success);
  border-radius: 4px;
}

.range-note {
  color: var(--text-tertiary);
  font-size: 12.25px;
  margin-top: 16px;
}

/* Platform health checks - on-demand, not auto-polled (see app.js
   checkHealth): each tile is a button until clicked, then shows the
   result of that one probe. */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.health-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.health-tile-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.health-tile-head .metric-icon {
  margin-bottom: 0;
}

.health-tile-name {
  font-size: 12.5px;
  font-weight: 600;
}

.health-result {
  min-height: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

#postgres-probe,
#redis-probe {
  color: var(--text-tertiary);
  font-size: 12px;
}

.health-status-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 12.75px;
  width: 100%;
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transform: translateY(1px);
}

.health-dot.ok {
  background: var(--success);
}

.health-dot.error {
  background: var(--danger);
}

.health-dot.not_configured {
  background: var(--text-tertiary);
}

.health-status-text {
  color: var(--text-secondary);
  font-weight: 550;
}

.health-status-text .health-detail {
  display: block;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-top: 2px;
}

.health-recheck {
  padding: 0;
}

/* ------------------------------------------------------------------ */
/* Documentation                                                       */
/* ------------------------------------------------------------------ */

.doc-layout {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.doc-toc {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 40px;
}

.doc-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.doc-toc-list li {
  margin: 0;
}

.doc-toc-list a {
  display: block;
  padding: 7px 16px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.doc-toc-list a:hover {
  color: var(--primary);
}

.doc-toc-list a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 650;
}

.doc-content {
  flex: 1;
  min-width: 0;
  max-width: 720px;
}

.doc-section {
  margin-bottom: 56px;
  scroll-margin-top: 40px;
}

.doc-section:last-child {
  margin-bottom: 0;
}

.doc-section .doc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

.doc-section h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.doc-section h3 {
  font-size: 14.5px;
  font-weight: 650;
  margin: 26px 0 10px;
}

.doc-section p {
  color: var(--text-secondary);
  font-size: 14.25px;
  line-height: 1.7;
  margin: 0 0 14px;
}

.doc-section ul {
  color: var(--text-secondary);
  font-size: 14.25px;
  line-height: 1.75;
  padding-left: 22px;
  margin: 0 0 14px;
}

.doc-section li + li {
  margin-top: 4px;
}

.doc-section code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.5px 6px;
  color: #3b2fb0;
}

.doc-section pre {
  background: #1c1e2a;
  border: 1px solid #2b2e40;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 14px 0 18px;
  box-shadow: var(--shadow-sm);
}

.doc-section pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12.75px;
  line-height: 1.65;
  color: #dfe1f0;
}

.doc-flow {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 14px 0 20px;
  font-family: var(--mono);
  font-size: 12.25px;
  color: var(--text-secondary);
  background: var(--surface-muted);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

.error-code-table code {
  white-space: nowrap;
}

/* Per-example language switcher (Python/Go/...) - see app.js's
   setDocLanguage(). .lang-example wraps a .lang-tabs header plus one
   .lang-panel per language; exactly one panel is un-hidden at a time. */
.lang-example {
  margin: 14px 0 18px;
}

.lang-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.lang-tab {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 4px 13px;
}

.lang-tab:hover {
  color: var(--text);
}

.lang-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.lang-panel[hidden] {
  display: none;
}

.lang-panel > pre:first-child,
.lang-panel > p:first-child {
  margin-top: 0;
}

.lang-panel > pre:last-child,
.lang-panel > p:last-child {
  margin-bottom: 0;
}

.text-faint,
.text-tertiary {
  color: var(--text-tertiary);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 920px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    height: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 4px 8px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand {
    padding: 12px 10px;
  }

  /* The tabs scroll sideways instead of clipping when they do not fit. */
  nav.tabs {
    flex: 1 1 100%;
    order: 3;
    flex-direction: row;
    padding: 0 4px 6px;
    overflow-x: auto;
  }

  nav.tabs button.tab-btn {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* The side accent bar belongs to the vertical layout only. */
  nav.tabs button.tab-btn.active::before {
    display: none;
  }

  .sidebar-note {
    display: none;
  }

  /* Keep the account menu (sign out) reachable: avatar only, menu opens below. */
  .sidebar-footer {
    margin-left: auto;
    padding: 4px;
    border-top: none;
  }

  .user-chip {
    width: auto;
    padding: 4px;
  }

  .user-meta,
  .user-chip-caret {
    display: none;
  }

  .user-menu {
    left: auto;
    right: 4px;
    bottom: auto;
    top: calc(100% + 2px);
    min-width: 180px;
  }

  main {
    padding: 28px 20px 72px;
  }

  .doc-layout {
    flex-direction: column;
    gap: 24px;
  }

  .doc-toc {
    width: 100%;
    position: static;
  }

  .doc-toc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-left: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
  }

  .doc-toc-list a {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    margin-left: 0;
  }

  .doc-toc-list a.active {
    border-color: var(--primary);
    background: var(--primary-soft);
  }
}

[data-tip] { cursor: help; }
.help-tip {
  position: fixed;
  z-index: 30;
  max-width: calc(100vw - 16px);
  white-space: nowrap;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  pointer-events: none;
}
.help-tip[hidden] { display: none; }

.obs-chart-hover-dots { pointer-events: none; }
.obs-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  margin: -2px -6px;
  border: none;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: opacity 0.12s ease, background 0.12s ease;
}
.obs-legend-item:hover { background: var(--surface-hover); }
.obs-legend-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.obs-legend-item.off { opacity: 0.45; text-decoration: line-through; }

.count-cell { display: flex; align-items: center; gap: 12px; }
.count-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-muted);
  overflow: hidden;
}
.count-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--danger); opacity: 0.8; }
.count-cell strong { min-width: 34px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.skeleton {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-muted) 25%, #e8eaf3 37%, var(--surface-muted) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
.sk-icon { width: 28px; height: 28px; margin-bottom: 14px; border-radius: 8px; }
.sk-line { height: 10px; margin-top: 8px; }
.sk-sm { width: 55%; }
.sk-md { width: 75%; }
.sk-lg { width: 35%; height: 22px; margin-top: 10px; }
.sk-title { width: 45%; height: 14px; }
.sk-plot { height: 150px; margin-top: 16px; border-radius: 8px; }

.empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 460px;
  margin: 0 auto;
  padding: 44px 20px 40px;
  text-align: center;
}
.empty-card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}
.empty-card-icon .icon { width: 24px; height: 24px; }
.empty-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.empty-card p { margin: 0 0 18px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.empty-card-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
td.empty-cell { padding: 0; }

.example-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 14px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--primary-soft-border);
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  font-size: 13px;
  color: var(--text-secondary);
}
.example-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.example-banner-text { flex: 1; min-width: 220px; }

/* Custom dropdown (a styled menu over the native select) */
.dd { position: relative; display: inline-block; }
.dd-native { display: none; }
.dd-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 160px;
  height: 35px;
  padding: 0 12px 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.dd-button:hover { border-color: #c2c7da; }
.dd-button:focus-visible, .dd.open .dd-button {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.dd-button:disabled { opacity: 0.55; cursor: not-allowed; }
.dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-caret { flex-shrink: 0; width: 14px; height: 14px; color: var(--text-tertiary); transition: transform 0.15s ease; }
.dd.open .dd-caret { transform: rotate(180deg); }
.dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 100%;
  max-height: min(360px, 60vh);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.dd-menu[hidden] { display: none; }
.dd-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.dd-option.active { background: var(--surface-muted); }
.dd-option[aria-selected="true"] { color: var(--primary); font-weight: 600; }
.dd-option[aria-selected="true"].active { background: var(--primary-soft); }
.dd-check { flex-shrink: 0; width: 14px; height: 14px; color: var(--primary); visibility: hidden; }
.dd-option[aria-selected="true"] .dd-check { visibility: visible; }
