:root {
  --ink: #283950;
  --muted: #66768b;
  --line: #dce7ed;
  --accent: #1c62bd;
  --blue: #126cce;
  --wash: #f1f6f9;
  --soft: #eaf6fc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font:
    14px/1.55 "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button {
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 10px 16px;
  min-height: 42px;
}
button:hover:enabled {
  border-color: #72a0db;
  background: #f3faff;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #7eabe6;
  outline-offset: 3px;
}
input,
select {
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 43px;
  max-width: 100%;
}
select {
  padding-right: 28px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.6px;
}
h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 14px;
  font-weight: 600;
}
small {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 17px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand b {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.brand span:not(.brand-mark) {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 40px;
  border-radius: 10px;
  color: white;
  font-size: 23px;
  background: linear-gradient(145deg, #3882e2, #126cce);
  box-shadow: 0 3px 6px #1c61bb1b;
}
.header-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
}
.text-button {
  border: 0;
  padding: 0;
  min-height: 30px;
  color: var(--muted);
  background: transparent;
}
main {
  padding: 22px 28px;
  max-width: 1600px;
  margin: auto;
}
#notice {
  font-size: 13px;
  color: #42628b;
  border: 1px solid #c9dcf4;
  border-radius: 8px;
  background: #edf8fd;
  padding: 10px 14px;
  margin-bottom: 16px;
}
#notice:empty {
  display: none;
}
.scope {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 0 0 23px;
}
.scope-heading {
  margin-right: auto;
}
.scope-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}
.scope label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  width: 230px;
  max-width: 100%;
}
.views {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid #cdd9e9;
  margin-bottom: 20px;
}
.views button {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 10px 0 14px;
  color: var(--muted);
  font-weight: 500;
  min-width: 80px;
}
.views button[aria-pressed="true"] {
  color: var(--accent);
}
.views button[aria-pressed="true"]:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: #1f6cd1;
  border-radius: 3px;
}
.columns {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
aside,
.editor-card,
#overview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 6px #223f6410;
  min-width: 0;
}
aside {
  padding: 18px 12px;
}
.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.list-heading span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
aside .list-heading {
  padding: 0 7px;
}
aside h2 {
  font-size: 15px;
}
aside input {
  width: calc(100% - 12px);
  margin: 0 6px 12px;
  font-size: 12px;
}
#fields {
  max-height: 62vh;
  min-height: 240px;
  overflow: auto;
  scrollbar-width: thin;
}
#fields button {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  padding: 10px 12px;
  min-height: 60px;
  margin-bottom: 3px;
  font-size: 13px;
  background: transparent;
}
#fields small {
  display: block;
  font-size: 10px;
  line-height: 1.6;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#fields button[aria-pressed="true"] {
  background: #eaf6fd;
  border-color: #c9ddf8;
  color: #1a5aad;
  box-shadow: inset 3px 0 #206fd6;
}
#fields button:hover {
  background: #f2f7fa;
}
.field-heading {
  padding: 23px 26px 20px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.field-heading h2 {
  font-size: 23px;
  line-height: 1.25;
  margin-bottom: 5px;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 23px 26px 0;
  min-width: 0;
}
legend {
  float: left;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  padding: 0;
  margin-bottom: 12px;
}
#modes {
  clear: both;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#modes button {
  text-align: left;
  padding: 13px 14px;
  font-weight: 500;
  border-color: #dbe5ed;
  position: relative;
}
#modes button:before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid #abbacd;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -1px;
}
#modes button[aria-pressed="true"] {
  border-color: #528ad3;
  background: #eff9fe;
  color: #1958a9;
  box-shadow: 0 0 0 1px #528ad31a;
}
#modes button[aria-pressed="true"]:before {
  border: 4px solid #1f6acc;
  background: white;
}
#modes small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 4px;
  line-height: 1.5;
}
#stagePanel {
  margin-top: 23px;
}
.range {
  display: grid;
  grid-template-columns: 1fr minmax(170px, 48%);
  gap: 12px;
  align-items: center;
  border: 1px solid #dfeaf1;
  border-radius: 9px;
  padding: 13px 16px;
  background: #f6fafc;
  font-size: 13px;
  margin-bottom: 22px;
}
.range select {
  width: 100%;
  font-size: 13px;
}
.stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf1f4;
  padding: 10px 13px;
  min-height: 47px;
}
#stages {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
#stages .stage:last-child {
  border: 0;
}
.stage label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.stage input {
  width: 17px;
  height: 17px;
  min-height: 0;
  flex-shrink: 0;
  margin: 0;
  accent-color: #1f6acc;
}
.stage-kind {
  font-size: 10px;
  white-space: nowrap;
  color: var(--muted);
  background: #f0f3f6;
  border-radius: 4px;
  padding: 2px 7px;
}
.stage-kind:empty {
  display: none;
}
.stage-success .stage-kind {
  color: #168467;
  background: #e8f7f0;
}
.stage-failure .stage-kind {
  color: #a46b60;
  background: #fbf0ec;
}
.stage[data-selected="true"] {
  background: #f1faff;
}
.save-panel {
  margin: 24px -26px 0;
  padding: 18px 26px 20px;
  background: #f9fbfc;
  border-top: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
}
.draft-state {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 5px;
}
.draft-state.changed {
  color: #ab741f;
}
.draft-state.changed:before {
  content: "●";
  font-size: 8px;
  margin-right: 6px;
}
#preview {
  font-size: 12px;
  color: #556983;
  line-height: 1.6;
}
.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.primary {
  background: #1f6acc;
  border-color: #1f6acc;
  color: white;
  font-weight: 600;
  box-shadow: 0 3px 7px #1c61bc20;
}
.primary:hover:enabled {
  background: #1c62bd;
  color: white;
}
#overview {
  padding: 24px 26px;
}
#overview > label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  max-width: 380px;
}
.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin: 26px 0 17px;
}
.summary p {
  font-size: 12px;
  color: var(--muted);
}
.table-heading {
  display: flex;
  justify-content: space-between;
  background: #f3f7fa;
  border-block: 1px solid var(--line);
  padding: 10px 13px;
  font-size: 11px;
  color: var(--muted);
}
#stageFields button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 3px 0;
  font-size: 13px;
}
#stageFields small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  margin-top: 3px;
}
#stageFields .stage {
  padding: 13px;
}
#stageFields .stage:hover {
  background: #f7fbfd;
}
#stageFields .stage > span {
  font-size: 11px;
  border-radius: 5px;
  background: #f1f4f6;
  padding: 4px 9px;
  white-space: nowrap;
  color: #708095;
}
#stageFields .stage > span.required {
  background: #e6f6f0;
  color: #207a5e;
}
#overview .actions {
  justify-content: flex-end;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  max-width: min(620px, 94vw);
  color: var(--ink);
  box-shadow: 0 24px 100px #122f5444;
}
dialog::backdrop {
  background: #20344f66;
  backdrop-filter: blur(3px);
}
dialog h3 {
  margin: 22px 0 7px;
}
dialog p {
  font-size: 13px;
  color: #596d86;
  margin-top: 12px;
}
dialog a {
  display: inline-block;
  margin-top: 24px;
}
.close-button {
  float: right;
  border: 0;
  font-size: 24px;
  line-height: 1;
  padding: 2px 8px;
  min-height: 30px;
}
.paper {
  max-width: 850px;
  margin: 25px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 35px;
}
.paper h1 {
  font-size: 32px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.paper h2 {
  margin-top: 28px;
}
.paper p {
  margin: 15px 0;
  line-height: 1.8;
}
footer {
  font-size: 12px;
  color: var(--muted);
  padding: 20px 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
#workspace[aria-busy="true"] {
  opacity: 0.65;
  transition: opacity 0.15s;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1200px) {
  .columns {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .scope {
    flex-wrap: wrap;
    gap: 14px;
  }
  .scope-heading {
    width: 100%;
  }
  .scope label {
    flex: 1;
    width: auto;
  }
  .columns {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 14px;
  }
  #modes {
    grid-template-columns: 1fr;
  }
  #modes small {
    margin-left: 22px;
  }
  .range {
    grid-template-columns: 1fr;
  }
  header {
    padding: 15px 20px;
  }
  .header-links {
    gap: 14px;
  }
  .brand span:not(.brand-mark) {
    display: none;
  }
  main {
    padding: 20px;
  }
  .field-heading,
  fieldset,
  #overview {
    padding: 20px;
  }
  .save-panel {
    margin-inline: -20px;
    padding: 18px 20px;
  }
}
@media (max-width: 600px) {
  header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
  }
  .brand b {
    font-size: 17px;
  }
  .header-links {
    width: 100%;
    justify-content: space-between;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  main {
    padding: 16px 12px;
  }
  .scope-heading h1 {
    font-size: 21px;
  }
  .scope label {
    min-width: 130px;
  }
  #fields {
    max-height: 178px;
    min-height: 0;
  }
  #fields button {
    min-height: 48px;
  }
  aside {
    padding: 14px 10px;
  }
  .field-heading,
  fieldset,
  #overview {
    padding: 18px;
  }
  .save-panel {
    margin-inline: -18px;
    padding: 16px 18px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .actions button {
    flex-grow: 1;
  }
  .stage {
    padding: 11px 9px;
  }
  .paper {
    padding: 22px;
    margin-top: 8px;
  }
  .paper h1 {
    font-size: 26px;
  }
  .summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  #stageFields .stage {
    gap: 8px;
    padding: 12px 0;
  }
  #stageFields .stage > span {
    font-size: 10px;
    padding: 3px 6px;
  }
  #stageFields button {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
