@font-face {
  font-family: Inter;
  src: url("/assets/inter-cyrillic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter;
  src: url("/assets/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  color: #1e2433;
  background: #f8f9fc;
  font: 15px/1.55 Inter, system-ui, sans-serif;
  accent-color: #2943a2;
  --muted: #556079;
  --line: #e1e6ef;
  --accent: #2943a2;
  --accent-hover: #203580;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, p { margin: 0; }
button, input { color: inherit; font: inherit; }
a { color: var(--accent); text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(1104px, 100% - 64px); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: #fff; }
.header-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -.04em; color: inherit; text-decoration: none; }
.brand-mark { position: relative; display: block; width: 27px; height: 25px; color: var(--accent); }
.brand-mark i { position: absolute; width: 15px; height: 7px; border-top: 2px solid; border-right: 2px solid; transform: skewX(-35deg); border-radius: 2px; }
.brand-mark i:nth-child(1) { top: 4px; left: 1px; }
.brand-mark i:nth-child(2) { top: 10px; left: 5px; }
.brand-mark i:nth-child(3) { top: 16px; left: 9px; }

.access { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 9vw, 124px); align-items: center; padding-block: clamp(54px, 12vh, 126px); }
.form-panel { width: min(100%, 390px); }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.04; letter-spacing: -.055em; text-wrap: balance; }
.intro { margin-top: 14px; color: var(--muted); }
.account-form { display: grid; gap: 16px; margin-top: 30px; }
.account-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.account-form input { width: 100%; height: 46px; border: 1px solid #cdd4e3; border-radius: 8px; background: white; padding: 0 12px; font-size: 16px; font-weight: 400; }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 8px; padding: 0 16px; cursor: pointer; font-weight: 600; font-size: 14px; }
.primary { background: var(--accent); color: #fff; min-height: 46px; }
.primary:is(:hover, :focus-visible) { background: var(--accent-hover); }
.secondary { background: white; border-color: var(--line); }
.secondary:hover { border-color: #bac5dd; }
.button:disabled { opacity: .65; cursor: progress; }
.alternatives { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 17px; }
.link { border: 0; padding: 5px 0; background: none; color: var(--accent); cursor: pointer; font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.form-status { color: var(--muted); font-size: 14px; }
.form-status[data-error="true"] { color: #9b303b; }

.diagram { display: grid; place-items: center; min-height: 430px; padding: 40px 24px; border: 1px solid #dce3f0; border-radius: 16px; background: radial-gradient(circle, #cbd5e8 1px, transparent 1px) 5px 5px / 20px 20px, #edf1fa; }
.diagram-body { width: min(100%, 245px); }
.stage { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 1px solid #d7dfed; border-radius: 10px; background: #fff; font-weight: 600; }
.stage-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 7px; color: var(--accent); background: #edf1fb; font-size: 20px; }
.result { border-color: #a8b7df; color: #233986; }
.connector { width: 2px; height: 23px; background: #aab9d5; margin-left: 32px; }

.workspace { padding-block: 54px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 24px; }
.muted { color: var(--muted); margin-bottom: 10px; overflow-wrap: anywhere; }
.empty { background: #fff; padding: 24px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.skeleton { display: grid; gap: 16px; width: min(390px, 100%); padding-block: 106px; }
.skeleton i { height: 16px; background: #e8ecf4; border-radius: 6px; }
.skeleton i:first-child { height: 42px; width: 60%; }
.skeleton i:last-child { width: 80%; }

@media (max-width: 735px) {
  .shell { width: calc(100% - 40px); }
  .header-inner { min-height: 59px; }
  .access { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 40px; }
  .form-panel { width: 100%; }
  .diagram { min-height: auto; padding: 24px 18px; }
  .stage { min-height: 52px; padding-block: 7px; }
  .connector { height: 15px; }
  .workspace { padding-block: 36px; }
}

.workspace-section + .workspace-section { margin-top: 28px; }
.workspace h2, .workspace h3 { margin: 0; letter-spacing: -.025em; }
.workspace h2 { font-size: 21px; }
.workspace h3 { font-size: 15px; }
.workspace-section h2 { margin-bottom: 10px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.resource-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 18px; }
.resource-row + .resource-row { border-top: 1px solid var(--line); }
.resource-row strong { display: block; overflow-wrap: anywhere; }
.resource-row small, .step-heading small { color: var(--muted); }
.empty-line { color: var(--muted); padding: 17px 18px; }
.editor { display: grid; gap: 16px; padding: 22px; }
.editor + .editor { margin-top: 18px; }
.editor-title, .editor-tools, .step-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.editor-title { justify-content: space-between; }
.editor-title h2 { overflow-wrap: anywhere; }
.back { margin-bottom: 14px; }
.step-heading > :last-child { margin-left: auto; }
.step-heading code, .status-pill { border-radius: 6px; background: #edf1fb; padding: 4px 8px; color: var(--accent); font-size: 12px; }
.step-list { display: grid; gap: 12px; }
.step-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-left: 3px solid #b7c2e3; border-radius: 8px; min-width: 0; }
.field, .input-form { display: grid; gap: 8px; }
.field { color: var(--muted); font-weight: 600; font-size: 13px; }
.editor :is(input, select, textarea) { color: #1e2433; background: #fff; font: 400 16px/1.45 Inter, sans-serif; border: 1px solid #cdd4e3; border-radius: 8px; padding: 8px 10px; max-width: 100%; }
.editor textarea { resize: vertical; min-height: 100px; }
.editor pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; border-radius: 6px; background: #f4f6fc; }
.editor summary { cursor: pointer; color: var(--accent); }
.input-form .button { justify-self: start; }
@media (max-width: 550px) {
  .editor { padding: 14px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; }
  .workspace-heading .button { min-height: 42px; }
}

.quota { margin-bottom: 28px; padding: 17px 18px; }
.quota-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.quota :is(small, dt) { color: var(--muted); font-size: 13px; }
.quota dl { display: grid; grid-template-columns: 2fr repeat(2, 1fr); gap: 16px; margin: 14px 0 0; }
.quota dd { margin: 2px 0; font-size: 20px; font-weight: 650; }
@media (max-width: 620px) {
  .quota dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quota dl > :first-child { grid-column: 1 / -1; }
}

.library-link { margin-bottom: 16px; }

.graph-map {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #dce3f0;
  border-radius: 10px;
  background: radial-gradient(circle, #cbd5e8 1px, transparent 1px) 5px 5px / 20px 20px, #edf1fa;
}
.graph-map > .form-status { padding: 12px 16px 0; }
.graph-stage { display: flex; gap: 42px; width: max-content; min-width: 100%; min-height: 112px; padding: 20px 16px; position: relative; }
.graph-stage canvas { width: 100%; height: 100%; position: absolute; inset: 0; pointer-events: none; }
.graph-column { display: grid; align-content: center; gap: 10px; z-index: 1; }
.graph-node { display: grid; gap: 2px; text-align: left; width: 142px; border: 1px solid #bcc9e4; background: #fff; border-radius: 7px; padding: 7px 10px; overflow-wrap: anywhere; }
button.graph-node { cursor: pointer; }
button.graph-node:hover { border-color: var(--accent); color: var(--accent); }
.graph-node small { color: var(--muted); font-size: 11px; }
.graph-node strong { font-size: 13px; }
.graph-input { border-style: dashed; }

.graph-map { max-height: 390px; }
.graph-stage canvas { right: auto; bottom: auto; }
.editor details > .editor-tools { margin-top: 10px; }
.editor details > form.editor-tools { align-items: end; }
.input-chip { background: #f0f3fa; padding: 0 9px; border-radius: 6px; }
