:root {
  --ink: #111111;
  --muted: rgba(17, 17, 17, 0.58);
  --line: rgba(17, 17, 17, 0.1);
  --paper: #ffffff;
  --soft: #f6f6f4;
  --orange: #2563eb;
  --orange-dark: #1d4ed8;
  --green: #137333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f7f5;
  color: var(--ink);
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.paths-locked-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

button,
a,
input {
  font: inherit;
}

.paths-admin {
  width: min(1180px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.paths-admin.paths-locked {
  width: min(560px, calc(100vw - 36px));
  padding: 0;
}

.paths-locked-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
  padding: 34px;
}

.paths-locked-card p {
  margin: 0 0 10px;
  color: rgba(17, 17, 17, 0.48);
  font-size: 12px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paths-locked-card h1 {
  margin: 0;
  color: #111111;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.paths-locked-card span {
  display: block;
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 560;
}

.paths-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.paths-hero p,
.paths-panel-head p {
  margin: 0 0 6px;
  color: rgba(17, 17, 17, 0.48);
  font-size: 12px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paths-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.paths-hero span {
  display: block;
  max-width: 620px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 560;
}

.paths-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.paths-primary,
.paths-ghost,
.path-card button {
  min-height: 40px;
  border-radius: 10px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.paths-primary {
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
}

.paths-ghost {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #111111;
}

.paths-ghost.active {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ededeb;
  padding: 5px;
  margin: 22px 0;
}

.admin-tabs button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(17, 17, 17, 0.58);
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.admin-tabs button.active {
  background: #111111;
  color: #ffffff;
}

.admin-tabs button:active {
  transform: scale(0.99);
}

/* Audience switch for the A/B axes editor (student vs professional weights). */
.ab-profile-switch {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ededeb;
  padding: 4px;
  margin: 0 0 16px;
}

.ab-profile-tab {
  min-height: 38px;
  padding: 0 22px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(17, 17, 17, 0.58);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.ab-profile-tab.active {
  background: #111111;
  color: #ffffff;
}

.ab-profile-tab:active {
  transform: scale(0.99);
}

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

.paths-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.paths-summary article,
.paths-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.paths-summary article {
  min-height: 112px;
  padding: 20px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.paths-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  font-weight: 830;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paths-summary strong {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 850;
}

.paths-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.paths-panel {
  padding: 18px;
}

/* === A/B Kanban === */
.ab-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr);
  gap: 28px;
  align-items: center;
  padding: 22px 24px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f6f4ef 100%);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 18px;
  box-shadow: 0 12px 40px -24px rgba(17, 17, 17, 0.18);
}

.ab-hero-copy p {
  margin: 0 0 6px;
  color: #c79813;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ab-hero-copy h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ab-hero-copy span {
  display: block;
  max-width: 540px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 540;
}

.ab-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ab-hero-stats article {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ab-hero-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ab-hero-stats strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.ab-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: #f7f5f0;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 18px;
}

.ab-column-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(17, 17, 17, 0.1);
}

.ab-column-eyebrow {
  display: inline-block;
  margin-bottom: 4px;
  color: #c79813;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ab-column-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.005em;
}

.ab-column-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 540;
}

.ab-column-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.1);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #111;
}

.ab-column-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ab-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  box-shadow: 0 4px 14px -10px rgba(17, 17, 17, 0.18);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease, border-color 120ms ease;
}

.ab-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -12px rgba(17, 17, 17, 0.22);
  border-color: rgba(17, 17, 17, 0.14);
}

.ab-card.is-off {
  opacity: 0.55;
  background: #f3f2ee;
}

.ab-card.is-off .ab-card-share-fill {
  background: rgba(17, 17, 17, 0.2);
}

.ab-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ab-card-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.25;
}

.ab-card-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.ab-card-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ab-card-toggle-track {
  display: inline-block;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.18);
  position: relative;
  transition: background-color 140ms ease;
}

.ab-card-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 140ms ease;
}

.ab-card-toggle input:checked + .ab-card-toggle-track {
  background: #1a6b34;
}

.ab-card-toggle input:checked + .ab-card-toggle-track .ab-card-toggle-knob {
  transform: translateX(14px);
}

.ab-card-share {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ab-card-share-bar {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  overflow: hidden;
}

.ab-card-share-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2bb16a 0%, #1a6b34 100%);
  transition: width 200ms ease;
}

