/* Fryckle — design tokens and primitives */
:root {
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --surface-sunk: #F0EEE8;
  --surface-hover: #EEEAE1;
  --text: #171513;
  --text-secondary: #57534E;
  --text-tertiary: #8B867F;
  --border: #E5E0D6;
  --border-soft: #EDE9DF;
  --accent: #1C4FD6;
  --accent-soft: #E8EDFB;
  --critical: #B42318;
  --critical-soft: #FDEDEC;
  --warning: #B54708;
  --warning-soft: #FFF6E6;
  --success: #067647;
  --success-soft: #E7F5EF;
  --font-head: 'Newsreader', Georgia, serif;
  --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}
.dark {
  --bg: #0E0D0B;
  --surface: #17150F;
  --surface-sunk: #0A0906;
  --surface-hover: #1E1B13;
  --text: #F4F1E8;
  --text-secondary: #A39F93;
  --text-tertiary: #6B675E;
  --border: #2A2720;
  --border-soft: #221F18;
  --accent: #7FA0FF;
  --accent-soft: rgba(127, 160, 255, 0.10);
  --critical: #F97066;
  --critical-soft: rgba(249, 112, 102, 0.10);
  --warning: #FDB022;
  --warning-soft: rgba(253, 176, 34, 0.10);
  --success: #47CD89;
  --success-soft: rgba(71, 205, 137, 0.10);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.15;
}
.mono { font-family: var(--font-mono); font-feature-settings: "tnum", "zero"; }
.num  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
hr { border: none; border-top: 1px solid var(--border); margin: 0; }

/* Panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-hd h3 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms, color 120ms;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: #000; }
.dark .btn-primary:hover:not(:disabled) { background: #FFF; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.05); }
.btn-danger { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-danger:hover { color: var(--critical); border-color: var(--critical); background: var(--critical-soft); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-sunk);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
  line-height: 1.5;
  white-space: nowrap;
}
.chip-accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chip-success { color: var(--success); background: var(--success-soft); border-color: transparent; }
.chip-warning { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.chip-critical { color: var(--critical); background: var(--critical-soft); border-color: transparent; }

.dot {
  width: 6px; height: 6px; border-radius: 999px;
  display: inline-block; flex-shrink: 0;
}
.dot-success { background: var(--success); }
.dot-warning { background: var(--warning); }
.dot-critical { background: var(--critical); }

/* Inputs */
input, select, textarea {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
  line-height: 1.4;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--surface-hover);
}

/* Health score */
.score {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}
.score::before {
  content: '';
  width: 4px; height: 14px;
  background: currentColor;
  align-self: center;
  margin-right: 2px;
}
.score-good { color: var(--success); }
.score-warn { color: var(--warning); }
.score-crit { color: var(--critical); }

/* Tabs */
.tabrow { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.tab {
  padding: 12px 14px 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border: none;
  background: transparent;
  position: relative;
  font-family: var(--font-body);
}
.tab:hover { color: var(--text); }
.tab-active { color: var(--text); }
.tab-active::after {
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: -1px;
  height: 2px; background: var(--text);
}

/* Sidebar */
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  margin: 1px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: background 100ms, color 100ms;
  border: none; background: transparent;
  width: calc(100% - 20px); text-align: left;
  font-family: var(--font-body);
}
.side-item:hover { background: var(--surface-hover); color: var(--text); }
.side-item-active { background: var(--surface-hover); color: var(--text); }
.side-item-active::before {
  content: '';
  position: absolute;
  left: -10px; top: 7px; bottom: 7px;
  width: 2px;
  background: var(--text);
}

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface-hover); }

