:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #18202a;
  --muted: #687385;
  --line: #dfe4ea;
  --green: #17824d;
  --green-soft: #e7f5ed;
  --red: #ba2f3a;
  --red-soft: #fdecee;
  --amber: #9b6a00;
  --amber-soft: #fff4d8;
  --blue: #1f66d1;
  --blue-soft: #eaf1ff;
  --teal: #0f7c85;
  --input-bg: #ffffff;
  --subtle-bg: #eef2f6;
  --hover-bg: #f3f7fb;
  --code-bg: #f5f7fa;
  --shadow: 0 1rem 2.25rem rgba(24, 32, 42, 0.08);
  color-scheme: light;
  font-family:
    Roboto, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  --bg: #11151c;
  --panel: #1b2029;
  --ink: #f4f7fb;
  --muted: #a8b3c3;
  --line: #303846;
  --green-soft: #123625;
  --red-soft: #3c171d;
  --amber-soft: #34260d;
  --blue-soft: #142844;
  --teal: #8ee5d0;
  --input-bg: #141a23;
  --subtle-bg: #252c37;
  --hover-bg: #242c38;
  --code-bg: #121821;
  --shadow: 0 1rem 2.25rem rgba(0, 0, 0, 0.22);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31, 102, 209, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(15, 124, 133, 0.1), transparent 24%),
    var(--bg);
  color: var(--ink);
}

html.logs-table-active,
body.logs-table-active,
html.config-panel-active,
body.config-panel-active {
  height: 100vh;
  overflow: hidden;
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(135deg, rgba(31, 102, 209, 0.16), transparent 28%),
    linear-gradient(315deg, rgba(15, 124, 133, 0.18), transparent 24%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 13.75rem minmax(0, 1fr);
  min-height: 100vh;
}

.logs-table-active .app-shell,
.config-panel-active .app-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.125rem;
  background: #171b22;
  color: #f8fafc;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  border: 0.0625rem solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
  background: #ffffff;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.mini-label {
  color: #aeb8c7;
  font-size: 0.75rem;
}

.nav {
  display: grid;
  gap: 0.5rem;
}

.signed-out .nav,
.signed-out .sidebar-footer {
  display: none;
}

.booting #authPanel,
.booting #dashboard,
.booting #alert,
.booting .nav,
.booting .sidebar-footer,
.booting .profile-menu {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.625rem;
  border: 0;
  border-radius: 0.5rem;
  padding: 0 0.75rem;
  background: transparent;
  color: #dbe4ef;
  text-align: left;
}

.nav-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  color: #95d9c3;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.12);
}

.sidebar-user {
  overflow: hidden;
  margin-top: 0.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  padding: 0.875rem 1.25rem 1.25rem;
}

.logs-table-active .main,
.config-panel-active .main {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.logs-table-active #dashboard,
.config-panel-active #dashboard {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.topbar,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar {
  align-items: flex-start;
  margin-bottom: 0.875rem;
}