.scope select {
  width: 100%;
  min-width: 0;
}
.application main {
  max-width: none;
}
@media (min-width: 1600px) {
  .columns {
    grid-template-columns: minmax(290px, 22%) minmax(0, 1fr);
  }
  #modes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
#stageSearch {
  width: min(430px, 100%);
  margin-bottom: 18px;
}
#notice.error {
  color: #945831;
  border-color: #eed6be;
  background: #fff8ee;
}
#stages .stage:hover {
  background: #e9f6fc;
}
.skeleton-lines {
  display: grid;
  gap: 18px;
  padding: 22px;
}
.skeleton-lines span,
.skeleton-toolbar,
.skeleton-badge {
  display: block;
  background: linear-gradient(100deg, #e9eff7 25%, #f7f9fc 45%, #e9eff7 65%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-lines span {
  height: 26px;
}
.skeleton-lines span:nth-child(2n) {
  width: 73%;
}
.skeleton-lines span:first-child {
  width: 45%;
  height: 18px;
}
.skeleton-toolbar {
  height: 70px;
  margin-bottom: 25px;
}
.skeleton-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 340px;
}
.editor-skeleton {
  min-height: 350px;
}
#stageFields .skeleton-badge {
  width: 100px;
  height: 23px;
  padding: 0;
  flex-shrink: 0;
}
@keyframes skeleton-shimmer {
  from {
    background-position: 180% 0;
  }
  to {
    background-position: -80% 0;
  }
}
#workspace[aria-busy="true"] {
  opacity: 1;
}
.stage-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
#overview.editing .stage-workspace {
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.3fr);
}
#stageEditorMount {
  min-width: 0;
  position: sticky;
  top: 16px;
}
#stageEditorMount .field-heading {
  padding: 18px;
}
#stageEditorMount fieldset {
  padding: 18px 18px 0;
}
#stageEditorMount .save-panel {
  margin-inline: -18px;
  padding-inline: 18px;
}
#stageEditorMount #modes {
  grid-template-columns: 1fr;
}
#stageEditorMount #modes small {
  display: inline;
  margin-left: 12px;
}
#overview.editing .table-heading {
  display: none;
}
#overview.editing #stageFields {
  border-top: 1px solid var(--line);
}
@media (max-width: 900px) {
  #overview.editing .stage-workspace {
    grid-template-columns: 1fr;
  }
  #stageEditorMount {
    position: static;
  }
  #stageEditorMount #modes small {
    display: block;
    margin-left: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-lines span,
  .skeleton-toolbar,
  .skeleton-badge {
    animation: none;
  }
}

:root {
  --accent: #155ead;
  --blue: #155ead;
  --ink: #192f48;
  --muted: #60738e;
  --wash: #f4f7fb;
  --line: #d8e2ed;
}
.primary {
  background: #155ead;
  border-color: #155ead;
}
.primary:hover:enabled {
  background: #124f94;
  border-color: #124f94;
}
.views button[aria-pressed="true"],
#fields button[aria-pressed="true"],
#modes button[aria-pressed="true"] {
  color: #1458a1;
}
.views button[aria-pressed="true"]:after {
  background: #155ead;
}
.stage input {
  accent-color: #196cc4;
}
.brand-mark {
  background: linear-gradient(145deg, #3684d3, #155ead);
}

.application #overview {
  max-width: none;
  margin: 0;
}
.stage-table {
  min-width: 0;
}