/* Progress bar */
.progress { height: 4px; background: var(--surface-sunk); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--text); border-radius: 2px; transition: width 300ms; }
.progress-fill.warn { background: var(--warning); }
.progress-fill.crit { background: var(--critical); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: var(--bg);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  z-index: 100;
  animation: slideUp 200ms ease both;
  max-width: 360px;
}
.toast-success .toast-mark { background: var(--success); }
.toast-error   .toast-mark { background: var(--critical); }
.toast-info    .toast-mark { background: var(--accent); }
.toast-mark { width: 6px; height: 6px; border-radius: 999px; background: var(--bg); flex-shrink: 0; }
@keyframes slideUp { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(23, 21, 19, 0.32);
  backdrop-filter: blur(3px);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  animation: fadeBg 150ms ease both;
}
.dark .modal-backdrop { background: rgba(0,0,0,0.60); }
@keyframes fadeBg { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(23,21,19,0.18);
  animation: modalIn 160ms ease both;
}
@keyframes modalIn { from { transform: translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Avatar */
.avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-hover);
  color: var(--text);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* Toggle switch */
.switch {
  position: relative;
  width: 32px; height: 18px;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--surface);
  border-radius: 999px;
  transition: transform 150ms;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.switch-on { background: var(--text); }
.switch-on::after { transform: translateX(14px); }

/* Eyebrow */
.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Key-value */
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv dt { color: var(--text-tertiary); }
.kv dd { margin: 0; font-family: var(--font-mono); }

/* Fade in */
.fade-in { animation: fadeIn 180ms ease both; }
@keyframes fadeIn { 0% { opacity: 0; transform: translateY(3px);} 100% {opacity: 1; transform: none;} }

/* Activity feed rows */
.activity-row:hover { background: var(--surface-hover); }

/* Chart */
.chart-line { fill: none; stroke: var(--text); stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--text); opacity: 0.06; }
.chart-baseline { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; fill: none; }
.dark .chart-area { opacity: 0.12; }

/* Dashboard grids */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.dash-stat {
  padding: 18px 22px;
  border-left: 1px solid var(--border);
}
.dash-stat:first-child { border-left: none; padding-left: 0; }
.dash-main {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}
@media (max-width: 1100px) {
  .dash-main { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .dash-stats { grid-template-columns: 1fr; }
  .dash-stat { border-left: none; border-top: 1px solid var(--border); padding: 16px 0; }
  .dash-stat:first-child { border-top: none; }
}

/* ── Mobile hamburger button ─────────────────────────── */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 40;
}
.hamburger-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text);
  border-radius: 6px;
}
.hamburger-btn:hover { background: var(--surface-hover); }

/* ── Mobile sidebar overlay ──────────────────────────── */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(23, 21, 19, 0.32);
  backdrop-filter: blur(3px);
  z-index: 49;
  animation: fadeBg 150ms ease both;
}
.dark .sidebar-overlay { background: rgba(0,0,0,0.60); }

/* ── Mobile table scroll wrapper ─────────────────────── */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Demo environment banner ─────────────────────────── */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(90deg, #7C3AED, #4F46E5);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
}
.demo-banner a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Mobile responsive overrides ─────────────────────── */
@media (max-width: 768px) {
  /* Show mobile header, hide desktop sidebar */
  .mobile-header { display: flex; }
  .desktop-sidebar { display: none; }
  .desktop-sidebar.sidebar-open {
    display: flex;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    width: 260px !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }

  /* Content padding reduction */
  .mobile-pad { padding-left: 14px !important; padding-right: 14px !important; }

  /* Integration strip: 2-col */
  .integ-strip { grid-template-columns: repeat(2, 1fr) !important; }

  /* Revenue 2-col grids → 1-col */
  .rev-grid { grid-template-columns: 1fr !important; }

  /* Account overview grid → 1-col */
  .acct-overview-grid { grid-template-columns: 1fr !important; }

  /* Account financials figures → 1-col */
  .fin-figures { grid-template-columns: 1fr !important; }

  /* Settings sidebar → horizontal tabs */
  .settings-sidebar {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding-top: 0 !important;
    flex-direction: row !important;
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0 !important;
  }
  .settings-sidebar .side-item {
    white-space: nowrap;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 10px 14px !important;
    width: auto !important;
  }
  .settings-sidebar .side-item-active::before { display: none; }
  .settings-layout { flex-direction: column !important; }

  /* Accounts master/detail → stacked */
  .acct-layout { flex-direction: column !important; height: auto !important; }
  .acct-list { width: 100% !important; border-right: none !important;
    max-height: 50vh; border-bottom: 1px solid var(--border); }
  .acct-detail { height: auto; }

  /* Modal full-width */
  .modal { max-width: calc(100% - 24px); margin: 12px; }

  /* Toast position adjustment */
  .toast { left: 12px; right: 12px; max-width: none; bottom: 16px; }

  /* Tabs horizontal scroll */
  .tabrow { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; flex-shrink: 0; }

  /* Time window selector scroll */
  .tw-selector { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-shrink: 0; }
}