.ab-card-share-value {
  font-size: 12.5px;
  font-weight: 800;
  color: #1a6b34;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

.ab-card.is-off .ab-card-share-value {
  color: rgba(17, 17, 17, 0.5);
}

.ab-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px dashed rgba(17, 17, 17, 0.08);
}

.ab-card-weight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.ab-card-weight input {
  width: 58px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.ab-card-weight input:focus {
  outline: 2px solid rgba(199, 152, 19, 0.35);
  outline-offset: 1px;
}

.ab-card-id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(17, 17, 17, 0.05);
  padding: 3px 7px;
  border-radius: 6px;
}

@media (max-width: 980px) {
  .ab-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .ab-kanban {
    grid-template-columns: minmax(0, 1fr);
  }
}

.paths-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.paths-panel-head > div > span {
  display: block;
  max-width: 760px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 560;
}

.paths-panel-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.path-list {
  display: grid;
  gap: 10px;
}

.path-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.path-card.active {
  border-color: rgba(37, 99, 235, 0.74);
  background: #fff8ef;
}

.path-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.path-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 560;
}

.path-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.path-meta span {
  min-height: 25px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  background: #f7f7f5;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  color: rgba(17, 17, 17, 0.62);
  font-size: 11px;
  line-height: 1;
  font-weight: 780;
}

.path-meta .path-lock {
  background: #fff4f4;
  color: #a10f0f;
}

.path-meta .path-free {
  background: #edf8ef;
  color: var(--green);
}

.path-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.path-card button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #111111;
}

.path-card button.primary {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.path-card button.orange {
  border-color: rgba(37, 99, 235, 0.5);
  background: #fff7ed;
  color: var(--orange-dark);
}

.paths-metrics-panel {
  margin-top: 12px;
}

.post-pay-panel {
  max-width: 1120px;
}

.post-pay-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.post-pay-control {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.post-pay-wide {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 420px);
  align-items: center;
}

.custom-templates-panel {
  max-width: 1120px;
}

.custom-templates-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.custom-templates-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted, #6b6b6b);
  font-weight: 600;
}

.custom-templates-toolbar select,
.custom-templates-toolbar input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  color: #111111;
}

.custom-templates-editor {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.custom-template-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.custom-template-row input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  color: #111111;
}

.custom-template-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.custom-template-card-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.custom-template-card-emoji {
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}

.custom-template-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.custom-template-card-body strong {
  font-size: 15px;
  font-weight: 700;
  color: #111111;
}

.custom-template-card-desc {
  color: var(--muted, #6b6b6b);
  font-size: 13px;
  line-height: 1.4;
}

.custom-template-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.custom-template-card-badges em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: rgba(17, 17, 17, 0.62);
  background: rgba(17, 17, 17, 0.05);
  padding: 3px 8px;
  border-radius: 999px;
}

.custom-template-card-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.admin-template-builder {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, 0.42);
  padding: 24px;
}

.admin-template-builder[hidden] {
  display: none !important;
}

.admin-template-builder .template-builder-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(17, 17, 17, 0.25);
}

.admin-template-builder .template-builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-template-builder .template-builder-head p {
  margin: 0 0 4px;
  color: var(--muted, #6b6b6b);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-template-builder .template-builder-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.admin-template-builder .template-builder-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(17, 17, 17, 0.05);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.admin-template-builder .template-builder-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-template-builder .template-builder-main {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
}

.admin-template-builder label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(17, 17, 17, 0.7);
}

.admin-template-builder label > span small {
  color: var(--muted, #6b6b6b);
  font-weight: 500;
  margin-left: 6px;
}

.admin-template-builder input[type="text"],
.admin-template-builder textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #111111;
  background: #ffffff;
}

.admin-template-builder textarea {
  resize: vertical;
}

.admin-template-builder .template-builder-options {
  display: grid;
  gap: 8px;
}

.admin-template-builder .template-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.02);
  cursor: pointer;
  font-weight: 500;
}

.admin-template-builder .template-option input[type="checkbox"] {
  margin-top: 3px;
}

.admin-template-builder .template-option strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #111111;
}

