/* Связка — демо автоматизации arweiss */

@font-face { font-family: "Onest"; src: url("fonts/onest-cyrillic.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("fonts/onest-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }

:root {
  --bg: #f4f3f8;
  --card: #ffffff;
  --ink: #14121f;
  --muted: #5d5a70;
  --line: #e2e0ec;
  --line-strong: #8a879c;
  --accent: #5b3df5;
  --accent-dark: #4529d1;
  --accent-soft: #ece8ff;
  --ok: #12704a;
  --ok-soft: #dff5ea;
  --warn: #8a5200;
  --warn-soft: #fff0d2;
  --stop: #a3201a;
  --stop-soft: #fde6e4;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 .9375rem/1.5 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.noscript { margin: 16px; padding: 14px 16px; border: 1px solid currentColor; border-radius: 12px; }
.demo-bar { background: var(--ink); color: #dcd9ea; text-align: center; font-size: .8125rem; padding: 8px 16px; }
.wrap { max-width: 1180px; margin-inline: auto; padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px) 40px; }

.head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; margin-bottom: clamp(20px, 3vw, 36px); }
h1 { font-size: clamp(1.875rem, 4.4vw, 3rem); font-weight: 600; line-height: 1.05; letter-spacing: -.04em; text-wrap: balance; }
.lead { margin-top: 16px; max-width: 40em; font-size: 1.0625rem; color: #33304a; text-wrap: pretty; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stats li { background: var(--card); border-radius: 16px; padding: 12px 14px; }
.stats strong { display: block; font-size: 1.625rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: .8125rem; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.card { background: var(--card); border-radius: 24px; padding: clamp(18px, 2.4vw, 28px); min-width: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h2 { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
.n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8125rem; }
.link { background: none; border: 0; padding: 10px 4px; color: var(--accent-dark); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:disabled { opacity: .5; cursor: default; }

form { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.field label { display: block; margin-bottom: 6px; font-weight: 500; font-size: .875rem; }
.field input, .field select { width: 100%; min-height: 46px; padding: 0 14px; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; }
.field [aria-invalid="true"] { border-color: var(--stop); box-shadow: inset 0 0 0 1px var(--stop); }
.hint { margin-top: 6px; color: var(--muted); font-size: .8125rem; }
.err { margin-top: 6px; color: var(--stop); font-size: .8125rem; }
.btn { min-height: 48px; padding: 0 24px; background: var(--accent); color: #fff; border: 0; border-radius: 999px; font-weight: 500; cursor: pointer; transition: background-color .2s; }
.btn:hover:not(:disabled) { background: var(--accent-dark); }
.btn:disabled { opacity: .6; cursor: progress; }

.flow { display: grid; }
.step { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 0 14px; padding-bottom: 16px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step__dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); color: var(--muted); font-size: .875rem; font-weight: 600; transition: background-color .2s, border-color .2s, color .2s; }
.step__title { font-weight: 500; line-height: 32px; }
.step__text { grid-column: 2; color: var(--muted); font-size: .875rem; min-height: 1.4em; overflow-wrap: anywhere; }
.step[data-state="run"] .step__dot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); animation: pulse 1s infinite; }
.step[data-state="ok"] .step__dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.step[data-state="warn"] .step__dot { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.step[data-state="stop"] .step__dot { border-color: var(--stop); background: var(--stop); color: #fff; }
.step[data-state="skip"] .step__title { color: var(--muted); }
.step[data-state="ok"] .step__text, .step[data-state="warn"] .step__text, .step[data-state="stop"] .step__text { color: var(--ink); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(91, 61, 245, .15); } }
.rules { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }

.card--wide { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .8125rem; font-weight: 500; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tr.is-fresh td { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 500; background: var(--ok-soft); color: var(--ok); }
.tag--prio { background: var(--accent-soft); color: var(--accent-dark); }
.tag--dup { background: var(--warn-soft); color: var(--warn); }
.empty { padding: 20px 0 4px; color: var(--muted); }

.chat { display: grid; gap: 10px; max-height: 340px; overflow-y: auto; }
.note { padding: 12px 14px; border-radius: 16px; border-bottom-left-radius: 6px; background: var(--bg); white-space: pre-line; overflow-wrap: anywhere; animation: rise .25s ease-out; }
.note--prio { background: var(--accent-soft); }
.note--warn { background: var(--warn-soft); }
.note__meta { display: block; margin-bottom: 2px; font-size: .75rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.foot { margin-top: 24px; color: var(--muted); font-size: .875rem; max-width: 60em; }

@media (max-width: 900px) {
  .head, .grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