.topbar-title {
  display: grid;
  gap: 0;
  min-width: 0;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.top-back {
  flex: 0 0 2.625rem;
}

.top-back svg {
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.breadcrumbs {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.breadcrumb-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 900;
}

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

.breadcrumb-separator {
  color: #9aa5b5;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
}

h2 {
  font-size: 1.5rem;
}

.topbar-actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.topbar-actions {
  align-items: center;
  padding-top: 0.25rem;
}

.profile-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 0.3125rem 0.75rem 0.3125rem 0.5rem;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.user-avatar {
  display: grid;
  width: 2.125rem;
  height: 2.125rem;
  place-items: center;
  border-radius: 0.5rem;
  background: var(--blue);
  color: #ffffff;
  font-weight: 900;
}

.user-menu-copy {
  display: grid;
  min-width: 6rem;
  text-align: left;
}

.chevron-icon {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 11.25rem;
  overflow: hidden;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.profile-dropdown button {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.625rem;
  border: 0;
  padding: 0 0.875rem;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.profile-dropdown svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  color: var(--teal);
}

.profile-dropdown button:hover,
.profile-dropdown button:focus-visible {
  background: var(--hover-bg);
  outline: none;
}

.icon-btn,
.text-btn,
.primary-btn,
.danger-btn {
  position: relative;
  min-height: 2.5rem;
  border-radius: 0.5rem;
  border: 0.0625rem solid var(--line);
  padding: 0 0.875rem;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.text-btn.is-loading {
  color: var(--muted);
}

.text-btn.is-loading::before {
  width: 0.875rem;
  height: 0.875rem;
  flex: 0 0 0.875rem;
  border: 0.125rem solid color-mix(in srgb, currentColor 32%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  content: "";
  animation: refresh-spin 700ms linear infinite;
}

.icon-btn {
  display: grid;
  width: 2.625rem;
  padding: 0;
  place-items: center;
}

.primary-btn {
  border-color: #145cc4;
  background: #1f66d1;
  color: #ffffff;
}

.danger-btn {
  border-color: #ba2f3a;
  background: var(--red-soft);
  color: var(--red);
}

.ghost {
  background: transparent;
}

.profile-page {
  display: grid;
  gap: 1.125rem;
  max-width: 57.5rem;
}

.profile-card {
  display: grid;
  gap: 0.875rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 1.375rem;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.profile-card h3 {
  margin: 0;
  font-size: 1.125rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
}

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

.icon-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-text-btn svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 4%;
  background: rgba(10, 16, 24, 0.52);
}

.modal-card {
  display: grid;
  width: min(32.5rem, 100%);
  gap: 1.5rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 2.25rem;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3%;
}

.modal-header .icon-btn {
  width: 3rem;
  min-height: 3rem;
  flex: 0 0 3rem;
  padding: 0;
}

.modal-header svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.modal-alert {
  border: 0.0625rem solid var(--red-soft);
  border-left: 0.25rem solid var(--red);
  border-radius: 0.5rem;
  padding: 0.75rem 0.875rem;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}

.modal-card .profile-form {
  display: grid;
  gap: 1.5rem;
}

.modal-card label {
  gap: 0.65rem;
}

.modal-card .password-field input {
  min-height: 3rem;
}

.modal-card .primary-btn {
  justify-self: start;
  min-height: 3rem;
  margin-top: 0.35rem;
  padding: 0 1.5rem;
}

.confirm-card {
  width: min(30rem, 100%);
  gap: 1.5rem;
  padding: 2rem;
}

.confirm-copy {
  display: grid;
  gap: 0.625rem;
}

.confirm-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
}

.theme-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin: 0;
  border: 0;
  padding: 0;
}

.theme-options legend {
  grid-column: 1 / -1;
  margin-bottom: 0.125rem;
  color: var(--ink);
  font-weight: 700;
}

.theme-option {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.625rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 0 0.75rem;
  background: var(--input-bg);
}

.theme-option input {
  width: 1.125rem;
  min-height: 1.125rem;
}

.alert {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1rem;
  border: 0.0625rem solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 0.5rem;
  padding: 0.875rem 0.875rem 0.875rem 1rem;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--blue-soft) 72%, transparent), transparent 72%),
    var(--panel);
  box-shadow: 0 0.875rem 2rem rgba(24, 32, 42, 0.12);
}

.alert-icon {
  display: inline-grid;
  width: 2.25rem;
  min-height: 2.25rem;
  place-items: center;
  border-radius: 0.5rem;
  background: var(--blue);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 900;
}

.alert-copy {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.alert-copy strong {
  color: var(--ink);
  font-size: 0.875rem;
}

.alert-copy span {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.alert-close {
  display: grid;
  width: 2rem;
  min-height: 2rem;
  place-items: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.alert-close:hover,
.alert-close:focus-visible {
  background: var(--hover-bg);
  color: var(--ink);
}

.alert.error {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--red-soft) 78%, transparent), transparent 72%),
    var(--panel);
}

.alert.error .alert-icon {
  background: var(--red);
}

.alert.success {
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--green-soft) 78%, transparent), transparent 72%),
    var(--panel);
}

.alert.success .alert-icon {
  background: var(--green);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(20rem, 35rem);
  justify-content: center;
  max-width: none;
}