/* Timeline */
.tl { position: relative; padding-left: 22px; }
.tl::before {
  content: '';
  position: absolute;
  left: 5px; top: 10px; bottom: 10px;
  width: 1px;
  background: var(--border);
}
.tl-item { position: relative; padding: 10px 0; }
.tl-item::before {
  content: '';
  position: absolute; left: -21px; top: 18px;
  width: 11px; height: 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--text-tertiary);
}
.tl-item.tl-crit::before { border-color: var(--critical); background: var(--critical); }
.tl-item.tl-accent::before { border-color: var(--accent); background: var(--accent); }

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

/* ── Playbook ────────────────────────────────────────── */
@keyframes pbPulseRing {
  0% { transform: scale(0.6); opacity: 0.7; }
  80% { transform: scale(2.4); opacity: 0; }
  100% { opacity: 0; }
}

.pb-conn-strip {
  display: flex; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 24px;
}
.pb-conn-chip {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-right: 1px solid var(--border-soft); min-width: 0;
}
.pb-conn-chip:last-child { border-right: 0; }
.pb-conn-ico {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--surface-sunk); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-secondary);
  flex: 0 0 28px;
}
.pb-conn-body { display: flex; flex-direction: column; min-width: 0; }
.pb-conn-nm { font-size: 13px; color: var(--text); line-height: 1.2; }
.pb-conn-st { font-size: 12px; color: var(--success); margin-top: 2px; }
.pb-conn-warn { color: var(--critical); }

.pb-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 22px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.pb-banner strong { color: var(--text); font-weight: 500; }
.pb-banner-seg { display: inline-flex; align-items: center; gap: 8px; }
.pb-banner-dot { width: 7px; height: 7px; border-radius: 50%; }
.pb-banner-div { width: 1px; height: 14px; background: var(--border); }

.pb-stat-row {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 18px 0 32px 0;
}
.pb-stat-cell {
  padding: 18px 22px 20px;
  border-right: 1px solid var(--border);
}
.pb-stat-cell:last-child { border-right: 0; }
.pb-stat-val {
  font-family: var(--font-head); font-size: 36px; font-weight: 500;
  line-height: 1; letter-spacing: -0.02em; color: var(--text);
}

.pb-sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 32px 0 12px 0;
}
.pb-sec-ttl {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--text);
}
.pb-sec-meta {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.pb-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.pb-tile {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 18px 16px;
  display: grid; grid-template-rows: auto 1fr auto;
  gap: 14px; min-height: 200px;
  cursor: pointer; overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}
.pb-tile:hover { border-color: var(--text-tertiary); transform: translateY(-1px); }
.pb-tile-off { background: var(--surface-sunk); }
.pb-tile-off .pb-tile-name,
.pb-tile-off .pb-tile-desc,
.pb-tile-off .pb-metric { color: var(--text-tertiary); }

.pb-tile::before {
  content: ""; position: absolute;
  top: 0; left: 18px; right: 18px;
  height: 2px; background: transparent;
  border-radius: 0 0 2px 2px;
}
.pb-tile-running::before { background: var(--success); }
.pb-tile-watching::before { background: var(--success); }
.pb-tile-locked { background: var(--surface-sunk); cursor: not-allowed; }
.pb-tile-locked:hover { transform: none; border-color: var(--border); }
.pb-tile-locked .pb-tile-name,
.pb-tile-locked .pb-tile-desc,
.pb-tile-locked .pb-metric { color: var(--text-tertiary); }

.pb-lock-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 18px; border-radius: 999px;
  border: 1px dashed var(--border); background: transparent;
  color: var(--text-tertiary);
}

