/* SIForm management layer — shell, dashboard, forms, entries, settings.
   Consumes the builder's design tokens from app.css. */

/* ================= shell ================= */

/* 100dvh, not 100vh: on a phone the static viewport unit is taller than what
   is actually visible, which pushes the end of every scrolling panel under the
   browser chrome. */
#fbm-shell { display: flex; height: 100vh; height: 100dvh; background: var(--bg); overflow: hidden; }
#fbm-shell[hidden] { display: none; }

.fbm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fbm-head {
  --head-px: 22px;
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 12px var(--head-px); background: var(--panel); border-bottom: 1px solid var(--border);
}

/* Section tabs: the bottom row of the header, an underline marks the current one. */
.fbm-htabs {
  flex: 1 0 100%; display: flex; gap: 2px;
  margin: -2px calc(-1 * var(--head-px)) -12px; padding: 0 calc(var(--head-px) - 10px);
  overflow-x: auto; scrollbar-width: none;
}
.fbm-htabs::-webkit-scrollbar { display: none; }
.fbm-htabs[hidden] { display: none; }
.fbm-htab {
  position: relative; flex-shrink: 0;
  padding: 10px 10px 12px; font-size: 13px; font-weight: 600; line-height: 1;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  border-radius: 6px 6px 0 0; transition: color .15s ease;
}
.fbm-htab::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px;
  border-radius: 2px 2px 0 0; background: transparent; transition: background-color .15s ease;
}
.fbm-htab:hover { color: var(--text); }
.fbm-htab:hover::after { background: var(--border-strong); }
.fbm-htab[aria-current="page"] { color: var(--accent-600); }
.fbm-htab[aria-current="page"]::after { background: var(--accent); }
.fbm-htab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Loading: an indeterminate bar along the header's bottom edge while the
   content underneath is replaced, and the content dims (after a beat, so a
   fast response never flickers). */
.fbm-main.is-busy .fbm-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) 0 0 / 40% 100% no-repeat;
  animation: fbm-indeterminate 1.1s ease-in-out infinite;
}
.fbm-view.is-busy > * { opacity: .55; pointer-events: none; transition: opacity .15s ease .12s; }
@keyframes fbm-indeterminate { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.fbm-spinner {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: fbm-spin .7s linear infinite;
}
@keyframes fbm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .fbm-main.is-busy .fbm-head::after, .fbm-spinner { animation-duration: 2.4s; }
}
.fbm-title { font-size: 17px; margin: 0; letter-spacing: -.01em; }
.fbm-search { position: relative; flex: 1; max-width: 420px; display: flex; align-items: center; margin-left: auto; }
.fbm-search > svg { position: absolute; left: 11px; color: var(--faint); }
.fbm-search input {
  width: 100%; height: 36px; padding: 0 12px 0 34px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg);
}
.fbm-search input:focus { outline: none; border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px var(--accent-soft); }
.fbm-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 80;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); max-height: 380px; overflow-y: auto; padding: 5px;
}
.fbm-sr-head { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 8px 10px 4px; }
.fbm-sr-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 7px; text-decoration: none; color: var(--text); font-size: 13px;
}
.fbm-sr-item:hover { background: var(--bg); }
.fbm-sr-item small { margin-left: auto; color: var(--faint); }
.fbm-sr-empty { color: var(--faint); text-align: center; padding: 16px; }
.fbm-view { flex: 1; overflow-y: auto; padding: 20px 22px 60px; }
.fbm-loading, .fbm-error { color: var(--faint); text-align: center; padding: 60px; }
.fbm-loading { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; }
.fbm-error { color: var(--danger); display: flex; align-items: center; justify-content: center; gap: 8px; }
.fbm-muted { color: var(--faint); font-size: 12.5px; }

/* ================= panels (settings) ================= */

.fbm-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.fbm-panel h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.fbm-panel h4 { margin: 18px 0 8px; font-size: 12.5px; }

/* ================= dashboard ================= */

.fbm-db { display: flex; flex-direction: column; gap: 16px; max-width: 1280px; }
.fbm-db.is-busy > * { opacity: .55; transition: opacity .15s ease .1s; }
.fbm-db-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fbm-db-hello { margin: 0 0 3px; font-size: 20px; letter-spacing: -.015em; }
.fbm-db-head .fbm-muted { margin: 0; }