.auth-visual,
.auth-box,
.metric,
.config-form,
.table-wrap,
.code-preview,
.danger-zone {
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-visual {
  position: relative;
  display: flex;
  min-height: 26.25rem;
  align-items: center;
  justify-content: center;
  gap: 3.25rem;
  overflow: hidden;
}

.auth-visual::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(24, 32, 42, 0.05) 0.0625rem, transparent 0.0625rem),
    linear-gradient(90deg, rgba(24, 32, 42, 0.05) 0.0625rem, transparent 0.0625rem);
  background-size: 1.75rem 1.75rem;
  content: "";
}

.flow-node {
  position: relative;
  z-index: 1;
  display: grid;
  width: 6rem;
  height: 6rem;
  place-items: center;
  border-radius: 0.5rem;
  color: #ffffff;
  font-size: 1.875rem;
  font-weight: 900;
}

.flow-node.rd {
  background: #19a76f;
}

.flow-node.stape {
  background: #1f66d1;
}

.flow-line {
  position: relative;
  z-index: 1;
  width: 6.25rem;
  height: 0.375rem;
  border-radius: 62.4375rem;
  background: linear-gradient(90deg, #19a76f, #1f66d1);
}

.auth-box,
.config-form {
  padding: 1.125rem;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin-bottom: 1.125rem;
  padding: 0.25rem;
  border-radius: 0.5rem;
  background: var(--subtle-bg);
}

.segment {
  min-height: 2.375rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  font-weight: 800;
}

.segment.active {
  background: var(--panel);
  box-shadow: 0 0.375rem 1.125rem rgba(24, 32, 42, 0.08);
}

.form,
.config-form {
  display: grid;
  gap: 0.875rem;
}

.stape-config-panel {
  display: grid;
  gap: 1.25rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 1.75rem;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.config-panel-active .view.active[data-view-panel="config"] {
  flex: 1;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.config-panel-active .stape-config-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.config-brand {
  display: block;
}

.mapping-section h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.config-brand p,
.stape-help,
.stape-help-inline {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.stape-help-inline a {
  color: var(--green);
}

.backfill-status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
}

.backfill-status-line:empty {
  display: none;
}

.backfill-status-line.is-running::before,
.backfill-status-line.is-complete::before,
.backfill-status-line.is-error::before,
.backfill-status-line.is-aborted::before {
  display: inline-grid;
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 1.125rem;
  border-radius: 50%;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 900;
  content: "";
}

.backfill-status-line.is-running::before {
  border: 0.125rem solid color-mix(in srgb, var(--teal) 35%, transparent);
  border-top-color: var(--teal);
  animation: refresh-spin 700ms linear infinite;
}

.backfill-status-line.is-complete {
  color: var(--green);
}

.backfill-status-line.is-complete::before {
  background: var(--green-soft);
  color: var(--green);
  content: "✓";
}

.backfill-status-line.is-error,
.backfill-status-line.is-aborted {
  color: var(--red);
}

.backfill-status-line.is-error::before,
.backfill-status-line.is-aborted::before {
  background: var(--red-soft);
  color: var(--red);
  content: "!";
}

.backfill-abort-btn {
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
}

.backfill-abort-btn:hover,
.backfill-abort-btn:focus-visible {
  color: #df4a56;
}

.stape-account-link {
  color: #ff6b2c;
  font-weight: 900;
  text-decoration-color: rgba(255, 107, 44, 0.55);
  text-decoration-thickness: 0.125rem;
  text-underline-offset: 0.1875rem;
}

.stape-account-link:hover,
.stape-account-link:focus-visible {
  color: #ff7f3f;
  text-decoration-color: currentColor;
}

.config-tabs {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  border-bottom: 0.0625rem solid var(--line);
}

.config-tab {
  min-height: 2.625rem;
  border: 0;
  border-bottom: 0.125rem solid transparent;
  padding: 0 0 0.75rem;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.config-tab.active {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.config-tab-panel {
  display: none;
}

.config-tab-panel.active {
  display: grid;
  gap: 1.25rem;
}

.config-panel-active .config-tab-panel.active {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.25rem;
  scrollbar-gutter: stable;
}

.stape-status-row,
.inline-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.stape-status-label,
.inline-toggle-row span:first-child {
  min-width: 9.375rem;
  color: var(--ink);
  font-weight: 800;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
}

.toggle-switch input {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  opacity: 0;
}

.toggle-switch span:last-child {
  position: relative;
  display: inline-block;
  width: 2.125rem;
  height: 1.125rem;
  border-radius: 62.4375rem;
  background: #c8d0dc;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.toggle-switch span:last-child::after {
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 62.4375rem;
  background: #ffffff;
  content: "";
  transition: transform 160ms ease;
}

.toggle-switch input:checked + span:last-child {
  background: var(--green);
  box-shadow: 0 0 0 0.1875rem rgba(23, 130, 77, 0.12);
}

.toggle-switch input:checked + span:last-child::after {
  transform: translateX(1rem);
}

.stape-runtime-badge {
  display: inline-flex;
  min-height: 1.625rem;
  align-items: center;
  border-radius: 62.4375rem;
  padding: 0 0.875rem;
  font-size: 0.75rem;
  font-weight: 900;
}

.stape-runtime-badge.running {
  border: 0.0625rem solid var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.stape-runtime-badge.inactive {
  border: 0.0625rem solid #d6dee8;
  background: #f3f6f9;
  color: #5c6675;
}

.stape-field-grid {
  display: grid;
  grid-template-columns: 11.25rem minmax(0, 1fr);
  gap: 0.625rem 1rem;
  align-items: center;
}

.stape-field-grid label {
  display: contents;
  color: var(--ink);
}

.stape-field-grid label > input,
.stape-field-grid label > select {
  grid-column: 2;
}

.stape-field-grid label::first-line {
  font-weight: 800;
}

.stape-field-grid .stape-help-inline {
  grid-column: 2;
  margin: 0 0 0.875rem;
}

.stape-field-grid .stape-help-stacked {
  margin-top: -0.25rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.stape-help-stacked a {
  display: inline-block;
  margin-top: 0.1875rem;
}

.stape-config-panel input,
.stape-config-panel select {
  border-color: var(--line);
  background: var(--input-bg);
  color: var(--ink);
}

.stape-config-panel input.config-field-error,
.stape-config-panel select.config-field-error {
  border-color: var(--red);
  box-shadow: 0 0 0 0.1875rem rgba(186, 47, 58, 0.14);
}

.stape-config-panel input.config-field-error:focus,
.stape-config-panel select.config-field-error:focus {
  outline: 0;
  border-color: var(--red);
  box-shadow: 0 0 0 0.25rem rgba(186, 47, 58, 0.2);
}

.stape-config-panel input::placeholder {
  color: #8c97a8;
}

.mapping-section {
  display: grid;
  gap: 0.625rem;
}

.mapping-rows {
  display: grid;
  gap: 0.5rem;
}

.mapping-row {
  display: grid;
  grid-template-columns: 1.5rem minmax(9.375rem, 1fr) minmax(13.75rem, 1.5fr) 2.25rem;
  gap: 0;
  min-height: 2.5rem;
  align-items: center;
  overflow: visible;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  background: var(--input-bg);
}

.trigger-mapping-row {
  grid-template-columns:
    1.5rem
    minmax(8rem, 0.7fr)
    minmax(14rem, 1.4fr)
    minmax(12rem, 1fr)
    2.25rem;
}

.mapping-row input,
.mapping-row select {
  min-width: 0;
  min-height: 2.375rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mapping-row input + select,
.mapping-row select + select,
.mapping-row select + input {
  border-left: 0.0625rem solid var(--line);
}

.mapping-row input + .native-enhanced-select + .custom-select,
.mapping-row select + .native-enhanced-select + .custom-select {
  border-left: 0.0625rem solid var(--line);
}

.drag-handle {
  color: #8c97a8;
  text-align: center;
  font-weight: 900;
}

.row-action-btn {
  display: grid;
  width: 2.25rem;
  min-height: 2.375rem;
  place-items: center;
  border: 0;
  border-left: 0.0625rem solid var(--line);
  background: transparent;
  color: #6f7a8a;
  font-weight: 900;
}

.row-action-btn:hover,
.row-action-btn:focus-visible {
  color: var(--red);
  background: var(--red-soft);
}

.add-row-btn {
  min-height: 2.5rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--green);
  font-weight: 900;
}

.stape-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.875rem;
  padding-top: 1.125rem;
  border-top: 0.0625rem solid var(--line);
}

.save-connect-btn {
  min-width: 10.5rem;
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.coming-soon {
  min-height: 10rem;
  display: grid;
  place-items: center;
  border: 0.0625rem dashed var(--line);
  border-radius: 0.5rem;
  color: var(--muted);
  font-weight: 800;
}

label {
  display: grid;
  gap: 0.375rem;
  color: var(--ink);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.625rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 0.5625rem 0.625rem;
  background: var(--input-bg);
  color: var(--ink);
}

select option,
select optgroup {
  background: var(--input-bg);
  color: var(--ink);
}

select option:checked {
  background: var(--blue);
  color: #ffffff;
}

.native-enhanced-select {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  position: relative;
  min-width: 0;
}

.stape-field-grid label > .custom-select {
  grid-column: 2;
}

.custom-select-button {
  display: flex;
  width: 100%;
  min-height: 2.625rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 0.5625rem 0.625rem;
  background: var(--input-bg);
  color: var(--ink);
  text-align: left;
}

.custom-select-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-button svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.custom-select-button:hover,
.custom-select-button:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  outline: none;
}

.custom-select.is-open .custom-select-button {
  border-color: var(--teal);
  box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--teal) 18%, transparent);
}

.custom-select.is-disabled .custom-select-button {
  cursor: not-allowed;
  opacity: 0.65;
}

.mapping-row .custom-select-button {
  min-height: 2.375rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: min(18rem, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  background: var(--input-bg);
  box-shadow: var(--shadow);
  scrollbar-gutter: stable;
}

.mapping-row .custom-select-menu {
  max-height: min(12.5rem, 34vh);
  overflow-y: scroll;
}

.custom-select-menu::-webkit-scrollbar {
  width: 0.75rem;
}

.custom-select-menu::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--input-bg) 70%, var(--line));
}

.custom-select-menu::-webkit-scrollbar-thumb {
  border: 0.1875rem solid color-mix(in srgb, var(--input-bg) 70%, var(--line));
  border-radius: 62.4375rem;
  background: color-mix(in srgb, var(--muted) 70%, var(--line));
}

.custom-select-menu {
  scrollbar-color: color-mix(in srgb, var(--muted) 70%, var(--line))
    color-mix(in srgb, var(--input-bg) 70%, var(--line));
}

.custom-select-group-label {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.5rem 0.75rem 0.3125rem;
  background: var(--input-bg);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-select-option {
  display: block;
  width: 100%;
  min-height: 2.25rem;
  border: 0;
  border-radius: 0;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  background: var(--hover-bg);
  outline: none;
}

.custom-select-option.is-selected {
  background: var(--blue);
  color: #ffffff;
}

.native-enhanced-select.config-field-error + .custom-select .custom-select-button {
  border-color: var(--red);
  box-shadow: 0 0 0 0.1875rem rgba(186, 47, 58, 0.14);
}

.mapping-row .native-enhanced-select.config-field-error + .custom-select .custom-select-button {
  box-shadow: inset 0 0 0 0.0625rem var(--red);
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.375rem;
  top: 50%;
  display: grid;
  width: 2.125rem;
  height: 2.125rem;
  min-height: 2.125rem;
  place-items: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--subtle-bg);
}

.password-eye {
  position: relative;
  display: block;
  width: 1.1875rem;
  height: 0.75rem;
  border: 0.125rem solid currentColor;
  border-radius: 50%;
}

.password-eye::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.3125rem;
  height: 0.3125rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.password-toggle.is-visible .password-eye::before {
  position: absolute;
  top: 0.25rem;
  left: -0.1875rem;
  width: 1.5rem;
  height: 0.125rem;
  border-radius: 62.4375rem;
  background: currentColor;
  content: "";
  transform: rotate(-34deg);
}

textarea {
  resize: vertical;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.view {
  display: none;
}

.view.active {
  position: relative;
  display: grid;
  gap: 1.125rem;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    filter 180ms ease;
}

.view.active.is-refreshing {
  opacity: 1;
  filter: none;
  pointer-events: none;
  transform: none;
}

.view.active.is-refreshing::before,
.view.active.is-refreshing::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.view.active.is-refreshing::before {
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  height: 0.25rem;
  overflow: hidden;
  border-radius: 62.4375rem;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      var(--teal) 35%,
      color-mix(in srgb, var(--blue) 72%, var(--teal)) 50%,
      var(--teal) 65%,
      transparent 100%
    );
  background-size: 45% 100%;
  box-shadow: 0 0 1.125rem color-mix(in srgb, var(--teal) 42%, transparent);
  animation: refresh-bar 760ms ease-in-out infinite;
}

.view.active.is-refreshing::after {
  inset: 0;
  z-index: 2;
  border-radius: 0.75rem;
  background:
    linear-gradient(
      100deg,
      transparent 0%,
      color-mix(in srgb, var(--teal) 7%, transparent) 42%,
      color-mix(in srgb, var(--teal) 20%, transparent) 50%,
      color-mix(in srgb, var(--teal) 7%, transparent) 58%,
      transparent 100%
    );
  background-size: 220% 100%;
  opacity: 0.9;
  animation: refresh-sheen 850ms ease-in-out infinite;
}

.view.active.is-refreshing > * {
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.view.active.is-refreshing > *:not(.section-header) {
  opacity: 0.72;
}

.logs-table-active .view.active[data-view-panel="webhooks"],
.logs-table-active .view.active[data-view-panel="outgoing"] {
  flex: 1;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

body.is-revealing .main {
  animation: smooth-page-reveal 260ms ease both;
}

body.is-revealing .sidebar {
  animation: smooth-page-reveal 300ms ease both;
}

.is-loading {
  opacity: 0.78;
}

@keyframes smooth-page-reveal {
  from {
    opacity: 0;
    transform: translateY(0.375rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes refresh-sheen {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

@keyframes refresh-bar {
  from {
    background-position: 130% 0;
  }

  to {
    background-position: -30% 0;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .view.active,
  body.is-revealing .main,
  body.is-revealing .sidebar,
  .view.active.is-refreshing > * {
    animation: none;
    transition: none;
  }

  .view.active.is-refreshing::after,
  .text-btn.is-loading::before,
  .backfill-status-line.is-running::before {
    animation: none;
  }
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.875rem;
}

.overview-greeting {
  display: grid;
  gap: 0.25rem;
  padding: 0.25rem 0 0.125rem;
}

.overview-greeting h2 {
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
}

.overview-greeting p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.metric {
  min-height: 7rem;
  padding: 1rem;
}

.metric span {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.125rem;
}

.metadata-sync-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 1rem;
  background: var(--panel);
}

.metadata-sync-panel h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.metadata-sync-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.metadata-sync-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.webhook-section-heading {
  display: grid;
  gap: 0.125rem;
  margin-top: 0.75rem;
}

.webhook-section-heading h3 {
  margin: 0;
  font-size: 1.125rem;
}

.webhook-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
  gap: 0.75rem;
}

.webhook-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.25rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 0 0.875rem;
  background: var(--panel);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.625rem;
  border-radius: 62.4375rem;
  padding: 0 0.625rem;
  background: var(--subtle-bg);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
  text-transform: uppercase;
}

.badge.active,
.badge.sent,
.badge.processed {
  background: var(--green-soft);
  color: var(--green);
}

.badge.failed,
.badge.error,
.badge.disconnected {
  background: var(--red-soft);
  color: var(--red);
}

.badge.received,
.badge.queued {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.ignored,
.badge.skipped,
.badge.not_connected {
  background: var(--amber-soft);
  color: var(--amber);
}

.danger-zone {
  display: flex;
  justify-content: flex-end;
  padding: 0.875rem;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.switch-row input {
  width: 1.25rem;
  min-height: 1.25rem;
}

.filters select,
.filters input {
  max-width: 13.75rem;
}

.log-actions {
  display: flex;
  flex: 1;
  max-width: 40rem;
  gap: 0.625rem;
}

.log-toolbar {
  align-items: center;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  color: var(--muted);
  font-weight: 800;
}

.table-wrap {
  margin-top: 0.75rem;
  min-height: 0;
  max-height: min(37.5rem, calc(100vh - 18rem));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  min-width: 47.5rem;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 0.0625rem solid var(--line);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

td {
  overflow-wrap: anywhere;
}

tr:last-child td {
  border-bottom: 0;
}

.webhook-panel table {
  min-width: 100%;
  table-layout: fixed;
}

.webhook-panel th:nth-child(1),
.webhook-panel td:nth-child(1) {
  width: 15%;
}

.webhook-panel th:nth-child(2),
.webhook-panel td:nth-child(2) {
  width: 16%;
}

.webhook-panel th:nth-child(3),
.webhook-panel td:nth-child(3) {
  width: 21%;
}

.webhook-panel th:nth-child(4),
.webhook-panel td:nth-child(4) {
  width: 13%;
}

.webhook-panel th:nth-child(5),
.webhook-panel td:nth-child(5) {
  width: 15%;
}

.webhook-panel th:nth-child(6),
.webhook-panel td:nth-child(6) {
  width: 14%;
}

.webhook-panel th:nth-child(7),
.webhook-panel td:nth-child(7) {
  width: 6%;
  text-align: center;
}

.request-log-table table {
  min-width: 100%;
  table-layout: fixed;
}

.request-log-table th:nth-child(1),
.request-log-table td:nth-child(1) {
  width: 16%;
}

.request-log-table th:nth-child(2),
.request-log-table td:nth-child(2) {
  width: 12%;
}

.request-log-table th:nth-child(3),
.request-log-table td:nth-child(3) {
  width: 9%;
  text-align: right;
}

.request-log-table th:nth-child(4),
.request-log-table td:nth-child(4) {
  width: 46%;
}

.request-log-table th:nth-child(5),
.request-log-table td:nth-child(5) {
  width: 11%;
  white-space: nowrap;
}

.request-log-table th:nth-child(6),
.request-log-table td:nth-child(6) {
  text-align: center;
  width: 6%;
}

.log-row:hover {
  background: var(--hover-bg);
}

.log-action-cell {
  white-space: nowrap;
}

.detail-action-btn {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  background: var(--input-bg);
  color: var(--teal);
  box-shadow: none;
}

.detail-action-btn:hover,
.detail-action-btn:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  background: var(--subtle-bg);
  outline: none;
}

.detail-action-btn svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.url-cell {
  max-width: 32.5rem;
  color: var(--ink);
}

.webhook-panel,
.webhook-detail,
.outgoing-panel,
.outgoing-detail {
  display: grid;
  gap: 1.125rem;
}

.logs-table-active .webhook-panel,
.logs-table-active .outgoing-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.webhook-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.outgoing-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.logs-table-active .webhook-panel .table-wrap,
.logs-table-active .outgoing-panel .table-wrap {
  height: 100%;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.view > .section-header {
  display: none;
}

.webhook-panel > .panel-title-header {
  display: none;
}

.outgoing-title-header {
  justify-content: flex-start;
}

.outgoing-title-header > div,
.outgoing-title-header #loadOutgoingLogsBtn {
  display: none;
}

.log-detail-card {
  display: grid;
  gap: 1.125rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 1.375rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.125rem 1.75rem;
}

.detail-grid div {
  display: grid;
  gap: 0.375rem;
  min-width: 0;
}

.detail-grid .wide {
  grid-column: span 2;
}

.detail-grid span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.detail-grid strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.log-detail-card h3 {
  margin: 0.625rem 0 -0.375rem;
  padding-bottom: 0.5rem;
  border-bottom: 0.0625rem solid var(--line);
  font-size: 0.9375rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-code {
  overflow: auto;
  max-height: 26.25rem;
  margin: 0;
  border-radius: 0.5rem;
  padding: 0.875rem;
  background: var(--code-bg);
  color: var(--ink);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.related-log-list {
  display: grid;
  gap: 0.5rem;
}

.related-log-row {
  display: grid;
  grid-template-columns: minmax(11.25rem, 1fr) minmax(10rem, auto) minmax(15rem, 1.4fr);
  gap: 0.875rem;
  align-items: center;
  width: 100%;
  min-height: 3.625rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--input-bg);
  color: var(--ink);
  text-align: left;
}

.related-log-row:hover,
.related-log-row:focus-visible {
  border-color: #b9c7d8;
  background: var(--hover-bg);
  outline: none;
}

.related-log-main {
  display: grid;
  gap: 0.1875rem;
  min-width: 0;
}

.related-log-main small {
  color: var(--muted);
  font-weight: 700;
}

.related-log-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  color: var(--muted);
  font-weight: 800;
}

.related-empty {
  border: 0.0625rem dashed var(--line);
  border-radius: 0.5rem;
  padding: 0.875rem;
  color: var(--muted);
  font-weight: 800;
}

.code-preview {
  overflow: auto;
  padding: 1rem;
  color: #e8eef7;
  background: #151a21;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

@media (max-width: 61.25rem) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .config-panel-active .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(5.25rem, 1fr));
    overflow-x: auto;
  }

  .nav-item {
    justify-content: center;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 1.125rem;
  }

  .auth-layout,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .metadata-sync-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .metadata-sync-actions {
    justify-content: flex-start;
  }

  .table-wrap {
    max-height: min(34rem, calc(100vh - 16rem));
  }

  .auth-visual {
    min-height: 13.75rem;
  }
}

@media (max-width: 38.75rem) {
  .topbar,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .section-header .primary-btn,
  .section-header .text-btn,
  .section-header .danger-btn {
    width: 100%;
  }

  .icon-btn {
    width: 100%;
  }

  .top-back {
    width: 2.625rem;
    flex-basis: 2.625rem;
  }

  .nav {
    grid-template-columns: repeat(5, 7.375rem);
  }

  .table-wrap {
    max-height: min(30rem, calc(100vh - 14rem));
  }

  .auth-visual {
    display: none;
  }

  .filters select,
  .filters input {
    max-width: none;
  }

  .log-actions,
  .log-toolbar {
    max-width: none;
    flex-direction: column;
    align-items: stretch;
  }

  .pager {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid .wide {
    grid-column: auto;
  }

  .profile-grid,
  .theme-options {
    grid-template-columns: 1fr;
  }

  .security-card {
    align-items: stretch;
    flex-direction: column;
  }

  .related-log-row {
    grid-template-columns: 1fr;
  }

  .related-log-meta {
    justify-content: flex-start;
  }

  .stape-config-panel {
    padding: 1.75rem;
  }

  .stape-field-grid {
    grid-template-columns: 1fr;
  }

  .stape-field-grid label {
    display: grid;
    gap: 0.375rem;
  }

  .stape-field-grid label > input,
  .stape-field-grid label > select,
  .stape-field-grid .stape-help-inline {
    grid-column: auto;
  }

  .stape-status-row,
  .inline-toggle-row {
    flex-wrap: wrap;
  }

  .mapping-row {
    grid-template-columns: 1.5rem minmax(0, 1fr) 2.25rem;
  }

  .trigger-mapping-row {
    grid-template-columns: 1.5rem minmax(0, 1fr) 2.25rem;
  }

  .mapping-row [data-field="source"],
  .mapping-row [data-field="event_name"],
  .trigger-mapping-row [data-field="stage_id"],
  .trigger-mapping-row [data-field="audience_id"] {
    grid-column: 2 / 4;
    border-top: 0.0625rem solid var(--line);
    border-left: 0;
  }

  .mapping-row [data-field="source"],
  .mapping-row [data-field="event_name"],
  .trigger-mapping-row [data-field="stage_id"] {
    grid-row: 2;
  }

  .trigger-mapping-row [data-field="audience_id"] {
    grid-row: 3;
  }

  .mapping-row .drag-handle {
    grid-column: 1;
    grid-row: 1 / -1;
  }

  .mapping-row .row-action-btn {
    grid-column: 3;
    grid-row: 1;
  }

  .mapping-row input + select,
  .mapping-row select + select,
  .mapping-row select + input {
    border-left: 0;
  }
}
