/* 워크플로우 설정 (public/workflow-ui.js) */
.wf-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  flex-shrink: 0;
  align-self: flex-start;
  max-width: 100%;
  overflow-x: auto;
}
.wf-tabs button {
  padding: 7px 16px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #4a5566;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.wf-tabs button[aria-selected='true'] {
  background: var(--nav);
  color: #fff;
}
.wf-label {
  display: block;
  color: #8a93a3;
  font-size: 11px;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}
.wf-flow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  counter-reset: step;
}
.wf-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.wf-stage-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wf-stage-top h2 {
  margin: 0;
  font-size: 16px;
}
.wf-step {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--nav);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.wf-what {
  margin: 0;
  color: #5b6576;
  font-size: 13px;
}
.wf-who b {
  display: block;
  font-size: 13px;
}
.wf-who small {
  color: #778498;
  font-size: 12px;
}
.wf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wf-chips .wf-label {
  flex-basis: 100%;
}
.wf-chip {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.wf-chip:hover,
.wf-chip:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}
.wf-chip.is-edited {
  border-color: #e7c66a;
  background: #fdf6e1;
}
.wf-settings {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.wf-setting {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px;
  margin: 0 -6px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.wf-setting:hover,
.wf-setting:focus-visible {
  background: var(--paper);
}
.wf-setting dt {
  flex-shrink: 0;
  color: #5b6576;
  font-size: 12px;
  white-space: nowrap;
}
.wf-setting dd {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}
.wf-note {
  margin: 16px 0 0;
  color: #5b6576;
  font-size: 13px;
}
.wf-prompts {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.wf-plist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 12px;
}
.wf-pitem {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.wf-pitem b {
  font-size: 13px;
  font-weight: 600;
}
.wf-pitem small {
  color: #8a93a3;
  font-size: 11px;
}
.wf-pitem:hover {
  background: #fff;
  border-color: var(--line);
}
.wf-pitem[aria-current='true'] {
  background: #fff;
  border-color: var(--nav);
  box-shadow: inset 3px 0 0 var(--nav);
}
.wf-badge {
  margin-top: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fdf6e1;
  color: #8a6a1a;
  font-size: 10.5px;
  font-weight: 700;
}
.wf-badge.warn {
  background: #fdecea;
  color: #b3261e;
}
.wf-editor {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.wf-etop h2 {
  margin: 0;
  font-size: 18px;
}
.wf-meta {
  margin: 2px 0 6px;
  color: #778498;
  font-size: 12px;
}
.wf-warn {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdf6e1;
  color: #6b5414;
  font-size: 13px;
}
.wf-ecols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  margin-top: 10px;
}
.wf-text {
  width: 100%;
  min-height: 480px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfc;
  font:
    12.5px/1.65 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  color: var(--ink);
  resize: vertical;
  tab-size: 2;
}
.wf-text:focus {
  outline: 2px solid #4467cb55;
  border-color: var(--blue);
}
.wf-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.wf-bar input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.wf-dirty {
  color: #b0661c;
  font-size: 12px;
  font-weight: 600;
}
.wf-errors {
  margin: 8px 0 0;
  padding: 10px 12px 10px 28px;
  border-radius: 8px;
  background: #fdecea;
  color: #b3261e;
  font-size: 13px;
}
.wf-errors-box {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdecea;
  color: #b3261e;
  font-size: 13px;
  white-space: pre-wrap;
}
.wf-vars {
  margin-top: 12px;
  font-size: 13px;
}
.wf-vars summary {
  cursor: pointer;
  color: #4a5566;
}
.wf-vargrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 4px;
  margin: 8px 0;
}
.wf-var {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.wf-var:hover {
  border-color: var(--blue);
}
.wf-var code {
  font-size: 11.5px;
  color: var(--blue);
}
.wf-var span {
  color: #5b6576;
  font-size: 11.5px;
}
.wf-preview .wf-refs {
  margin-top: 14px;
}
.wf-preview {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.wf-pvhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.wf-pvhead small {
  color: #8a93a3;
  font-size: 12px;
}
.wf-pvhead select {
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.wf-out {
  max-height: 560px;
  overflow: auto;
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #161c27;
  color: #e6e9ef;
  font:
    12px/1.6 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wf-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.wf-side h3 {
  margin: 0 0 6px;
  font-size: 13px;
}
.wf-refs ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wf-refs li {
  display: flex;
  flex-direction: column;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--paper);
}
.wf-refs li code {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.wf-refs li small {
  color: #8a93a3;
  font-size: 10.5px;
}
.wf-refs li.missing {
  background: #fdecea;
}
.wf-refs li.missing small {
  color: #b3261e;
  font-weight: 700;
}
.wf-hactions {
  margin: 0 0 6px;
  font-size: 12px;
}
.wf-vlist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 360px;
  overflow: auto;
}
.wf-vlist li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--paper);
  font-size: 12px;
}
.wf-vlist li.is-current {
  box-shadow: inset 3px 0 0 var(--accent);
}
.wf-vlist li small {
  flex-basis: 100%;
  color: #5b6576;
}
.wf-vlist li span {
  color: #778498;
}
.wf-vact {
  display: flex;
  gap: 10px;
  flex-basis: 100%;
}
.wf-vlist .text-button {
  font-size: 12px;
  padding: 0;
}
.wf-diff h4 {
  margin: 12px 0 4px;
  font-size: 12px;
}
.wf-difftext {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  font:
    11px/1.55 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
}
.wf-dl {
  padding: 0 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wf-dl.add {
  background: #e7f6ec;
  color: #1d5c32;
}
.wf-dl.del {
  background: #fdecea;
  color: #8c1d18;
}
.wf-dfold {
  padding: 2px 6px;
  color: #9aa3af;
  background: var(--paper);
  font-style: italic;
}
.wf-settings-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
  gap: 16px;
  align-items: start;
}
.wf-form {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.wf-fhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.wf-fhead h2 {
  margin: 0;
  font-size: 18px;
}
.wf-fhead small {
  color: #778498;
  font-size: 12px;
}
.wf-form fieldset {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}
.wf-form legend {
  margin-bottom: 6px;
  color: #8a93a3;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.wf-field {
  display: grid;
  grid-template-columns: minmax(150px, 40%) minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 7px;
  transition: background 0.3s;
}
.wf-field .helper {
  grid-column: 2;
  font-size: 11.5px;
  margin: 0;
}
.wf-flabel {
  font-size: 13px;
  color: #3d4757;
}
.wf-field input:not([type='checkbox']),
.wf-field select,
.wf-field textarea {
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: 13px;
}
.wf-field textarea {
  resize: vertical;
}
.wf-field.is-check input {
  justify-self: start;
  width: 18px;
  height: 18px;
}
.wf-field.is-readonly .wf-flabel {
  color: #8a93a3;
}
.wf-field.is-readonly textarea,
.wf-field.is-readonly input {
  background: var(--paper);
  color: #5b6576;
}
.wf-multi {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 13px;
}
.wf-multi label {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.wf-ro {
  margin: 0;
  color: #5b6576;
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wf-flash {
  background: #fdf6e1;
}
.wf-shistory {
  margin-top: 14px;
  font-size: 13px;
}
.wf-shistory summary {
  cursor: pointer;
  color: #4a5566;
}
.wf-shistory .wf-vlist {
  margin-top: 8px;
}
@media (max-width: 1250px) {
  .wf-ecols {
    grid-template-columns: 1fr;
  }
  .wf-prompts {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .wf-prompts {
    grid-template-columns: 1fr;
  }
  .wf-plist {
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }
  .wf-pitem {
    flex: 0 0 200px;
  }
  .wf-field {
    grid-template-columns: 1fr;
  }
  .wf-field .helper {
    grid-column: 1;
  }
  .wf-text {
    min-height: 360px;
  }
  .wf-editor,
  .wf-form {
    padding: 14px;
  }
}

/* 지시 문서(읽기 전용) */
.wf-docs .wf-dfilter {
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--line, #d0d5dd);
  border-radius: 8px;
  font: inherit;
  background: var(--paper, #fff);
  color: inherit;
}
.wf-docs .wf-dgroup {
  margin: 14px 4px 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted, #667085);
  font-weight: 600;
}
.wf-docs .wf-ditem small {
  word-break: break-all;
}
.wf-doctext {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: none;
}
.wf-reflink {
  padding: 0;
  text-align: left;
}
.wf-docs .wf-plist {
  max-height: calc(100vh - 140px);
  overflow: auto;
}
.wf-docs .wf-doctext {
  max-height: calc(100vh - 220px);
}
@media (max-width: 760px) {
  .wf-docs .wf-plist {
    flex-direction: column;
    max-height: 45vh;
  }
  .wf-docs .wf-pitem {
    flex: none;
    width: 100%;
  }
  .wf-docs .wf-doctext {
    max-height: none;
  }
}

/* 운용 모델 */
.wf-models {
  display: grid;
  gap: 14px;
  max-width: 920px;
}
.wf-model {
  padding: 18px 20px;
  border: 1px solid var(--line, #d0d5dd);
  border-radius: var(--radius, 12px);
  background: var(--paper, #fff);
}
.wf-mhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}
.wf-mhead h2 {
  margin: 0;
  font-size: 17px;
}
.wf-mnow {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 8px 0 10px;
}
.wf-mnow b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}
.wf-mrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wf-mrow select {
  flex: 0 0 180px;
}
.wf-mrow input {
  flex: 1 1 240px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.wf-mrow select,
.wf-mrow input {
  padding: 8px 10px;
  border: 1px solid var(--line, #d0d5dd);
  border-radius: 8px;
  font-size: 14px;
  background: var(--paper, #fff);
  color: inherit;
  min-width: 0;
}
.wf-mform .wf-bar {
  margin-top: 8px;
}
@media (max-width: 760px) {
  .wf-mrow select {
    flex: 1 1 100%;
  }
  .wf-model {
    padding: 14px;
  }
}
