:root {
  font-family: "Aptos", "Segoe UI", sans-serif;
  color: #202b28;
  background: #f5f4ef;
  --ink: #202b28;
  --muted: #60706a;
  --line: #e2e6dd;
  --green: #215b45;
  --accent: #e8f1e8;
  --white: #fff;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .64; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #78ac98; outline-offset: 2px; }
.sidebar { background: #152d24; color: #fff; min-height: 100vh; padding: 31px 19px 21px; display: flex; flex-direction: column; gap: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; white-space: nowrap; letter-spacing: -.2px; }
.brand-icon { background: #d6f0a9; color: #263e25; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-size: 25px; }
.brand small { color: #baddbd; margin-left: 3px; font-size: 10px; }
.sidebar-menu { display: grid; gap: 23px; margin: 32px 0 24px; }
.nav-label { margin: 0 0 7px 10px; color: #b0c5b9; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.nav-link { color: #dbe9e0; display: flex; align-items: center; gap: 10px; border: 0; padding: 12px; border-radius: 9px; background: transparent; width: 100%; text-align: left; font-size: 14px; margin-bottom: 4px; }
.nav-link.active, .nav-link:hover { background: #2a4a3b; color: #fff; }
.local-label { margin-top: auto; padding: 14px 8px 0; color: #c9dbcc; font-size: 12px; border-top: 1px solid #385043; display: flex; align-items: center; gap: 8px; }
.local-label i { width: 7px; height: 7px; background: #b9dc8b; border-radius: 100%; }
.topbar { height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 44px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); background: #fbfaf6; }
.account { color: #2a5945; background: #e8efe5; padding: 7px 11px; border-radius: 99px; white-space: nowrap; }
.canvas { max-width: 1420px; padding: 42px 44px 72px; margin: auto; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 18px; margin-bottom: 30px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 3.4vw, 42px); line-height: 1.13; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 17px; letter-spacing: -.015em; }
h3 { font-size: 16px; }
p { color: var(--muted); line-height: 1.55; }
.page-title p { margin-top: 8px; }
.section-head, .tab-head, .item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-head > span { color: var(--muted); font-size: 13px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.empty { text-align: center; padding: clamp(40px, 8vw, 86px) 20px; }
.empty-icon { font-size: 28px; margin: 0 auto 20px; background: var(--accent); color: var(--green); width: 60px; height: 60px; display: grid; place-items: center; border-radius: 16px; }
.empty h2 { font-size: 21px; }
.empty p { margin-top: 8px; }
.empty button { margin-top: 23px; }
.primary, .secondary, .subtle { border-radius: 8px; font-size: 13px; font-weight: 650; padding: 10px 13px; border: 1px solid transparent; white-space: nowrap; }
.primary { background: var(--green); color: #fff; border-color: var(--green); }
.primary:hover { background: #194c38; }
.secondary { background: #fff; color: #2c4b3e; border-color: #ccd9d0; }
.secondary:hover, .subtle:hover { background: #eff4ee; }
.subtle { background: transparent; color: var(--green); padding: 7px 8px; }
.danger { color: #963932; }
.danger:hover { background: #fbeeea; }
.flow-list { display: grid; gap: 10px; }
.flow-row { width: 100%; text-align: left; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 16px 18px; color: var(--ink); }
button.flow-row:hover { border-color: #8daf99; background: #fbfdfa; }
.flow-row strong, .flow-row small { display: block; overflow-wrap: anywhere; }
.flow-row small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.flow-icon { color: #275b45; background: var(--accent); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; }
.badge { background: #eff3ed; color: #3e5b4a; font-size: 11px; border-radius: 99px; padding: 5px 9px; white-space: nowrap; }
.directory .flow-row { border: 0; border-radius: 0; background: none; }
.directory .flow-row + .flow-row { border-top: 1px solid var(--line); }
.toolbar, .inline-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.editor-title { margin-bottom: 23px; }
.back { margin: 0 0 9px -8px; }
.basics { padding: 17px 19px; margin-bottom: 19px; }
.diagram-panel { margin-bottom: 19px; min-width: 0; overflow: hidden; }
.diagram-head { padding: 9px 15px 9px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.diagram-head > button { margin-left: auto; }
.diagram-legend { display: flex; flex-wrap: wrap; gap: 7px 15px; color: var(--muted); font-size: 11px; }
.diagram-legend span { display: flex; align-items: center; gap: 6px; }
.diagram-legend span::before { content: ''; width: 17px; border-top: 2px solid #739384; }
.diagram-legend .branch::before { border-top: 2px dashed #7355a0; }
.diagram-canvas {
  overflow: auto;
  max-height: 235px;
  border-top: 1px solid var(--line);
  background: radial-gradient(#d9e1d9 1px, transparent 1px) 0 0 / 14px 14px, #fafbf8;
}
.diagram-canvas > svg { display: block; max-width: none; }
.diagram-empty { padding: 15px 18px; font-size: 13px; }
.diagram-edge { fill: none; stroke: #739384; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.diagram-edge.branch { stroke: #7355a0; stroke-dasharray: 5 4; }
.diagram-arrow-default { fill: #739384; }
.diagram-arrow-branch { fill: #7355a0; }
.diagram-edge-label { fill: #593a80; font-size: 10px; font-weight: 700; paint-order: stroke; stroke: #fafbf8; stroke-width: 4px; stroke-linejoin: round; }
.diagram-node rect { fill: #fff; stroke: #ccdcd1; stroke-width: 1.2; }
.diagram-node.terminal rect { fill: #e8f1e8; }
.diagram-node.detached rect { stroke-dasharray: 4 3; }
.diagram-node.step-node { cursor: pointer; }
.diagram-node.selected rect, .diagram-node.step-node:hover rect, .diagram-node.step-node:focus-visible rect { fill: #e4f1e8; stroke: var(--green); stroke-width: 2; }
.diagram-node text { text-anchor: middle; fill: #224236; pointer-events: none; }
.diagram-node-title { font-size: 12px; font-weight: 700; }
.diagram-node .diagram-node-status { fill: #60706a; font-size: 10px; }
.editor-grid { display: grid; grid-template-columns: minmax(185px, 235px) minmax(0, 1fr); gap: 18px; align-items: start; }
.prep-switch { display: flex; gap: 8px; margin: 0 0 14px; }
.preparation { padding: 18px 20px; }
.preparation .item-head > label { flex: 1; }
.prep-field { border: 1px solid var(--line); border-radius: 8px; background: white; margin: 12px 0; padding: 13px; }
.prep-options, .prep-section { margin-top: 14px; }
.prep-options h3 { font-size: 12px; margin-bottom: 8px; }
.prep-options .condition .fields { grid-template-columns: 1fr; }
.prep-result { list-style: none; padding: 0; }
.prep-result li { display: grid; gap: 3px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.prep-result span, .prep-result small { color: var(--muted); }
.applicant-panel { margin-bottom: 18px; padding: 19px 20px; }
.applicant-panel h2 { margin-bottom: 12px; }
.applicant-panel > .secondary { margin: 4px 8px 4px 0; }
.applicant-panel > .primary { margin-top: 10px; }
.attached-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.candidate-picker { margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.candidate-picker legend { font-weight: 600; font-size: 12px; }
.candidate-option { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px 5px 0; font-size: 13px; }
.review-data { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 8px; background: #f1f4ee; padding: 12px; }
.nav-link[hidden] { display: none; }
.steps { padding: 15px 12px; }
.steps .section-head { padding: 1px 6px; }
.steps > .secondary { margin-top: 8px; width: 100%; }
.step-link { color: var(--ink); width: 100%; display: flex; gap: 8px; text-align: left; align-items: center; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 10px 8px; margin-bottom: 4px; }
.step-link:hover, .step-link.selected { background: #edf4e9; border-color: #dbe7d9; }
.step-link span, .step-link small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.step-link strong { flex: 1; font-size: 13px; overflow-wrap: anywhere; }
.detail { min-width: 0; overflow: hidden; }
.step-heading { padding: 17px 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.step-heading label { flex: 1; }
.tabs { display: flex; overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 12px; }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 12px 10px; font-size: 13px; white-space: nowrap; }
.tab.current { border-bottom-color: var(--green); color: var(--green); font-weight: 700; }
.tab-content { padding: 18px 20px 22px; }
.tab-head { align-items: flex-start; }
.tab-head p, .help { margin-top: 4px; font-size: 12px; }
.help { margin-bottom: 13px; }
.fields { display: grid; gap: 12px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: block; min-width: 0; }
label > span { display: block; color: #334b41; font-weight: 600; font-size: 12px; margin-bottom: 5px; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; color: var(--ink); padding: 9px; border: 1px solid #ced8cf; border-radius: 7px; background: #fff; font-size: 13px; }
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; }
input::placeholder { color: #68776e; }
.item { padding: 13px; border: 1px solid var(--line); border-radius: 10px; margin: 11px 0; background: #fbfcf9; }
.item-head { margin-bottom: 8px; }
.item-head strong { font-size: 13px; }
.condition { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.condition .inline-actions { margin-top: 5px; }
.inline-empty, .default-route { background: #f1f4ee; color: var(--muted); border-radius: 9px; padding: 15px; font-size: 13px; }
.detail > .inline-empty { margin: 15px; }
.tab-content > .fields + .tab-head, .tab-content > label + .fields { margin-top: 15px; }
dialog { width: min(530px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 15px; padding: 24px; color: var(--ink); }
dialog::backdrop { background: #142a23a0; }
dialog h2 { margin-bottom: 12px; }
dialog p, dialog label { margin-bottom: 12px; }
.dialog-error { color: #87362f; margin: 12px 0 0; font-size: 13px; }
dialog .check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.dialog-actions { display: flex; gap: 8px; justify-content: end; margin-top: 14px; }
.preview-result { display: grid; grid-template-columns: auto 1fr; gap: 7px 15px; font-size: 13px; background: #f1f4ee; border-radius: 8px; padding: 12px; }
.preview-result dt { font-weight: 650; }
.preview-result dd { margin: 0; overflow-wrap: anywhere; }
#notice { position: fixed; z-index: 2; right: 20px; bottom: 20px; max-width: min(500px, calc(100% - 40px)); background: #215b45; color: white; border-radius: 9px; padding: 12px 15px; font-size: 14px; box-shadow: 0 6px 18px #0b201e24; }
#notice.error { background: #87362f; }
@media (max-width: 1020px) {
  body { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { font-size: 13px; }
  .canvas, .topbar { padding-inline: 23px; }
  .editor-grid { grid-template-columns: minmax(150px, 165px) minmax(0, 1fr); gap: 12px; }
  .fields.three { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { display: block; }
  .sidebar { min-height: 0; padding: 14px 16px 7px; }
  .sidebar-menu { gap: 10px; margin: 16px 0 6px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 3px 7px; }
  .nav-link { width: auto; padding: 8px; }
  .nav-label { margin-left: 8px; }
  .local-label { display: none; }
  .topbar { height: 45px; padding-inline: 15px; }
  .canvas { padding: 24px 15px 40px; }
  .editor-grid, .fields.two { grid-template-columns: 1fr; }
  .tab-content, .step-heading { padding-inline: 12px; }
  .step-link small { margin-left: auto; }
}

.document-explanation { white-space: pre-wrap; overflow-wrap: anywhere; }

body.workspace-pending, body.sign-in-page { display: block; }
.workspace-pending .sidebar, .workspace-pending .topbar,
.sign-in-page .sidebar, .sign-in-page .topbar { display: none; }
.sign-in-page .canvas { max-width: none; padding: 0; }
.sign-in-layout {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  min-height: 100vh;
  min-height: 100svh;
  background: #f7f7f1;
}
.sign-in-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding: clamp(2rem, 5.4vw, 5.5rem);
  color: #f5f7ef;
  background: radial-gradient(ellipse at 94% 81%, #347059, transparent 62%), #15382e;
}
.sign-in-brand::after {
  position: absolute;
  z-index: -1;
  content: '';
  inset: 34% -45% -32% 29%;
  transform: rotate(-28deg);
  border: 1px solid #d8ebce38;
  border-radius: 44% 0 0 0;
  background: repeating-linear-gradient(90deg, transparent 0 32px, #d8ebce2a 33px, transparent 34px);
  mask-image: linear-gradient(145deg, #0000 7%, #000 65%);
}
.sign-in-wordmark { display: flex; align-items: center; gap: .85rem; font-size: 1rem; font-weight: 650; }
.sign-in-wordmark small { margin-left: .25rem; color: #d5eca7; font-size: .75em; }
.sign-in-mark {
  flex: 0 0 auto;
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #d5eca7;
}
.sign-in-mark::before, .sign-in-mark::after { content: ''; position: absolute; }
.sign-in-mark::before { inset: 9px 12px; border: 1.5px solid #1e4839; border-radius: 3px; }
.sign-in-mark::after {
  top: 19px;
  left: 16px;
  width: 9px;
  height: 5px;
  border: solid #1e4839;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.sign-in-intro { padding-bottom: clamp(1.75rem, 7vh, 6rem); }
.sign-in-title {
  color: inherit;
  font-size: clamp(3rem, 6.5vw, 6.6rem);
  font-weight: 650;
  line-height: 1.01;
  letter-spacing: -.065em;
}
.sign-in-description {
  max-width: 29ch;
  margin-top: 1.45rem;
  color: #e0ede3;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
}
.sign-in-content { display: grid; place-items: center; padding: clamp(1.35rem, 5vw, 5rem); }
.sign-in-card { width: min(100%, 25rem); }
.sign-in-card h1 { font-size: clamp(2.1rem, 4vw, 3rem); }
.sign-in-instruction { margin-top: .65rem; color: #4e6158; }
#v2-sign-in { display: grid; margin-top: 2rem; }
#v2-sign-in label { margin-bottom: .55rem; color: #263b32; font-size: .91rem; font-weight: 650; }
#v2-sign-in label[for=sign-in-password] { margin-top: 1.15rem; }
#v2-sign-in input {
  min-height: 52px;
  padding: .8rem .95rem;
  border-radius: 10px;
  border-color: #b4c3b9;
  font-size: 1rem;
}
#v2-sign-in input:focus { border-color: #21644d; }
.sign-in-password { position: relative; }
#v2-sign-in .sign-in-password input { padding-right: 4.75rem; }
.sign-in-toggle {
  position: absolute;
  top: 4px;
  right: 5px;
  bottom: 4px;
  min-width: 52px;
  padding: 0 .6rem;
  border: 0;
  border-radius: 7px;
  background: #eaf1e8;
  color: #214f3e;
  font-size: .85rem;
  font-weight: 650;
}
.sign-in-toggle:hover { background: #dfeadd; }
.sign-in-error {
  margin-top: .8rem;
  padding: .65rem .8rem;
  border-radius: 8px;
  background: #f9eae4;
  color: #842e23;
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.sign-in-submit {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .6rem;
  margin-top: 1.25rem;
  min-height: 52px;
  padding: .75rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #215b45;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.sign-in-submit:hover { background: #184633; }
.sign-in-submit:disabled { opacity: 1; background: #3d6856; }
.sign-in-spinner {
  display: none;
  width: .95rem;
  height: .95rem;
  border: 2px solid #ffffff85;
  border-top-color: white;
  border-radius: 50%;
  animation: sign-in-spin .7s linear infinite;
}
#v2-sign-in[aria-busy=true] .sign-in-spinner { display: block; }
@keyframes sign-in-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sign-in-spinner { animation: none; } }
.sign-in-announcer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sign-in-help { margin-top: 1.25rem; color: #4e6158; font-size: .91rem; }
@media (max-width: 740px) {
  .sign-in-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sign-in-brand { gap: 1.4rem; padding: 1.25rem clamp(1.35rem, 5vw, 3rem); }
  .sign-in-intro { padding-bottom: 0; }
  .sign-in-title { font-size: clamp(1.75rem, 6vw, 2.65rem); letter-spacing: -.045em; }
  .sign-in-title br { display: none; }
  .sign-in-description { display: none; }
  .sign-in-content { align-items: start; padding-block: 2.15rem; }
}