/* KPI cards */
.fbm-db-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fbm-db-kpi {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
a.fbm-db-kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
a.fbm-db-kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fbm-db-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fbm-db-kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.fbm-db-kpi-icon { display: inline-flex; color: var(--faint); }
.fbm-db-kpi-icon svg { width: 16px; height: 16px; }
.fbm-db-kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fbm-db-kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; min-height: 26px; }
.fbm-db-kpi-foot small { color: var(--faint); font-size: 11.5px; line-height: 1.4; }
.fbm-db-spark { width: 84px; height: 26px; flex-shrink: 0; color: var(--accent); }
.fbm-db-spark polyline { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.fbm-db-trend {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: var(--bg); color: var(--muted);
}
.fbm-db-trend svg { width: 12px; height: 12px; }
.fbm-db-trend.is-up { background: var(--success-soft); color: var(--success); }
.fbm-db-trend.is-down { background: var(--danger-soft); color: var(--danger); }
.fbm-db-down { display: inline-flex; transform: rotate(180deg); }

/* Cards */
.fbm-db-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.fbm-db-span2 { grid-column: span 2; }
.fbm-db-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fbm-db-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.fbm-db-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fbm-db-card-head h3 { margin: 0; font-size: 14px; }
.fbm-db-card-head p { margin: 2px 0 0; color: var(--faint); font-size: 12px; }
.fbm-db-more { font-size: 12.5px; font-weight: 600; color: var(--accent-600); text-decoration: none; white-space: nowrap; }
.fbm-db-more:hover { text-decoration: underline; }
.fbm-db-empty { color: var(--faint); font-size: 12.5px; padding: 18px 0; text-align: center; }

/* Chart */
.fbm-db-chart { position: relative; color: var(--accent); }
.fbm-db-chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.fbm-db-gridline { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fbm-db-axis { fill: var(--faint); font-size: 10.5px; font-family: inherit; }
.fbm-db-area { fill: url(#db-fill); }
.fbm-db-line { fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fbm-db-cursor { stroke: var(--border-strong); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.fbm-db-dot { fill: var(--panel); stroke: currentColor; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.fbm-db-tip {
  position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 8px;
  background: #111827; color: #fff; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; line-height: 1.35;
}
.fbm-db-tip[hidden] { display: none; }
.fbm-db-tip span { color: #cbd5e1; font-size: 11px; }

/* Needs attention */
.fbm-db-att { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fbm-db-att li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 12.5px; }
.fbm-db-att-icon { width: 28px; height: 28px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--panel); color: var(--muted); }
.fbm-db-att-icon svg { width: 15px; height: 15px; }
.fbm-db-att li.is-info .fbm-db-att-icon { color: var(--info); background: var(--info-soft); }
.fbm-db-att li.is-warn .fbm-db-att-icon { color: var(--warning); background: var(--warning-soft); }
.fbm-db-att li.is-danger .fbm-db-att-icon { color: var(--danger); background: var(--danger-soft); }
.fbm-db-att-text { flex: 1; min-width: 0; line-height: 1.4; }
.fbm-db-att a { font-weight: 600; color: var(--accent-600); text-decoration: none; white-space: nowrap; }
.fbm-db-att a:hover { text-decoration: underline; }
.fbm-db-clear { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 0; text-align: center; color: var(--muted); font-size: 12.5px; }
.fbm-db-clear svg { width: 26px; height: 26px; color: var(--success); margin-bottom: 4px; }
.fbm-db-clear strong { color: var(--text); font-size: 13.5px; }

/* Recent entries */
.fbm-db-table-wrap { overflow-x: auto; margin: 0 -6px; }
.fbm-db-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fbm-db-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 0 6px 8px; border-bottom: 1px solid var(--border); }
.fbm-db-table td { padding: 9px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.fbm-db-table tr:last-child td { border-bottom: 0; }
.fbm-db-table tbody tr:hover { background: var(--bg); }
.fbm-db-who { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.fbm-db-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.fbm-db-who strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbm-db-who small { color: var(--faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbm-db-who:hover strong { color: var(--accent-600); }
.fbm-db-table tr.is-unread strong { color: var(--text); }
.fbm-db-form { color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbm-db-when { color: var(--faint); white-space: nowrap; text-align: right; }
.fbm-db-unread { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: middle; }

/* Top forms */
.fbm-db-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fbm-db-top a { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 12.5px; }
.fbm-db-top a:hover { background: var(--bg); }
.fbm-db-top-rank { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 700; }
.fbm-db-top-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.fbm-db-top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbm-db-top-bar { height: 5px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.fbm-db-top-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.fbm-db-top strong { font-variant-numeric: tabular-nums; }

/* Recently edited forms */
.fbm-db-list { list-style: none; margin: 0; padding: 0; }
.fbm-db-list a { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.fbm-db-list li:last-child a { border-bottom: 0; }
.fbm-db-list a:hover { background: var(--bg); border-radius: 8px; }
.fbm-db-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.fbm-db-list-main strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbm-db-list-main small { color: var(--faint); font-size: 11.5px; }

/* First run */
.fbm-db-welcome { padding: 22px; }
.fbm-db-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fbm-db-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.fbm-db-step-icon { width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-600); }
.fbm-db-step-n { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.fbm-db-steps strong { display: block; margin: 2px 0 3px; font-size: 13.5px; }
.fbm-db-steps p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

@media (max-width: 1199px) {
  .fbm-db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .fbm-db-grid { grid-template-columns: minmax(0, 1fr); }
  .fbm-db-span2 { grid-column: auto; }
  .fbm-db-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .fbm-db-kpis { grid-template-columns: minmax(0, 1fr); }
  .fbm-db-form { display: none; }
  .fbm-db-head { align-items: flex-start; }
}

/* ================= toolbar / bulk ================= */

.fbm-toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.fbm-toolbar-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.fbm-toolbar .ins-input { max-width: 170px; background: var(--panel); }
.fbm-tb-search { position: relative; flex: 1; min-width: 200px; max-width: 340px; display: flex; align-items: center; }
.fbm-tb-search svg { position: absolute; left: 10px; color: var(--faint); }
.fbm-tb-search input {
  width: 100%; height: 33px; padding: 0 10px 0 32px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); font-size: 12.5px;
}
.fbm-bulkbar[hidden] { display: none; }
.fbm-bulkbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: 10px; padding: 8px 14px; margin-bottom: 14px;
  font-weight: 600; font-size: 12.5px; color: var(--accent-600);
}

.fbm-pin { color: var(--warning); display: inline-flex; }

.fbm-status {
  display: inline-block; font-size: 11.5px; font-weight: 600; line-height: 1.5;
  border-radius: 99px; padding: 1px 9px; white-space: nowrap;
}
.fbm-status::first-letter { text-transform: uppercase; }
.fbm-status-published { background: #ecfdf5; color: #047857; }
.fbm-status-draft { background: #fffbeb; color: #b45309; }
.fbm-status-disabled { background: var(--bg); color: var(--faint); }
.fbm-status-archived { background: #eef2ff; color: #4338ca; }
.fbm-status-trashed { background: #fef2f2; color: #b91c1c; }
.fbm-status-success { background: var(--success-soft); color: var(--success); }
.fbm-status-danger { background: var(--danger-soft); color: var(--danger); }
.fbm-status-info { background: var(--info-soft); color: var(--info); }
.fbm-status-warn { background: var(--warning-soft); color: var(--warning); }

/* ---- pagination ---- */
.fbm-pager {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px;
}
.fbm-pager-info b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.fbm-pager-pages { display: flex; align-items: center; gap: 4px; }
.fbm-pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text);
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.fbm-pg-btn:hover:not(:disabled):not(.is-current) { border-color: var(--border-strong); background: var(--bg); }
.fbm-pg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fbm-pg-btn:disabled { opacity: .45; cursor: default; }
.fbm-pg-btn.is-current { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }
.fbm-pg-btn svg { width: 15px; height: 15px; }
.fbm-pg-gap { min-width: 20px; text-align: center; color: var(--faint); }
.fbm-pager-size { display: inline-flex; align-items: center; gap: 8px; }
.fbm-pager-size .ins-input { width: auto; height: 32px; padding-block: 0; background: var(--panel); }

/* ---- badges / avatars ---- */
.fbm-badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--radius-pill, 999px);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--muted);
}
.fbm-badge-success { background: var(--success-soft); color: var(--success); }
.fbm-badge-danger { background: var(--danger-soft); color: var(--danger); }
.fbm-badge-info { background: var(--info-soft); color: var(--info); }
.fbm-avatar {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-600); font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}

/* ---- activity log ---- */
.fbm-audit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.fbm-audit-title { margin: 0 0 4px; font-size: 15px; }
.fbm-audit-head .fbm-muted { margin: 0; }
.fbm-audit-filters { align-items: center; }
.fbm-audit-date { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.fbm-audit-date .ins-input { width: auto; }
.fbm-audit-table td { vertical-align: middle; }
.fbm-audit-when time { display: block; color: var(--text); white-space: nowrap; }
.fbm-audit-when small { color: var(--faint); font-size: 11.5px; }
.fbm-audit-user { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.fbm-audit-type { color: var(--muted); text-transform: capitalize; }
.fbm-audit-table a { text-decoration: none; color: inherit; }
.fbm-audit-table a:hover code, .fbm-audit-table a:focus-visible code { color: var(--accent-600); text-decoration: underline; }
.fbm-audit-detail { color: var(--muted); max-width: 420px; overflow-wrap: anywhere; }
.fbm-empty { text-align: center; padding: 64px 20px; color: var(--faint); }
/* The illustration only (a button's own icon keeps its normal size). */
.fbm-empty > svg { display: block; box-sizing: content-box; width: 24px; height: 24px; padding: 14px; margin: 0 auto 14px; border-radius: 50%; color: var(--accent-600); background: color-mix(in srgb, var(--accent-600) 10%, transparent); }
.fbm-empty h3 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
.fbm-empty p { max-width: 460px; margin: 0 auto; font-size: 13px; line-height: 1.55; }
.fbm-empty .ff-btn { margin: 16px 4px 0; }
.fbm-warn {
  display: flex; align-items: center; gap: 8px;
  background: #fffbeb; color: #b45309; border-radius: 9px; padding: 9px 13px;
  font-size: 12.5px; margin-bottom: 12px;
}
.fbm-code {
  display: block; background: var(--bg); border-radius: 8px; padding: 9px 12px;
  font-size: 11.5px; overflow-x: auto; white-space: pre;
}

/* ================= entries ================= */

.fbm-etable-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.fbm-etable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fbm-etable th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.fbm-etable td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.fbm-etable tbody tr { cursor: pointer; }
.fbm-etable tbody tr:hover { background: var(--bg); }
.fbm-etable tbody tr:last-child td { border-bottom: 0; }
.fbm-etable tr.is-unread td { font-weight: 600; }
.fbm-etable tr.is-unread .fbm-td-main strong::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-inline-end: 6px; vertical-align: 1px; }
.fbm-td-main strong { display: block; }
.fbm-etable td small { display: block; margin-top: 2px; color: var(--faint); font-weight: 400; font-size: 11.5px; }
.fbm-etable td a { color: inherit; text-decoration: none; }
.fbm-etable td a:hover { color: var(--accent-600); text-decoration: underline; }
.fbm-etable tbody tr.is-checked, .fbm-etable tbody tr.is-selected { background: var(--accent-soft); }
.fbm-etable tbody tr.is-busy { opacity: .55; pointer-events: none; }
.fbm-td-act { width: 1%; white-space: nowrap; text-align: end; }
.fbm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Forms table */
.fbm-forms-table .fbm-td-main { min-width: 240px; max-width: 420px; }
.fbm-forms-table .fbm-td-main strong { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.fbm-forms-table .fbm-td-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbm-forms-table .fbm-pin svg { width: 12px; height: 12px; vertical-align: -1px; color: var(--accent-600); }
.fbm-code-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--muted); font-size: 11px; white-space: nowrap; cursor: pointer; }
.fbm-code-chip:hover { border-color: var(--accent); color: var(--accent-600); }
.fbm-code-chip svg { width: 12px; height: 12px; }
.fbm-th-check { width: 30px; }
.fbm-star { color: var(--faint); display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.fbm-star.is-on { color: #f59e0b; }
.fbm-caps td, .fbm-caps th { text-align: center; }
.fbm-caps td:first-child, .fbm-caps th:first-child { text-align: left; }

/* detail panel */
.fbm-detail-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px);
  display: flex; justify-content: flex-end;
}
.fbm-detail {
  width: min(860px, 96vw); background: var(--panel); height: 100%;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: fbm-slide .2s ease;
}
@keyframes fbm-slide { from { transform: translateX(40px); opacity: 0; } }
.fbm-detail-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.fbm-detail-head strong { font-size: 14.5px; }
.fbm-detail-head small { display: block; color: var(--faint); font-size: 11.5px; }
.fbm-detail-head .fb-tool { margin-left: auto; }
.fbm-detail-body { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; }
.fbm-detail-main { padding: 16px 18px; border-right: 1px solid var(--border); }
.fbm-detail-side { padding: 16px 18px; background: var(--bg); }
.fbm-detail h4 { margin: 0 0 10px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.fbm-detail-main h4:not(:first-child) { margin-top: 22px; }
.fbm-kv { width: 100%; border-collapse: collapse; }
.fbm-kv th, .fbm-kv td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--border); font-size: 12.5px; vertical-align: top; }
.fbm-kv th { color: var(--faint); font-weight: 600; width: 34%; }
.fbm-kv-sm th, .fbm-kv-sm td { font-size: 11.5px; padding: 5px 7px; }
.fbm-ua { word-break: break-all; font-size: 10.5px !important; color: var(--faint); }
.fbm-value-img { max-width: 180px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }

/* Attachments on an entry. */
.fbm-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fbm-file { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fbm-file-thumb {
  width: 42px; height: 42px; flex-shrink: 0; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg);
}
.fbm-file-doc { display: inline-flex; align-items: center; justify-content: center; color: var(--faint); }
.fbm-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fbm-file-main strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbm-file-main small { color: var(--faint); font-size: 11px; }
.fbm-pre { margin: 0; font-size: 11px; background: var(--bg); border-radius: 6px; padding: 6px 8px; max-height: 140px; overflow: auto; }
/* Internal notes (entry panel) */
.fbm-notes { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.fbm-notes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fbm-notes-head h4 { margin: 0; display: flex; align-items: center; gap: 8px; }
.fbm-notes-count:not(:empty) { min-width: 20px; padding: 0 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-600); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.fbm-notes-private { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--faint); }
.fbm-notes-private svg { width: 12px; height: 12px; }
.fbm-avatar { flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: hsl(var(--av-h, 230) 45% 32%); background: hsl(var(--av-h, 230) 70% 92%); }
.fbm-note-compose { display: flex; gap: 10px; align-items: flex-start; }
.fbm-note-box { flex: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel); transition: border-color .12s, box-shadow .12s; }
.fbm-note-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fbm-note-input { display: block; width: 100%; min-height: 44px; max-height: 260px; padding: 9px 12px 4px; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 13px; line-height: 1.5; color: var(--text); }
.fbm-note-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 6px 12px; }
.fbm-note-bar > span { display: inline-flex; gap: 6px; }
.fbm-note-hint { font-size: 11px; color: var(--faint); }
.fbm-note-hint.is-near { color: var(--warning); font-weight: 600; }
.fbm-note-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.fbm-note-item { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.fbm-note-item:first-child { border-top: 0; }
.fbm-note-item.is-pending { opacity: .55; }
.fbm-note-main { flex: 1; min-width: 0; }
.fbm-note-meta { display: flex; align-items: center; gap: 8px; min-height: 26px; font-size: 12px; }
.fbm-note-meta strong { font-size: 12.5px; color: var(--text); }
.fbm-note-meta time, .fbm-note-edited { color: var(--faint); }
.fbm-note-edited::before { content: '·'; margin-inline-end: 8px; }
.fbm-note-acts { margin-inline-start: auto; display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.fbm-note-item:hover .fbm-note-acts, .fbm-note-item:focus-within .fbm-note-acts { opacity: 1; }
.fbm-note-acts .fb-tool { width: 26px; height: 26px; }
.fbm-note-acts .fb-tool svg { width: 14px; height: 14px; }
.fbm-note-acts [data-note-del]:hover { color: var(--danger); }
.fbm-note-text { margin: 2px 0 0; font-size: 13px; line-height: 1.55; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.fbm-note-editor { margin-top: 6px; border: 1px solid var(--accent); border-radius: 10px; box-shadow: 0 0 0 3px var(--accent-soft); background: var(--panel); }
.fbm-notes-empty { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--muted); }
.fbm-notes-empty > svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; color: var(--faint); }
.fbm-notes-empty strong { display: block; font-size: 12.5px; color: var(--text); }
.fbm-notes-empty p { margin: 2px 0 0; font-size: 12px; }
@media (pointer: coarse) { .fbm-note-acts { opacity: 1; } .fbm-note-acts .fb-tool { width: 44px; height: 44px; } }
.fbm-timeline { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.fbm-tl { display: flex; gap: 10px; }
.fbm-tl-dot {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--accent-600);
}
.fbm-tl p { margin: 2px 0 0; font-size: 12px; }
.fbm-tl small { color: var(--faint); font-size: 10.5px; }
.fbm-detail-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }

/* ================= new form (step flow) ================= */

.fbm-nf-box { width: min(880px, 100%); max-width: 880px; display: flex; flex-direction: column; max-height: min(760px, 92dvh); overflow: hidden; }
.fbm-nf-body { overflow-y: auto; flex: 1; min-height: 320px; padding-top: 16px; }
.fbm-nf .md-foot { padding-top: 14px; border-top: 1px solid var(--border); }
.fbm-nf-box.is-busy .md-body, .fbm-nf-box.is-busy .fbm-nf-steps { opacity: .6; pointer-events: none; }
.fbm-nf-grow { flex: 1; }

.fbm-nf-steps { display: flex; gap: 6px; margin: 0; padding: 0 18px 14px; list-style: none; border-bottom: 1px solid var(--border); }
.fbm-nf-steps li { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--faint); font-size: 12.5px; font-weight: 600; }
.fbm-nf-steps li:not(:last-child)::after { content: ''; flex: 1; height: 1px; background: var(--border); margin-inline: 4px; }
.fbm-nf-dot {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-strong); font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.fbm-nf-dot svg { width: 13px; height: 13px; }
.fbm-nf-steps li.is-current { color: var(--text); }
.fbm-nf-steps li.is-current .fbm-nf-dot { border-color: var(--accent); background: var(--accent); color: #fff; }
.fbm-nf-steps li.is-done { color: var(--muted); }
.fbm-nf-steps li.is-done .fbm-nf-dot { border-color: var(--accent); color: var(--accent-600); background: var(--accent-soft); }

.fbm-nf-toolbar { margin: 4px 0 14px; }
.fbm-nf-toolbar .fbm-tb-search { max-width: 340px; }
.fbm-nf-cats { margin: 12px 0 0; }
.fbm-nf-lead { margin: 4px 0 14px; color: var(--muted); }

.fbm-nf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.fbm-nf-card, .fbm-nf-layout {
  position: relative; display: flex; text-align: left; gap: 6px;
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; padding: 14px;
  cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease;
}
.fbm-nf-card { flex-direction: column; align-items: flex-start; }
.fbm-nf-card strong, .fbm-nf-layout strong { font-size: 13px; color: var(--text); }
.fbm-nf-card small, .fbm-nf-layout small { color: var(--faint); font-size: 12px; line-height: 1.4; }
.fbm-nf-card:hover, .fbm-nf-layout:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.fbm-nf-card:focus-visible, .fbm-nf-layout:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fbm-nf-card[aria-checked='true'], .fbm-nf-layout[aria-checked='true'] {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.fbm-nf-card[aria-checked='true']::after, .fbm-nf-layout[aria-checked='true']::after {
  content: ''; position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.fbm-nf-card.is-blank { border-style: dashed; }
.fbm-nf-card-icon {
  width: 34px; height: 34px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--bg); color: var(--muted);
}
.fbm-nf-card-icon svg { width: 18px; height: 18px; }
.fbm-nf-card[aria-checked='true'] .fbm-nf-card-icon, .fbm-nf-layout[aria-checked='true'] .fbm-nf-card-icon { background: var(--accent-soft); color: var(--accent-600); }

.fbm-nf-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fbm-nf-layouts { display: flex; flex-direction: column; gap: 10px; }
.fbm-nf-layout { align-items: flex-start; gap: 12px; padding-right: 34px; }
.fbm-nf-layout > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.fbm-nf-outline {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto;
}
.fbm-nf-opage { background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.fbm-nf-opage-head { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.fbm-nf-opage-head span { color: var(--accent-600); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.fbm-nf-opage ul { margin: 0; padding-left: 16px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.fbm-nf-opage p, .fbm-nf-outline > p { margin: 0; font-size: 12px; }

.fbm-nf-summary { display: flex; gap: 24px; margin: 4px 0 12px; }
.fbm-nf-summary dt { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.fbm-nf-summary dd { margin: 2px 0 0; font-weight: 600; }
.fbm-nf-error { display: flex; align-items: center; gap: 8px; color: var(--danger); background: var(--danger-soft); padding: 9px 12px; border-radius: 8px; }
.fbm-nf .md-foot .fbm-spinner { width: 14px; height: 14px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }

@media (max-width: 767px) {
  .fbm-nf-split { grid-template-columns: 1fr; }
  .fbm-nf-steps { padding-inline: 14px; }
  .fbm-nf-steps li span:last-child { display: none; }
  .fbm-nf-steps li.is-current span:last-child { display: inline; }
}

/* ================= settings ================= */

.fbm-settings-panel { max-width: 760px; }
.fbm-savebar { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ================= builder topbar additions ================= */

.fbm-status-select {
  max-width: 118px; min-height: 30px; padding: 3px 8px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  border-radius: 8px;
}
.fbm-status-select.is-published { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.fbm-status-select.is-draft { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.fbm-status-select.is-disabled { color: var(--faint); }

/* ================= kiosk / render mode ================= */

body.ff-kiosk { background: transparent; overflow: auto; }
body.ff-kiosk .pv-overlay { position: static; background: none; backdrop-filter: none; padding: 0; }
body.ff-kiosk .pv-chrome { border-radius: 0; box-shadow: none; background: transparent; max-width: none; }
body.ff-kiosk .pv-bar { display: none; }
body.ff-kiosk .pv-stage { padding: 0; overflow: visible; }
body.ff-kiosk .pv-frame { box-shadow: none; border-radius: 0; max-width: 780px; }
.ff-kiosk-msg { font-family: var(--font, system-ui); color: #667085; text-align: center; padding: 60px 20px; }

/* ================= print (entries) ================= */

@media print {
  .fbm-head, .fbm-toolbar, .fbm-bulkbar, .fbm-pager, #fb-toasts { display: none !important; }
  #fbm-shell, .fbm-main, .fbm-view { display: block !important; height: auto; overflow: visible; padding: 0; }
  .fbm-etable-wrap { border: 0; }
}

/* ================= responsive ================= */

@media (max-width: 980px) {
  .fbm-detail-body { grid-template-columns: 1fr; }
  .fbm-detail-main { border-right: 0; }
}


/* ==========================================================================
   RESPONSIVE — management screens
   Breakpoints follow the standard set: 1200 / 992 / 768.
   ========================================================================== */

/* ---- Laptop --------------------------------------------------------------- */
@media (max-width: 1199px) {
  .fbm-head { --head-px: 16px; }
  .fbm-view { padding-inline: 16px; }
}

/* ---- Tablet: single-column content -------------------------------------- */
@media (max-width: 991px) {
  .fbm-detail-body { grid-template-columns: 1fr; }
  .fbm-detail-main { border-right: 0; }
  .fbm-search { max-width: 260px; }
}
/* ---- Mobile ------------------------------------------------------------- */
@media (max-width: 767px) {
  .fbm-main { padding-bottom: 0; }

  .fbm-head {
    --head-px: 12px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px var(--head-px);
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .fbm-title { font-size: var(--fs-h4, 17px); flex: 1 1 auto; min-width: 0; }
  .fbm-search { order: 3; flex: 1 1 100%; max-width: none; margin-left: 0; }
  .fbm-htabs { order: 4; margin-top: 0; }
  .fbm-head .ff-btn { flex-shrink: 0; }

  .fbm-view { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }

  /* Toolbars and tab strips scroll rather than wrap into a tall stack. */
  .fbm-toolbar,
  .fbm-bulkbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .fbm-toolbar > *,
  .fbm-bulkbar > * { flex-shrink: 0; }
  .fbm-toolbar .ins-input { min-width: 140px; }
  .fbm-tb-search { flex: 1 1 160px; min-width: 140px; }

  .fbm-pager { flex-wrap: wrap; justify-content: center; gap: 8px; }
}

/* ---- Data tables: horizontal scroll with a sticky header ---------------- */
@media (max-width: 991px) {
  .fbm-etable-wrap,
  .fbm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* A scrollable region must be reachable by keyboard. */
    scrollbar-width: thin;
  }
  .fbm-etable,
  .fbm-table { min-width: 720px; }
  .fbm-etable thead th,
  .fbm-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel);
  }
}

/* ---- Touch targets ------------------------------------------------------ */
@media (pointer: coarse), (max-width: 767px) {
  .fbm-seg button,
  .fbm-db-more,
  .fbm-db-att a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .fbm-db-who,
  .fbm-db-top a,
  .fbm-db-list a { min-height: 44px; }
  .fbm-htab,
  .fbm-star,
  .fbm-code-chip,
  .fbm-etable .fb-tool { min-height: 44px; min-width: 44px; }
  .ff-btn-sm { min-height: 44px; padding-inline: 12px; }

  /* Every text-entry and select control, wherever it sits. */
  .fbm-search input,
  .fbm-toolbar input,
  .fbm-toolbar select,
  .fbm-tb-search input,
  .fbm-view input:not([type="checkbox"]):not([type="radio"]),
  .fbm-view select { min-height: 44px; }

  /* Any anchor acting as a control inside a table row or toolbar. */
  .fbm-etable td a,
  .fbm-toolbar a,
  .fbm-htabs a,
  .fbm-empty a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* ---- 320px: the narrowest supported width ------------------------------- */
@media (max-width: 400px) {
  .fbm-head { padding: 8px 10px; }
  .fbm-view { padding: 10px 8px calc(20px + env(safe-area-inset-bottom)); }
  .fbm-title { font-size: var(--fs-h5, 15px); }
  /* The label would push the header past the viewport; the icon still reads. */
  #fbm-new span { display: none; }
  #fbm-new { min-width: 44px; padding-inline: 10px; }
}

/* ================= modules / AI access / licence ================= */

.fbm-mhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.fbm-mtitle { margin: 0 0 4px; font-size: 17px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.fbm-mhead .fbm-muted { margin: 0; max-width: 680px; line-height: 1.55; }
.fbm-mcount { white-space: nowrap; color: var(--muted); font-size: 12.5px; padding-top: 4px; }
.fbm-mcount b { color: var(--text); font-variant-numeric: tabular-nums; }
.fbm-pill { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-600); }
.fbm-note { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0; padding: 9px 12px; border-radius: 8px; background: var(--warning-soft); color: var(--text); font-size: 12.5px; line-height: 1.5; }
.fbm-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: var(--warning); }

/* segmented control */
.fbm-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); }
.fbm-seg button { padding: 6px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fbm-seg button:hover { color: var(--text); }
.fbm-seg button[aria-checked="true"], .fbm-seg button[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.fbm-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fbm-seg-wrap { flex-wrap: wrap; margin: 8px 0 6px; }

/* switch */
.fbm-switch { flex-shrink: 0; padding: 2px; border-radius: 999px; line-height: 0; }
.fbm-switch-track { display: inline-block; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background-color .15s ease; }
.fbm-switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .2); transition: transform .15s ease; }
.fbm-switch[aria-checked="true"] .fbm-switch-track { background: var(--accent); }
.fbm-switch[aria-checked="true"] .fbm-switch-thumb { transform: translateX(16px); }
.fbm-switch:disabled { opacity: .5; cursor: not-allowed; }
.fbm-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .fbm-switch-track, .fbm-switch-thumb { transition: none; } }

/* feature modules */
.fbm-mgroup { margin: 20px 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.fbm-mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.fbm-module {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; transition: border-color .15s ease;
}
.fbm-module.is-on { border-color: var(--accent-soft); }
.fbm-module[aria-busy="true"] { opacity: .6; }
.fbm-module-icon { width: 34px; height: 34px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--bg); color: var(--muted); }
.fbm-module.is-on .fbm-module-icon { background: var(--accent-soft); color: var(--accent-600); }
.fbm-module-icon svg { width: 18px; height: 18px; }
.fbm-module-text { flex: 1; min-width: 0; }
.fbm-module-text strong { font-size: 13px; }
.fbm-module-text p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* cards */
.fbm-mcard { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; max-width: 900px; }
.fbm-mcard-head { padding: 14px 18px 0; }
.fbm-mcard-head h3 { margin: 0; font-size: 14px; }
.fbm-mcard-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.fbm-mcard-body { padding: 12px 18px 16px; }
.fbm-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.fbm-setting strong { font-size: 13px; }
.fbm-setting p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.fbm-status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fbm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.fbm-status-line.is-on { color: var(--success); }
.fbm-status-line.is-on .fbm-dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.fbm-status-line.is-bad { color: var(--danger); }
.fbm-status-line.is-bad .fbm-dot { background: var(--danger); }
.fbm-endpoint { font-weight: 500; color: var(--text); background: var(--bg); padding: 4px 8px; border-radius: 6px; font-size: 12px; overflow-wrap: anywhere; margin-left: auto; }

/* connect steps */
.fbm-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 18px; }
.fbm-steps > li { position: relative; padding-left: 34px; counter-increment: step; }
.fbm-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-600);
}
/* Each step: number and title on one line, its content below. */
.fbm-steps > li > strong { display: block; font-size: 13.5px; line-height: 22px; margin-bottom: 2px; }
.fbm-steps > li > .fbm-seg { margin: 8px 0 2px; }
.fbm-steps > li > p { margin: 3px 0 8px; color: var(--muted); font-size: 12.5px; }
.fbm-cred-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: end; }
.fbm-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fbm-field small { font-weight: 400; color: var(--faint); line-height: 1.5; }
.fbm-field small a { color: var(--accent-600); }
.fbm-cred-actions { display: flex; gap: 6px; }
/* A copyable code block: dark panel, the copy button inside its corner. */
.fbm-codeblock { position: relative; margin: 8px 0; }
.fbm-codeblock pre {
  margin: 0; padding: 14px 16px; padding-inline-end: 96px; border-radius: 10px; overflow-x: auto;
  background: #0f172a; color: #e2e8f0; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere;
}
.fbm-codeblock code { background: none; padding: 0; border-radius: 0; color: inherit; font-size: inherit; }
.fbm-code-copy { position: absolute; top: 9px; inset-inline-end: 9px; }
.fbm-test-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.fbm-test-result { font-size: 12.5px; color: var(--muted); }
.fbm-test-result.is-ok { color: var(--success); }
.fbm-test-result.is-bad { color: var(--danger); }

/* tools */
.fbm-tool-group { margin: 14px 0 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.fbm-tool-group:first-child { margin-top: 0; }
.fbm-tools { list-style: none; margin: 0; padding: 0; }
.fbm-tools li { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.fbm-tools li:last-child { border-bottom: 0; }
.fbm-tools li.is-hidden-ro { opacity: .5; }
.fbm-tool-text { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.fbm-tool-text strong { font-size: 13px; }
.fbm-tool-text code { font-size: 11px; color: var(--faint); }
.fbm-tool-text p { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* licence */
.fbm-kvgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 18px; margin: 14px 0 4px; }
.fbm-kvgrid dt { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.fbm-kvgrid dd { margin: 3px 0 0; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fbm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.fbm-lic-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.fbm-lic-form .ins-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@media (max-width: 767px) {
  .fbm-mhead { flex-direction: column; gap: 6px; }
  .fbm-mgrid { grid-template-columns: 1fr; }
  .fbm-cred-row { grid-template-columns: 1fr; }
  .fbm-endpoint { margin-left: 0; }
  .fbm-mcard-head, .fbm-mcard-body { padding-inline: 14px; }
}

/* ---- spam protection settings ---- */
.fbm-sp { display: flex; flex-direction: column; gap: 4px; max-width: 760px; }
.fbm-sp-result { display: flex; align-items: center; gap: 7px; margin: -4px 0 12px; font-size: 12.5px; }
.fbm-sp-result svg { width: 15px; height: 15px; }
.fbm-sp-result.is-ok { color: var(--success); }
.fbm-sp-result.is-bad { color: var(--danger); }

/* The SIForm mark at the start of the management header. */
.fbm-brand {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 9px;
  color: var(--accent-600); background: var(--accent-soft); text-decoration: none;
}
.fbm-brand svg { width: 19px; height: 19px; }
.fbm-brand:hover { background: var(--accent); color: #fff; }
.fbm-brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse), (max-width: 767px) {
  .fbm-brand { width: 44px; height: 44px; }
}

/* ---------- Form analytics (dashboard) ---------- */
.fbm-db-span3 { grid-column: 1 / -1; }
.fbm-an { padding: 0; overflow: hidden; }
.fbm-an-head { padding: 16px 18px 12px; margin: 0; border-bottom: 1px solid var(--border); align-items: center; flex-wrap: wrap; }
.fbm-an-admin { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fbm-an-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; }
.fbm-an-confirm { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); }
.fbm-an-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.fbm-an-custom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fbm-an-custom[hidden] { display: none; }
.fbm-an-custom input { width: auto; min-width: 140px; }
.fbm-an-form { margin-inline-start: auto; }
.fbm-an-form select { min-width: 180px; max-width: 260px; }
.fbm-an-body { padding: 18px; background: var(--bg); min-height: 200px; }
.fbm-an.is-busy .fbm-an-body { opacity: .55; transition: opacity .15s; }
.fbm-an-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 260px; color: var(--muted); font-size: 13px; }
.fbm-an-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; text-align: center; }
.fbm-an-kpi strong { display: block; font-size: 22px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.fbm-an-kpi span { font-size: 12.5px; font-weight: 500; }
.fbm-an-chart { position: relative; height: 280px; }
.fbm-an-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fbm-an-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fbm-an-grid.is-v { stroke-dasharray: 0; opacity: .7; }
.fbm-an-axis { fill: var(--muted); font-size: 11px; }
.fbm-an-area { opacity: .1; }
.fbm-an-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fbm-an-cursor { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.fbm-an-dot { stroke: var(--panel); stroke-width: 2; vector-effect: non-scaling-stroke; }
.fbm-an-empty { position: absolute; inset: 0 0 30px 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.fbm-an-tip {
  position: absolute; z-index: 2; pointer-events: none; min-width: 170px;
  display: grid; gap: 4px; padding: 9px 11px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow-md); font-size: 12px;
}
.fbm-an-tip[hidden] { display: none; }
.fbm-an-tip b { font-weight: 600; margin-bottom: 2px; }
.fbm-an-tip span { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.fbm-an-tip strong { margin-inline-start: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.fbm-an-tip i, .fbm-an-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.fbm-an-legend { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.fbm-an-legend li { display: inline-flex; align-items: center; gap: 6px; }
.fbm-an-note { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 9px 12px; border-radius: 8px; background: var(--warning-soft); font-size: 12.5px; }
.fbm-an-note svg { width: 15px; height: 15px; color: var(--warning); flex-shrink: 0; }
.fbm-an-note.is-error svg { color: var(--danger); }
@media (max-width: 760px) {
  .fbm-an-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fbm-an-form { margin-inline-start: 0; width: 100%; }
  .fbm-an-form select { width: 100%; max-width: none; }
  .fbm-an-chart { height: 220px; }
}
@media (max-width: 420px) { .fbm-an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Settings → AI assistant ---------- */
.fbm-ai-fallback { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.fbm-ai-fallback strong { display: block; font-size: 13.5px; }
.fbm-ai-fallback p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.fbm-ai-order { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 12.5px; color: var(--muted); }
.fbm-ai-order svg { width: 14px; height: 14px; color: var(--accent-600); }
.fbm-ai-order strong { color: var(--text); font-weight: 600; }
.fbm-ai-list { list-style: none; margin: 0; padding: 0 18px 8px; }
.fbm-ai-row { border-bottom: 1px solid var(--border); }
.fbm-ai-row:last-child { border-bottom: 0; }
.fbm-ai-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.fbm-ai-name { flex: 1 1 auto; min-width: 0; }
.fbm-ai-name strong { display: block; font-size: 13.5px; }
.fbm-ai-name small { display: block; font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbm-ai-edit { margin: 0 0 12px 46px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.fbm-ai-edit-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.fbm-ai-row .ps-gw-logo { flex: 0 0 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-600); font-weight: 700; }
.fbm-ai-row .ps-pill { flex-shrink: 0; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.fbm-ai-row .ps-pill.is-ok { background: #ecfdf3; color: #067647; }
.fbm-ai-row .ps-pill.is-warn { background: #fffaeb; color: #b54708; }
@media (max-width: 560px) { .fbm-ai-edit { margin-left: 0; } .fbm-ai-name small { white-space: normal; } }

/* ---------- Embed dialog ---------- */
.emb-warn { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid #fedf89; border-radius: 10px; background: #fffaeb; color: #93370d; font-size: 13px; }
.emb-warn > svg { flex: 0 0 16px; width: 16px; height: 16px; }
.emb-warn > span { flex: 1 1 auto; }
.emb-tabs { margin-bottom: 14px; }
.emb-method { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.emb-method:last-of-type { border-bottom: 0; }
.emb-ico { flex: 0 0 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-600); }
.emb-ico svg { width: 17px; height: 17px; }
.emb-main { flex: 1 1 auto; min-width: 0; }
.emb-main > strong { display: block; font-size: 14px; }
.emb-main > p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.emb-code { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.emb-code pre { flex: 1 1 auto; min-width: 0; margin: 0; padding: 9px 12px; border: 1px solid #dcdcde; border-radius: 8px; background: #fff; color: #1d2327; font: 12.5px/1.55 Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; white-space: pre-wrap; word-break: break-all; max-height: 150px; overflow: auto; user-select: all; }
.emb-code pre code { background: none; padding: 0; font: inherit; color: inherit; }
.emb-copy { flex-shrink: 0; }
.emb-copy.is-done { color: #067647; border-color: #abefc6; background: #ecfdf3; }
.emb-hint { margin: 6px 0 0; font-size: 12px; color: var(--faint); }
.emb-open { margin-top: 8px; }
.emb-more { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.emb-more > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.emb-more[open] > summary { margin-bottom: 4px; }

/* ---------- Export / import ---------- */
.tx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tx-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface, #fff); }
.tx-card h4 { margin: 4px 0 0; font-size: 15px; }
.tx-card p { flex: 1; margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.tx-card-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-600); }
.tx-card-ic svg { width: 18px; height: 18px; }
.tx-card-ic.smtp-io-reset { background: var(--danger-soft, #fde8e8); color: var(--danger, #c0392b); }
.tx-box .md-body { display: grid; gap: 14px; }
.tx-box .md-drop { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; }
.tx-box .md-drop svg { width: 22px; height: 22px; color: var(--accent-600); }
.tx-box .md-drop small { color: var(--muted); font-size: 12px; }
.tx-choice { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.tx-choice legend { margin-bottom: 6px; padding: 0; }
.tx-sub { margin-inline-start: 24px; }
.tx-list { display: grid; gap: 4px; max-height: 220px; overflow: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.tx-lead { margin: 0; font-size: 13.5px; }
.tx-forms { display: grid; gap: 6px; max-height: 260px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.tx-forms li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.tx-forms .ins-check span { display: grid; }
.tx-forms small { color: var(--muted); font-size: 12px; }
.tx-tag { flex: none; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); font-size: 11.5px; font-style: normal; font-weight: 600; }
.tx-tag.is-warn { background: #fffaeb; color: #b54708; }
.tx-error { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: #b42318; font-size: 13px; }
.tx-error svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.tx-map-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.tx-map { width: 100%; border-collapse: collapse; font-size: 13px; }
.tx-map th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; background: var(--bg); text-align: start; font-size: 12px; color: var(--muted); }
.tx-map td { padding: 6px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
.tx-map td:last-child { width: 44%; }
.tx-sample { max-width: 180px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.tx-map .ins-input { width: 100%; }

/* ---------- Entries: opening an entry ---------- */
.fbm-etable tbody tr.is-loading { background: var(--accent-soft); }
.fbm-etable tbody tr.is-loading [data-open] svg { visibility: hidden; }
.fbm-etable tbody tr.is-loading [data-open] { position: relative; }
.fbm-etable tbody tr.is-loading [data-open]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: fbm-spin .7s linear infinite; }
.fbm-skel-row { display: grid; grid-template-columns: 30% 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.fbm-skel-row span, .fbm-skel-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%); background-size: 200% 100%; animation: fbm-shimmer 1.2s ease-in-out infinite; }
.fbm-skel-line { margin: 10px 0; }
.fbm-skel-line:nth-child(odd) { width: 70%; }
@keyframes fbm-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .fbm-skel-row span, .fbm-skel-line { animation: none; }
  .fbm-etable tbody tr.is-loading [data-open]::after { animation-duration: 2.4s; }
}

/* ---------- A table row whose action is with the server ---------- */
.fbm-etable tbody tr.is-busy .fbm-td-act { position: relative; }
.fbm-etable tbody tr.is-busy .fbm-td-act > * { visibility: hidden; }
.fbm-etable tbody tr.is-busy .fbm-td-act::after { content: ""; position: absolute; top: 50%; right: 50%; width: 16px; height: 16px; margin-top: -8px; margin-right: -8px; border: 2px solid var(--accent-600); border-right-color: transparent; border-radius: 50%; animation: fbm-spin .7s linear infinite; }

/* ---------- SMTP ---------- */

.smtp { position: relative; max-width: 1100px; }
.smtp-tab { min-height: 200px; }
.smtp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.smtp-spin { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.smtp-head { flex-wrap: wrap; }
.smtp-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.smtp-card { max-width: none; }
.smtp-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.smtp-card.is-danger { border-color: var(--danger); }
.smtp-ctl { min-width: 0; }
.smtp-ctl .ins-label { justify-content: flex-start; flex-wrap: wrap; }
.smtp-setting:last-child { border-bottom: 0; }
.smtp-setting > div { min-width: 0; }
.smtp-setting.is-off strong { color: var(--muted); }
.smtp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.smtp-inline { max-width: 260px; margin-top: 12px; }
.smtp-mt { margin-top: 12px; }
.smtp-nowrap { white-space: nowrap; }
.smtp-num-c { text-align: right; font-variant-numeric: tabular-nums; }
.smtp-bad { color: var(--danger); font-weight: 600; }
.smtp-locked { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 6px; font-size: 11px; font-weight: 600; color: var(--warning); text-transform: none; }
.smtp-locked svg { width: 12px; height: 12px; }
.smtp-error { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 40px 20px; color: var(--danger); font-size: 13px; text-align: center; }
.smtp-error svg { flex-shrink: 0; }
.smtp-empty { padding: 48px 20px; }
.smtp-empty .ff-btn svg { width: 15px; height: 15px; margin: 0; }
.smtp a.ff-btn { text-decoration: none; }
.smtp-hint { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; color: var(--text); font-size: 12.5px; line-height: 1.5; }
.smtp-hint svg { flex-shrink: 0; margin-top: 2px; color: var(--accent-600); }
.smtp-danger { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 12.5px; }
.smtp-danger svg { flex-shrink: 0; margin-top: 1px; }
.smtp-badge-warn { background: var(--warning-soft); color: var(--warning); }
.smtp-linkbtn { padding: 0; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; text-align: start; cursor: pointer; }
.smtp-linkbtn:hover { color: var(--accent-600); text-decoration: underline; }
.smtp-mark {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-600);
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
}
.smtp-kv dd .smtp-mark { width: 22px; height: 22px; font-size: 9.5px; border-radius: 6px; }

/* save bar: sticks to the bottom of the scrolling view */
.smtp-savebar {
  position: sticky; bottom: 0; z-index: 20; margin: 18px 0 0; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md);
}
.smtp-savebar[hidden] { display: none; }
.smtp-savebar .ff-btn:disabled, .smtp .ff-btn:disabled { opacity: .5; cursor: not-allowed; }
.smtp-savebar-msg { display: inline-flex; align-items: center; gap: 7px; margin-inline-end: auto; font-size: 12.5px; color: var(--muted); }
.smtp-savebar-msg svg { color: var(--success); }
.smtp-savebar.is-dirty { border-color: var(--warning); }
.smtp-savebar.is-dirty .smtp-savebar-msg { color: var(--text); font-weight: 600; }
.smtp-savebar.is-dirty .smtp-savebar-msg svg { color: var(--warning); }

/* overview */
.smtp-ov-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.smtp-ov-grid > .fbm-mcard { margin-bottom: 0; }
.smtp-ov-grid + .fbm-mcard { margin-top: 14px; }
.smtp-kv dd { font-weight: 600; }
.smtp-kv dd small { font-weight: 400; }
.smtp-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.smtp-num { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: inherit; }
.smtp-num:hover { border-color: var(--border-strong); }
.smtp-num span { font-size: 12px; color: var(--muted); font-weight: 600; }
.smtp-num strong { font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.smtp-num.is-bad strong { color: var(--danger); }
.smtp-fail { display: flex; gap: 12px; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--danger); border-radius: 12px; background: var(--danger-soft); }
.smtp-fail-ic { color: var(--danger); }
.smtp-fail-ic svg { width: 20px; height: 20px; }
.smtp-fail-text { min-width: 0; flex: 1; }
.smtp-fail-text strong { font-size: 14px; }
.smtp-fail-text p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.smtp-fail-err code, .smtp-err-code { display: inline-block; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--danger); background: var(--panel); padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.smtp-start { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.9; }

/* mailer */
.smtp-scope { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.smtp-radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.smtp-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.smtp-radio input { margin-top: 3px; accent-color: var(--accent); }
.smtp-radio span { display: flex; flex-direction: column; gap: 2px; }
.smtp-radio strong { font-size: 13px; }
.smtp-radio small { color: var(--muted); font-size: 12px; }
.smtp-radio.is-disabled { opacity: .6; cursor: not-allowed; }
.smtp-mailers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.smtp-mailer {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); text-align: start; cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.smtp-mailer:hover:not(:disabled) { border-color: var(--border-strong); }
.smtp-mailer.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.smtp-mailer:disabled { opacity: .5; cursor: not-allowed; }
.smtp-mailer:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.smtp-mailer-name { font-size: 13px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.smtp-mailer-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.smtp-mailer-tags .fbm-badge { padding: 2px 7px; font-size: 10.5px; }
.smtp-mailer-help { margin: 4px 0 12px; line-height: 1.55; }
.smtp-mailer-help a { color: var(--accent-600); }
.smtp-conns { display: flex; flex-direction: column; gap: 10px; }
.smtp-conn { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.smtp-conn.is-open { border-color: var(--border-strong); }
.smtp-conn-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.smtp-conn-title { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.smtp-conn-title strong { font-size: 13.5px; overflow-wrap: anywhere; }
.smtp-conn-title small { color: var(--faint); font-size: 12px; }
.smtp-conn-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.smtp-conn-name { max-width: 360px; margin-top: 12px; }
.smtp-conn-fields { margin-top: 6px; }
.smtp-conn-check { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.smtp-conn-check .ins-help { margin: 0; }
.smtp-presets { margin: 0; }
.smtp-secret { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 36px; padding: 4px 4px 4px 10px; border: 1px dashed var(--border-strong); border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.smtp-secret-dots { letter-spacing: .1em; color: var(--text); }
.smtp-secret > span:nth-child(2) { margin-inline-end: auto; }
.smtp-secret.is-clear { border-color: var(--danger); color: var(--danger); }
.smtp-secret.is-clear > span { margin-inline-end: auto; }
.smtp-secret-edit { display: flex; gap: 8px; align-items: center; }
.smtp-secret-edit .ins-input { flex: 1; min-width: 0; }
.smtp-secret-note { margin-top: 4px; }
.smtp-copyrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.smtp-copyrow .fbm-endpoint { margin-left: 0; flex: 1; min-width: 0; }
.smtp-oauth { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.smtp-oauth .fbm-status-line { padding-top: 0; }
.smtp-ses { margin-top: 14px; }
.smtp-ses h4 { margin: 0 0 4px; font-size: 13px; }
.smtp-ses-add { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.smtp-ses-add .fbm-field { flex: 1; min-width: 200px; }
.smtp-ses-added { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: var(--success-soft); font-size: 12.5px; }
.smtp-ses-added p { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.smtp-dkim { margin-top: 6px; }
.smtp-dkim code { overflow-wrap: anywhere; }

/* connection check & domain check */
.smtp-check { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); }
.smtp-check.is-ok { border-color: var(--success); }
.smtp-check.is-bad { border-color: var(--danger); }
.smtp-check-head { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; }
.smtp-check.is-ok .smtp-check-head svg { color: var(--success); }
.smtp-check.is-bad .smtp-check-head svg { color: var(--danger); }
.smtp-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.smtp-steps li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; }
.smtp-steps li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.smtp-steps small { color: var(--muted); overflow-wrap: anywhere; }
.smtp-step-ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; }
.smtp-step-ic svg { width: 12px; height: 12px; }
.smtp-steps .is-ok .smtp-step-ic { background: var(--success-soft); color: var(--success); }
.smtp-steps .is-bad .smtp-step-ic { background: var(--danger-soft); color: var(--danger); }
.smtp-domain-head { margin: 0 0 8px; font-size: 13px; }
.smtp-dc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.smtp-dc li { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.smtp-dc li > div { min-width: 0; }
.smtp-dc strong { font-size: 13px; }
.smtp-dc p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.smtp-dc-fix { color: var(--text) !important; }
.smtp-dc-ic { flex-shrink: 0; }
.smtp-dc .is-ok .smtp-dc-ic, .smtp-dc li.is-ok .smtp-dc-ic { color: var(--success); }
.smtp-dc li.is-warn { border-color: var(--warning); }
.smtp-dc li.is-warn .smtp-dc-ic { color: var(--warning); }
.smtp-dc li.is-error { border-color: var(--danger); }
.smtp-dc li.is-error .smtp-dc-ic { color: var(--danger); }

/* routing */
.smtp-rules.is-off .smtp-rule { opacity: .65; }
.smtp-rule { margin-bottom: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.smtp-rule-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.smtp-rule-head h3 { margin: 0; font-size: 14px; }
.smtp-rule-tools { display: inline-flex; gap: 2px; }
.smtp-down svg { transform: rotate(180deg); }
.smtp-rule-send { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.smtp-rule-send .ins-input { width: auto; min-width: 200px; max-width: 100%; }
.smtp-group { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.smtp-cond { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; }
.smtp-cond .ins-input { width: auto; min-width: 0; flex: 0 1 auto; }
.smtp-cond select.ins-input { max-width: 210px; }
.smtp-cond-hdr { max-width: 150px; }
.smtp-cond-val { flex: 1 1 180px !important; }
.smtp-cond-val.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.smtp-cond-err { flex-basis: 100%; margin: 0; color: var(--danger); font-size: 12px; }
.smtp-and { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); min-width: 32px; }
.smtp-or { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.smtp-or::before, .smtp-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.smtp-rule > .ff-btn-ghost { margin-top: 8px; }

/* log */
.smtp-filters .smtp-src { max-width: 160px; }
.smtp-log .smtp-cb { width: 34px; }
.smtp-log .smtp-cb input { width: 15px; height: 15px; accent-color: var(--accent); }
.smtp-log-main { min-width: 220px; }
.smtp-log-main small, .smtp-table td small { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.smtp-log-main small svg { width: 12px; height: 12px; vertical-align: -2px; }
.smtp-log-err { color: var(--danger) !important; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* The email log is a list like Forms and Entries: the full width. */
.smtp:has(> .smtp-tab-log) { max-width: none; }
.smtp-log tr.is-selected { background: var(--accent-soft); }
.smtp-marks { white-space: nowrap; color: var(--accent-600); }
.smtp-marks > span { display: inline-flex; margin-inline-end: 4px; }
[data-log-list].is-busy, .fbm-etable-wrap.is-busy { opacity: .55; transition: opacity .15s ease .1s; }
.smtp-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 12.5px; }
.smtp-bulk strong { margin-inline-end: auto; }
.smtp-table td { vertical-align: top; }
.smtp-table tbody tr { cursor: default; }
.smtp-detail-kv th { width: 22%; }
.smtp-detail-h { margin: 18px 0 8px; font-size: 13px; }
.smtp-headers { margin-top: 10px; font-size: 12.5px; }
.smtp-headers summary { cursor: pointer; color: var(--accent-600); font-weight: 600; }
.smtp-body-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.smtp-body-frame { display: block; width: 100%; height: 420px; border: 1px solid var(--border); border-radius: 10px; background: #fff; resize: vertical; }
.smtp-body-text, .smtp-transcript pre {
  margin: 0; max-height: 420px; overflow: auto; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); font: 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.smtp-transcript { margin-top: 12px; }
.smtp-transcript summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent-600); margin-bottom: 8px; }
.smtp-transcript pre { background: #0f172a; color: #e2e8f0; border-color: #0f172a; }
.smtp-atts, .smtp-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.smtp-atts li, .smtp-events li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.smtp-atts a { color: var(--accent-600); }
.smtp-events code { font-size: 11.5px; overflow-wrap: anywhere; }
.smtp-exp-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.smtp-exp-fields .ins-check { padding: 4px 0; }
[data-exp-fields][hidden] { display: none; }

/* test */
.smtp-test-form { max-width: 560px; }
.smtp-result { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-top: 4px; }
.smtp-result > svg { flex-shrink: 0; width: 20px; height: 20px; }
.smtp-result p { margin: 4px 0 0; font-size: 12.5px; overflow-wrap: anywhere; }
.smtp-result.is-ok { background: var(--success-soft); }
.smtp-result.is-ok > svg { color: var(--success); }
.smtp-result.is-bad { background: var(--danger-soft); }
.smtp-result.is-bad > svg { color: var(--danger); }
.smtp-result code { color: var(--danger); white-space: pre-wrap; }

/* reports */
.smtp-kpis { margin-bottom: 14px; }
.smtp-rep-card { margin-bottom: 14px; }
.smtp-chart { margin: 0; }
.smtp-chart svg { width: 100%; height: auto; display: block; }
.smtp-bar-sent { fill: var(--accent); }
.smtp-bar-failed { fill: var(--danger); }
.smtp-chart g:hover rect { opacity: .8; }
.smtp-key-sent { background: var(--accent); }
.smtp-key-failed { background: var(--danger); }
.smtp-rep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* alerts */
.smtp-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.smtp-channels.is-off .smtp-channel { opacity: .7; }
.smtp-channel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.smtp-channel.is-on { border-color: var(--accent); }
.smtp-channel-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px; }
.smtp-channel-head > div { flex: 1; min-width: 0; }
.smtp-channel-head h3 { margin: 0; font-size: 13.5px; }
.smtp-channel-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.smtp-channel.is-on .fbm-module-icon { background: var(--accent-soft); color: var(--accent-600); }
.smtp-channel-body { padding: 0 14px 14px; border-top: 1px solid var(--border); padding-top: 12px; }

/* tools */
.smtp-io { margin: 0; }
.smtp-io .md-drop { width: 100%; margin: 0; }
.smtp-io .md-drop[aria-busy="true"] { opacity: .6; pointer-events: none; }
.smtp-warn-text { color: var(--warning) !important; display: flex; align-items: flex-start; gap: 5px; }
.smtp-warn-text svg { flex-shrink: 0; margin-top: 2px; width: 13px; height: 13px; }

/* wizard */
.smtp-wizard .md-body { padding-top: 0; }
.smtp-wiz-steps { list-style: none; display: flex; gap: 4px; margin: 0 0 16px; padding: 0 0 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.smtp-wiz-steps li { display: flex; align-items: center; gap: 6px; flex: 1 0 auto; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.smtp-wiz-steps li > span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); font-weight: 700; flex-shrink: 0; }
.smtp-wiz-steps li > span svg { width: 12px; height: 12px; }
.smtp-wiz-steps li[aria-current="step"] { color: var(--text); }
.smtp-wiz-steps li[aria-current="step"] > span { background: var(--accent); border-color: var(--accent); color: #fff; }
.smtp-wiz-steps li.is-done > span { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.smtp-wiz-body { outline: none; min-height: 220px; }
.smtp-wiz-h { margin: 0 0 6px; font-size: 15px; }
.smtp-wiz-test { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.smtp-wiz-test .fbm-field { flex: 1; min-width: 220px; }
.smtp-wiz-done { text-align: center; padding: 24px 10px; }
.smtp-wiz-done > svg { width: 40px; height: 40px; color: var(--success); }
.smtp-wizard .smtp-mailers { margin-top: 12px; }


/* phones */
@media (max-width: 767px) {
  .smtp-ov-grid, .smtp-rep-grid, .smtp-two { grid-template-columns: minmax(0, 1fr); }
  .smtp-channels { grid-template-columns: minmax(0, 1fr); }
  .smtp-mailers { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .smtp-cond select.ins-input, .smtp-cond-hdr { max-width: none; flex: 1 1 140px; }
  .smtp-rule-send .ins-input { min-width: 0; flex: 1 1 160px; }
  .smtp-savebar { margin-inline: -4px; }
  .smtp-wiz-steps li b { display: none; }
  .smtp-wiz-steps li[aria-current="step"] b { display: inline; }
  .smtp-detail-kv th { width: 34%; }
  .smtp-body-frame { height: 320px; }
}
@media (max-width: 400px) {
  .smtp-nums { grid-template-columns: 1fr 1fr; }
  .smtp-num strong { font-size: 22px; }
  .smtp-head-actions { width: 100%; }
}
/* ---------- /SMTP ---------- */

/* SMTP: mailer marks are kind icons, tinted per kind. */
.smtp-mark svg { width: 16px; height: 16px; }
.smtp-kv dd .smtp-mark svg { width: 12px; height: 12px; }
.smtp-mark-smtp, .smtp-mark-php { background: #eef4ff; color: #3538cd; }
.smtp-mark-api { background: #ecfdf3; color: #067647; }
.smtp-mark-oauth { background: #fef6ee; color: #b93815; }

/* Multisite: a site whose SMTP settings the network manages. */
.smtp-managed { display: flex; gap: 12px; margin: 0 0 16px; padding: 14px 16px; border-radius: 12px; background: var(--info-soft); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.smtp-managed > svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--info); }
.smtp-managed strong { display: block; font-size: 13.5px; }
.smtp-managed p { margin: 2px 0 10px; font-size: 12.5px; color: var(--muted); }
.smtp-managed p:last-child { margin-bottom: 0; }
.smtp-tab.is-managed .md-drop.is-disabled { opacity: .55; pointer-events: none; }
.smtp-net-note { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 12.5px; }
.smtp-net-note svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Entry panel: the field key under its label, for reference. */
.fbm-kv th .fbm-kv-key { display: block; margin-top: 1px; font: 400 10.5px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--faint); }

/* Settings → Email: the email designer card */
.fbm-email-design { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(135deg, var(--accent-soft), var(--panel) 60%); }
.fbm-email-design-ic { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--panel); color: var(--accent-600); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.fbm-email-design-ic svg { width: 20px; height: 20px; }
.fbm-email-design > div:nth-child(2) { flex: 1; min-width: 0; }
.fbm-email-design strong { font-size: 13.5px; }
.fbm-email-design p { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
@media (max-width: 640px) { .fbm-email-design { flex-wrap: wrap; } .fbm-email-design .ff-btn { width: 100%; justify-content: center; } }

/* Entries → Saved & unfinished: stats for one form */
.fbm-pstats { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 0 0 14px; }
.fbm-pstats > div { display: flex; flex-direction: column; justify-content: center; min-width: 110px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.fbm-pstats strong { font-size: 20px; line-height: 1.2; }
.fbm-pstats span { font-size: 11.5px; color: var(--muted); }
.fbm-pstats-drop { flex: 1; min-width: 220px; gap: 4px; }
.fbm-pstats-drop b { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; }
.fbm-pstats-drop em { font-style: normal; color: var(--muted); }

/* Entry timeline: answers changed from the front end */
.fbm-tl-changes { margin: 4px 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 12px; }
.fbm-tl-changes b { font-weight: 600; }
.fbm-tl-from { text-decoration: line-through; color: var(--muted); }

/* ---------------- Bookings (manage/bookings.js) ---------------- */
/* Lists use the shared table (.fbm-etable); these are the few extras. */
.bk-dot { display: inline-block; width: 9px; height: 9px; margin-inline-end: 8px; border-radius: 50%; vertical-align: 0; }
.bk-table tbody tr { cursor: default; }
.bk-table tbody tr[data-svc] { cursor: pointer; }
.bk-table tr.is-cancelled td { color: var(--faint); }
.bk-table tr.is-cancelled .fbm-td-main strong { text-decoration: line-through; }
.bk-table tr.is-paused td { opacity: .65; }
.bk-table .bk-hours { max-width: 360px; color: var(--muted); }
.bk-editor { display: grid; gap: 14px; max-width: 900px; }
.bk-grow { flex: 1; }
.bk-card { padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.bk-card h3 { margin: 0 0 12px; font-size: 15px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; align-items: start; }
.bk-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .bk-grid-3 { grid-template-columns: 1fr; } }
.bk-sub { margin: 18px 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bk-card h3 + .bk-sub { margin-top: 6px; }
.bk-checks { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 10px; }
.bk-f { display: grid; gap: 4px; font-size: 13px; }
.bk-f > span { font-weight: 600; }
.bk-f small { color: var(--muted); font-size: 11.5px; }
.bk-wide { grid-column: 1 / -1; }
.bk-week, .bk-ex { display: grid; gap: 8px; margin-top: 12px; }
.bk-wd { display: grid; grid-template-columns: 160px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.bk-ex .bk-wd { grid-template-columns: 170px 110px 1fr auto; }
.bk-ranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bk-range { display: inline-flex; gap: 6px; align-items: center; }
.bk-range input[type="time"] { width: 112px; }
.bk-msg { min-height: 1em; margin: 0; } .bk-msg.is-error { color: #b91c1c; }
@media (max-width: 720px) {
  .bk-wd, .bk-ex .bk-wd { grid-template-columns: 1fr; }
}

/* Entry → Pages visited (visitor journey). */
.fbm-journey { margin: 0 0 14px; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 12.5px; }
.fbm-journey li > span { display: block; overflow-wrap: anywhere; }
.fbm-journey small { color: var(--muted, #64748b); overflow-wrap: anywhere; }
.fbm-journey-from { list-style: none; margin-inline-start: -18px; color: var(--muted, #64748b); }

/* Settings → Reports. */
.fbm-rp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.fbm-rp-table td { vertical-align: middle; }
.fbm-rp-table .ins-input { min-width: 0; }
.fbm-rp-table td small { display: block; }
.fbm-mcard-body > .ff-btn { margin-top: 10px; }
.fbm-rp-table { table-layout: fixed; width: 100%; }
.fbm-rp-table th:nth-child(1), .fbm-rp-table td:nth-child(1) { width: 44px; }
.fbm-rp-table th:nth-child(2) { width: 32%; }
.fbm-rp-table th:nth-child(3) { width: 150px; }
.fbm-rp-table th:nth-child(5) { width: 76px; }
.fbm-rp-table td small { margin-top: 4px; }
.fbm-rp-table .ins-input { width: 100%; }
@media (max-width: 782px) { .fbm-rp-table { table-layout: auto; } .fbm-rp-table th { width: auto !important; } }

/* Forms list: what a form is (poll, quiz). */
.fbm-kind { display: inline-block; margin: 2px 0 0; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--accent-600) 12%, transparent); color: var(--accent-600); }
.fbm-kind-poll { background: color-mix(in srgb, #0891b2 14%, transparent); color: #0e7490; }
.fbm-kind-personality { background: color-mix(in srgb, #c026d3 12%, transparent); color: #a21caf; }

/* SIForm → Polls / Quizzes. */
.fbm-in-panel { max-width: 760px; padding: 18px 22px; }
.fbm-in-title { margin: 0 0 4px; font-size: 18px; }
.fbm-in-panel .ff-poll { max-width: none; margin: 18px 0 0; }
.fbm-in-panel .ff-poll-track { height: 10px; background: color-mix(in srgb, var(--accent-600) 12%, transparent); }
.fbm-in-panel .ff-poll-track span { background: var(--accent-600); }
.fbm-in-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.fbm-in-stats > div { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.fbm-in-stats strong { display: block; font-size: 22px; }
.fbm-in-stats small { color: var(--muted); }
@media (max-width: 600px) { .fbm-in-stats { grid-template-columns: 1fr; } }
.fbm-toolbar a.ff-btn { text-decoration: none; }
.fbm-toolbar > .fbm-status { align-self: center; }

/* Quiz and poll editors (manage/quizEditor.js). */
.qe { max-width: 860px; }
.qe .fbm-mcard { max-width: none; }
.qe-q { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: var(--panel); }
.qe-q-head { display: flex; gap: 8px; align-items: center; }
.qe-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--accent-600) 12%, transparent); color: var(--accent-600); }
.qe-q-text { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.qe-kind { flex: 0 0 150px; width: 150px; }
.qe-q-tools { display: flex; gap: 2px; flex: none; }
.qe-answers { display: grid; gap: 6px; margin: 10px 0 0 34px; }
.qe-answer { display: flex; gap: 6px; align-items: center; }
.qe-answer .ins-input { flex: 1 1 auto; min-width: 0; }
.qe-answer .qe-outcome { flex: 0 0 170px; width: 170px; }
.qe-right { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 1.5px solid var(--border-strong, var(--border)); border-radius: 8px; color: var(--faint); cursor: pointer; position: relative; }
.qe-right input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.qe-right svg { width: 15px; height: 15px; }
.qe-right.is-on { background: #16a34a; border-color: #16a34a; color: #fff; }
.qe-right:has(input:focus-visible) { outline: 2px solid var(--accent-600); outline-offset: 2px; }
.qe-hint { font-size: 12px; color: var(--muted); }
.qe-answers > .ff-btn { justify-self: start; }
.qe-typed { margin: 10px 0 0 34px; }
.qe-q-foot { display: flex; gap: 8px; align-items: center; margin: 10px 0 0 34px; }
.qe-q-foot .ins-input { flex: 1 1 auto; min-width: 0; }
.qe-points { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); flex: none; }
.qe-points .ins-input { width: 70px; flex: none; }
.qe-outcome-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.qe-issues { display: flex; gap: 10px; max-width: 860px; padding: 10px 14px; margin: 4px 0 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, #dc2626 35%, transparent); background: color-mix(in srgb, #ef4444 8%, transparent); }
.qe-issues svg { width: 18px; height: 18px; color: #dc2626; flex: none; margin-top: 2px; }
.qe-issues ul { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13px; }
.qe-actions { max-width: 860px; }
.qe-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 760px; }
.qe-kind-card { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); text-decoration: none; }
.qe-kind-card:hover, .qe-kind-card:focus-visible { border-color: var(--accent-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-600) 14%, transparent); }
.qe-kind-card svg { width: 22px; height: 22px; color: var(--accent-600); }
.qe-kind-card span { color: var(--muted); font-size: 13px; }
@media (max-width: 700px) {
  .qe-q-head { flex-wrap: wrap; }
  .qe-kind { flex: 1 1 100%; width: auto; }
  .qe-answers, .qe-typed, .qe-q-foot { margin-inline-start: 0; }
  .qe-answer .qe-outcome { flex-basis: 120px; width: 120px; }
  .qe-outcome-row, .qe-kinds { grid-template-columns: 1fr; }
}
.qe-warn { display: flex !important; align-items: center; gap: 4px; color: #b91c1c !important; font-weight: 600; }
.qe-warn svg { width: 13px; height: 13px; }
.qe-board { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qe-board .ins-input { width: auto; min-width: 220px; }

/* White label: a chosen logo in place of the SIForm mark. */
.fbm-brand-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tb-logo .fbm-brand-img { width: 22px; height: 22px; }
/* Group headings inside a settings card read as headings, not as one more field label. */
.fbm-main .fbm-set-h { margin: 26px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 14.5px; font-weight: 650; color: var(--text); letter-spacing: 0; text-transform: none; }
.fbm-main .fbm-set-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.fbm-brand:has(.fbm-brand-img), .tb-logo:has(.fbm-brand-img) { background: transparent; }
.fbm-brand:has(.fbm-brand-img):hover { background: var(--accent-soft); }

/* Phones: a 44px star must not push the title (forms) or the ID (entries) onto
   a line of its own. The filter row scrolls without a bar; the cut-off filter
   at its edge already says there is more. */
@media (pointer: coarse), (max-width: 767px) {
  .fbm-etable .fbm-td-main > strong { display: flex; align-items: center; gap: 2px; min-width: 0; }
  .fbm-etable .fbm-td-main > strong > a { min-width: 0; }
  .fbm-etable td:has(> .fbm-star) { white-space: nowrap; }
}
@media (max-width: 767px) {
  .fbm-toolbar { scrollbar-width: none; }
  .fbm-toolbar::-webkit-scrollbar { display: none; }
}
/* A result count beside filter controls sits on their centre line. */
.fbm-count { align-self: center; white-space: nowrap; font-size: 13px; }
/* A button waiting on the server looks and acts unavailable until it is done. */
.fbm-view .ff-btn:disabled, #fbm-new:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.ff-btn .fbm-spinner { width: 14px; height: 14px; border-width: 2px; }
.ff-btn-primary .fbm-spinner { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }

/* Modules → Integrations: compact tiles, a group's own "all on / all off". */
.fbm-int-bulk { display: inline-flex; gap: 6px; margin-inline-start: auto; }
.fbm-int-ghead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 8px; }
.fbm-int-ghead .fbm-mgroup { margin: 0; }
.fbm-int-gacts { display: inline-flex; gap: 2px; }
.fbm-int-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.fbm-int { align-items: center; padding: 10px 12px; }
.fbm-int .fbm-module-text strong { font-size: 13.5px; }
@media (max-width: 767px) {
  .fbm-int-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .fbm-int-bulk { margin-inline-start: 0; }
}
/* The integrations: the Features tab with its Integrations view chosen. */
.fbm-int-section { margin-top: 0; }
.fbm-int-shead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.fbm-int-title { margin: 0 0 4px; font-size: 17px; font-weight: 650; color: var(--text); display: flex; align-items: baseline; gap: 10px; }
.fbm-int-title .fbm-mcount { font-size: 13px; font-weight: 400; }
.fbm-int-shead .fbm-muted { max-width: 720px; margin: 0; }
/* Entries → Email again: pick one of the form's emails. */
.fbm-rs-list { border: 0; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fbm-rs-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.fbm-rs-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fbm-rs-item input { margin-top: 3px; }
.fbm-rs-item span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fbm-rs-item small { color: var(--muted); overflow-wrap: anywhere; }
.fbm-rs-msg:empty { display: none; }
.fbm-rs-msg.is-err { color: var(--danger); font-size: 13px; }