.admin-template-builder .template-option small {
  color: var(--muted, #6b6b6b);
  font-size: 12px;
  font-weight: 500;
}

.admin-template-builder .template-builder-questions-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.admin-template-builder .template-builder-questions-head span {
  font-size: 13px;
  font-weight: 700;
  color: rgba(17, 17, 17, 0.7);
}

.admin-template-builder .template-builder-questions-head small {
  color: var(--muted, #6b6b6b);
  font-size: 12px;
  display: block;
}

.admin-template-builder .template-question-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-template-builder .template-question-row {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 8px;
  align-items: center;
}

.admin-template-builder .template-question-row textarea {
  min-height: 44px;
  font-size: 13px;
}

.admin-template-builder .template-question-row select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 13px;
  background: #ffffff;
}

.admin-template-builder .template-question-actions {
  display: flex;
  gap: 4px;
}

.admin-template-builder .template-question-actions button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.admin-template-builder .template-question-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-template-builder .template-question-actions svg {
  width: 14px;
  height: 14px;
}

.admin-template-builder .add-template-question {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 8px 14px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: rgba(17, 17, 17, 0.7);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.admin-template-builder .add-template-question svg {
  width: 14px;
  height: 14px;
}

.admin-template-builder .template-builder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.admin-template-builder .template-builder-actions button {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.admin-template-builder .save-template {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.custom-templates-hint {
  margin: 6px 0 0;
  color: var(--muted, #6b6b6b);
  font-size: 13px;
}

.custom-templates-status {
  margin: 10px 0 0;
  min-height: 18px;
  color: var(--muted, #6b6b6b);
  font-size: 12.5px;
}

.custom-templates-keys {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.custom-templates-keys h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted, #6b6b6b);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.custom-templates-keys ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.custom-templates-keys li button {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  color: #111111;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.custom-templates-keys li button:hover {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(255, 244, 235, 0.6);
}

.custom-templates-keys li.active button {
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(255, 232, 210, 0.85);
}

.custom-templates-keys li button span:nth-child(1) {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(17, 17, 17, 0.7);
}

.custom-templates-keys li button span:nth-child(3) {
  color: rgba(17, 17, 17, 0.55);
  font-size: 12px;
}

@media (max-width: 720px) {
  .custom-templates-toolbar {
    grid-template-columns: 1fr;
  }
}

.post-pay-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-pay-control strong {
  display: block;
  margin-top: 4px;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.post-pay-control p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 560;
}

.post-pay-control input[type="number"] {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  font-size: 20px;
  font-weight: 850;
}

.post-pay-control input[type="range"] {
  width: 100%;
  accent-color: #111111;
}

.post-pay-check {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #111111;
  font-weight: 820;
}

.post-pay-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.post-pay-preview article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f8f6;
  padding: 14px;
}

.post-pay-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-pay-preview strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.email-workflow-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.email-workflow-stats article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #f8f8f6;
}

.email-workflow-stats span {
  display: block;
  color: rgba(17, 17, 17, 0.52);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.email-workflow-stats strong {
  display: block;
  margin-top: 8px;
  color: #111111;
  font-size: 18px;
  line-height: 1.1;
}

.email-workflow-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(360px, 1.08fr) minmax(420px, 1.2fr);
  gap: 12px;
  align-items: start;
}

.email-workflow-list,
.email-workflow-builder,
.email-variant-shell {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  min-width: 0;
}

.email-workflow-list {
  padding: 10px;
  display: grid;
  gap: 10px;
  max-height: 780px;
  overflow: auto;
}

.email-sequence {
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  background: #fbfbfa;
  overflow: hidden;
}

.email-sequence.active {
  border-color: rgba(17, 17, 17, 0.24);
  background: #ffffff;
}

.email-sequence.manual {
  background: #f8f8f6;
}

.email-sequence > button,
.email-sequence-children button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #111111;
  cursor: pointer;
  text-align: left;
}

.email-sequence > button {
  padding: 14px;
  display: grid;
  gap: 5px;
}

.email-sequence > button span,
.email-preview-meta span {
  color: rgba(17, 17, 17, 0.45);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.email-sequence > button strong {
  font-size: 16px;
  line-height: 1.15;
  font-weight: 880;
}

.email-sequence > button small,
.email-preview-meta small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.email-sequence-children {
  display: grid;
  gap: 3px;
  padding: 0 8px 8px;
}

.email-sequence-children button {
  min-height: 34px;
  border-radius: 9px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(17, 17, 17, 0.62);
  font-size: 13px;
  font-weight: 760;
}

.email-sequence-children button span {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f0ee;
  color: rgba(17, 17, 17, 0.5);
  font-size: 11px;
}

.email-sequence-children button.active {
  background: #111111;
  color: #ffffff;
}

.email-sequence-children button.active span {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.email-workflow-builder {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.email-builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.email-builder-head > div {
  flex: 1;
}

.email-builder-head span {
  display: block;
  margin-bottom: 7px;
  color: rgba(17, 17, 17, 0.5);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.email-builder-head input:not([type]),
.email-builder-head input[type="text"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: #111111;
  background: #ffffff;
  font-weight: 820;
}

.email-builder-head label,
.email-step-controls label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.email-builder-switches {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 23px;
}

.email-step-list {
  display: grid;
  gap: 12px;
}

.email-step {
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  padding: 12px;
  background: #fafaf8;
}

.email-step.selected {
  border-color: rgba(17, 17, 17, 0.28);
  background: #ffffff;
}

.email-step-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.email-step-titlebar > button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: #111111;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.email-step-titlebar > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.email-step-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.email-step-controls input[type="number"],
.email-step-controls select,
.email-variant-toolbar select {
  width: 62px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #ffffff;
}

.email-step-controls select {
  width: 150px;
}

.email-step input[data-step-field="title"],
.email-step textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: #111111;
  font-weight: 650;
}

.email-step input[data-step-field="title"] {
  min-height: 40px;
  padding: 0 12px;
  margin-bottom: 8px;
}

.email-step textarea {
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.45;
}

.email-workflow-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.email-workflow-actions button,
.email-step-controls button,
.email-step-titlebar button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  background: #ffffff;
  color: #111111;
  font-weight: 820;
  cursor: pointer;
}

.email-step-titlebar button[disabled] {
  cursor: default;
  opacity: 0.38;
}

.email-workflow-actions button:first-child {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.email-variant-shell {
  overflow: hidden;
}

.email-variant-toolbar,
.email-variant-actions {
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.email-variant-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.email-variant-toolbar select {
  width: 160px;
  min-height: 38px;
}

.email-variant-actions {
  border-top: 1px solid rgba(17, 17, 17, 0.08);
  border-bottom: 0;
  justify-content: flex-end;
}

.email-variant-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.email-preview-meta {
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 12px;
  background: #fafaf8;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.email-preview-meta strong {
  color: #111111;
  font-size: 17px;
  line-height: 1.2;
}

.email-field {
  display: grid;
  gap: 7px;
  color: rgba(17, 17, 17, 0.58);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.email-field input,
.email-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: #111111;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: 0;
  text-transform: none;
}

.email-field input {
  min-height: 40px;
  padding: 0 11px;
}

.email-field textarea {
  resize: vertical;
  padding: 11px;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.email-preview-box {
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.email-preview-box-head {
  min-height: 40px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.email-preview-box-head span {
  color: #111111;
  font-size: 13px;
  font-weight: 850;
}

.email-preview-box-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.email-preview-box iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
  display: block;
  background: #ffffff;
}

.email-workflow-status,
.email-workflow-empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.metrics-table {
  overflow-x: auto;
}

.metrics-summary {
  min-width: 1480px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metrics-summary article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f8f6;
  padding: 14px;
}

.metrics-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metrics-summary strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.metrics-row {
  min-width: 1480px;
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) minmax(108px, 0.8fr) repeat(11, minmax(86px, 1fr));
  border-bottom: 1px solid rgba(17, 17, 17, 0.07);
}

.metrics-row:first-child {
  border-top: 1px solid rgba(17, 17, 17, 0.07);
}

.metrics-row > * {
  min-height: 42px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  color: rgba(17, 17, 17, 0.62);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 720;
}

.metrics-row strong {
  color: #111111;
  font-weight: 840;
}

.metrics-head > * {
  color: #111111;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metrics-note,
.metrics-empty {
  min-width: 920px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

@media (max-width: 820px) {
  .paths-admin {
    width: min(100vw - 24px, 640px);
    padding-top: 22px;
  }

  .paths-hero,
  .paths-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .paths-summary,
  .paths-grid {
    grid-template-columns: 1fr;
  }

  .email-workflow-stats {
    grid-template-columns: 1fr;
  }

  .email-workflow-layout {
    grid-template-columns: 1fr;
  }

  .email-workflow-list {
    max-height: none;
  }

  .path-actions {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .post-pay-grid,
  .post-pay-preview,
  .post-pay-wide {
    grid-template-columns: 1fr;
  }

  .post-pay-wide {
    grid-column: auto;
  }

  .email-variant-toolbar,
  .email-variant-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .email-variant-toolbar label,
  .email-variant-toolbar select,
  .email-variant-toolbar button,
  .email-variant-actions button {
    width: 100%;
  }
}