.pb-build-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 4px;
}
.pb-build-swatch { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.pb-build-done { color: var(--success); }
.pb-build-done .pb-build-swatch { background: var(--success); position: relative; }
.pb-build-done .pb-build-swatch::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%; border: 1px solid var(--success);
  animation: pbPulseRing 1.8s ease-out infinite; opacity: 0;
}
.pb-build-locked { color: var(--text-tertiary); }

.pb-tile-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.pb-tile-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pb-tile-name {
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.005em; line-height: 1.25; color: var(--text);
}
.pb-tile-desc {
  font-size: 12.5px; color: var(--text-tertiary);
  line-height: 1.4; text-wrap: pretty;
}

.pb-tile-body {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
}
.pb-metric-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-tertiary);
}
.pb-metric {
  font-family: var(--font-head); font-size: 28px; font-weight: 500;
  line-height: 1; letter-spacing: -0.02em; color: var(--text); margin-top: 2px;
}
.pb-metric-good { color: var(--success); }
.pb-metric-bad { color: var(--critical); }
.pb-metric-unit {
  font-size: 15px; color: var(--text-tertiary);
  margin-left: 4px; letter-spacing: 0; font-weight: 400;
}
.pb-metric-dash {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-tertiary);
  font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase;
}

.pb-tile-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary);
}
.pb-foot-status {
  display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary);
}
.pb-foot-off { color: var(--text-tertiary); }
.pb-foot-cad { color: var(--text-tertiary); }

.pb-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; position: relative;
}
.pb-dot-on { background: var(--success); }
.pb-dot-on::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%; border: 1px solid var(--success);
  animation: pbPulseRing 1.8s ease-out infinite; opacity: 0;
}
.pb-dot-off { background: var(--border); }

.pb-toggle {
  --w: 30px; --h: 18px;
  width: var(--w); height: var(--h);
  border-radius: 999px; background: var(--border);
  position: relative; cursor: pointer;
  transition: background 160ms ease;
  flex: 0 0 auto; border: 1px solid var(--border);
}
.pb-toggle::after {
  content: ""; position: absolute; top: 1.5px; left: 1.5px;
  width: 13px; height: 13px;
  border-radius: 50%; background: var(--surface);
  transition: transform 160ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.pb-toggle-on { background: var(--text); }
.pb-toggle-on::after { transform: translateX(11px); }

.pb-empty {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px;
  color: var(--text-tertiary); font-size: 13px;
}

/* Configure detail */
.pb-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-secondary); text-decoration: none; font-size: 13px;
  margin-bottom: 18px; cursor: pointer;
  border: 0; background: transparent; padding: 0;
  font-family: var(--font-body);
}
.pb-back:hover { color: var(--text); }

.pb-config-head {
  padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 28px;
}
.pb-config-crumbs {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px;
}
.pb-config-title-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
}
.pb-config-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-secondary);
}

.pb-config-section {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 36px; padding: 22px 0;
  border-bottom: 1px solid var(--border-soft); align-items: start;
}
.pb-config-lhs h3 {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--text); font-weight: 500; margin: 4px 0 6px 0;
}
.pb-config-lhs p {
  color: var(--text-tertiary); font-size: 12.5px; margin: 0; line-height: 1.45;
}
.pb-config-rhs { min-width: 0; }

.pb-slot-sentence {
  font-size: 17px; line-height: 1.7; color: var(--text); text-wrap: pretty; margin: 0;
}
.pb-slot {
  color: var(--accent); border-bottom: 1px dashed var(--accent);
  padding: 0 1px; cursor: text; border-radius: 1px;
}
.pb-slot:hover { background: var(--accent-soft); }
.pb-slot:focus { outline: none; background: var(--accent-soft); border-bottom-style: solid; }

.pb-opt-list { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.pb-opt {
  display: grid; grid-template-columns: 18px 1fr; gap: 12px;
  align-items: start; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: pointer;
}
.pb-opt:hover { border-color: var(--text-tertiary); }
.pb-opt-sel { border-color: var(--accent); background: var(--accent-soft); }
.pb-radio {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--border); margin-top: 2px;
  position: relative; background: var(--surface-sunk);
}
.pb-opt-sel .pb-radio { border-color: var(--accent); }
.pb-opt-sel .pb-radio::after {
  content: ""; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--accent);
}
.pb-opt-nm { font-size: 14px; color: var(--text); }
.pb-opt-ds { font-size: 12.5px; color: var(--text-tertiary); margin-top: 2px; line-height: 1.4; }

.pb-freq {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); overflow: hidden;
}
.pb-freq input {
  width: 70px; border: 0; background: transparent;
  font-family: var(--font-body); font-size: 14px;
  padding: 8px 12px; color: var(--text); text-align: right;
}
.pb-freq input:focus { outline: none; background: var(--surface-hover); box-shadow: none; }
.pb-freq-div { width: 1px; background: var(--border); }
.pb-freq select {
  border: 0; background: transparent;
  font-family: var(--font-body); font-size: 13px;
  padding: 8px 28px 8px 12px; color: var(--text-secondary);
  cursor: pointer;
}
.pb-freq-static {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-secondary);
}

.pb-notif-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border-soft);
}
.pb-notif-row:last-child { border-bottom: 0; }

.pb-runs {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.pb-run {
  display: grid; grid-template-columns: 110px 1fr auto;
  gap: 16px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.pb-run:last-child { border-bottom: 0; }
.pb-run-when { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.04em; }
.pb-run-desc { color: var(--text-secondary); }
.pb-run-out {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary);
  letter-spacing: 0.04em; text-transform: uppercase;
}

.pb-saved {
  position: fixed; bottom: 24px; right: 24px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-secondary);
  opacity: 0; transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none; z-index: 90;
}
.pb-saved-show { opacity: 1; transform: translateY(0); }

/* Tabs */
.pb-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border); margin: 0 0 24px;
}
.pb-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px 18px; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary);
  cursor: pointer; transition: color 150ms, border-color 150ms;
}
.pb-tab:hover { color: var(--text-secondary); }
.pb-tab-active { color: var(--text); border-bottom-color: var(--text); }

/* Activity timeline */
.pb-activity-panel { min-height: 200px; }
.pb-timeline { display: flex; flex-direction: column; gap: 0; }
.pb-timeline-group { margin-bottom: 20px; }
.pb-timeline-date {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-tertiary);
  padding: 0 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 0;
}
.pb-timeline-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border-dim, rgba(128,128,128,0.08));
  align-items: flex-start;
}
.pb-timeline-item:last-child { border-bottom: 0; }
.pb-timeline-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0;
  background: var(--success);
}
.pb-timeline-failed .pb-timeline-dot { background: var(--danger, #e55); }
.pb-timeline-content { flex: 1; min-width: 0; }
.pb-timeline-summary {
  font-size: 14px; color: var(--text); line-height: 1.5; margin-bottom: 6px;
}
.pb-timeline-meta {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.pb-timeline-badge {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 4px;
}
.pb-timeline-badge-done {
  background: rgba(74,222,128,0.12); color: var(--success);
}
.pb-timeline-badge-failed {
  background: rgba(239,68,68,0.12); color: var(--danger, #e55);
}
.pb-timeline-time {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary);
  letter-spacing: 0.04em;
}
.pb-timeline-signal {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary);
  letter-spacing: 0.04em; background: var(--surface-sunk);
  padding: 2px 6px; border-radius: 3px;
}

@media (max-width: 768px) {
  .pb-conn-strip { flex-wrap: wrap; }
  .pb-conn-chip { flex: 1 1 45%; }
  .pb-config-section { grid-template-columns: 1fr; gap: 14px; }
  .pb-stat-row { grid-template-columns: 1fr; }
  .pb-stat-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .pb-config-title-row { flex-direction: column; gap: 12px; }
  .pb-tiles { grid-template-columns: 1fr; }
}
