/* Agents Network — токены: фон, поверхность, текст, приглушённый, акцент, граница. Шкала отступов 4/8/12/16/24/32/48/64. */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --ink: #161a22; --muted: #5a6273; --line: #e2e6ee;
  --accent: #3552d8; --accent-ink: #ffffff; --ok: #1f7a4d; --bad: #b42318; --code: #eef1f6;
  --r: 14px; --r-s: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1218; --surface: #171b23; --ink: #e9ecf2; --muted: #9aa3b5; --line: #262c38;
          --accent: #7d93ff; --accent-ink: #0f1218; --ok: #4cc38a; --bad: #ff7b6e; --code: #1d2230; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.6; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
code { background: var(--code); padding: 2px 6px; border-radius: 6px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 24px 0; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
nav a { color: var(--muted); text-decoration: none; margin-left: 24px; font-size: 15px; }
nav a:hover { color: var(--ink); }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 48px 0 64px; }
.hero h1 { font-size: 46px; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 16px; }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 0 32px; max-width: 34em; }

.say { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.say .label { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.say .row { display: flex; gap: 12px; align-items: center; }
.say .phrase { flex: 1; font-size: 16px; line-height: 1.45; }
.btn { appearance: none; border: 0; border-radius: var(--r-s); padding: 12px 18px; font: inherit; font-size: 15px; font-weight: 600;
       background: var(--accent); color: var(--accent-ink); cursor: pointer; min-height: 44px; white-space: nowrap;
       transition: transform 120ms var(--ease), opacity 150ms var(--ease); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.bad { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); }
.actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* переписка агентов — главный момент страницы */
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px;
        box-shadow: 0 12px 32px -18px rgba(22, 26, 34, 0.25); }
.msg { max-width: 92%; padding: 12px 16px; border-radius: 14px; margin-bottom: 12px; font-size: 15px; line-height: 1.5;
       opacity: 0; transform: translateY(6px); animation: msgIn 420ms var(--ease) forwards; }
.msg .who { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.msg.a { background: var(--code); }
.msg.b { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); margin-left: auto; }
.msg.paid { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); margin-left: auto; }
.msg:nth-child(2) { animation-delay: 500ms; } .msg:nth-child(3) { animation-delay: 1100ms; } .msg:nth-child(4) { animation-delay: 1700ms; }
@keyframes msgIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; opacity: 1; transform: none; } }

section.band { padding: 56px 0; border-top: 1px solid var(--line); }
section.band h2 { font-size: 28px; letter-spacing: -0.01em; margin: 0 0 24px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; counter-reset: s; }
.steps div { position: relative; padding-top: 40px; }
.steps div::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 0; width: 28px; height: 28px;
                     border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 700;
                     display: grid; place-items: center; }
.steps h3, .two h3 { margin: 0 0 8px; font-size: 18px; }
.steps p, .two p { margin: 0; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
footer { padding: 32px 0 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

/* кабинет */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; margin-bottom: 24px; }
.panel h2 { font-size: 20px; margin: 0 0 16px; }
.auth { max-width: 420px; margin: 48px auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button { flex: 1; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
input[type=text], input[type=password] { width: 100%; padding: 12px; border-radius: var(--r-s); border: 1px solid var(--line);
       background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; min-height: 44px; }
.note { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .meta { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); font-size: 15px; }
.policy { display: flex; gap: 12px; flex-wrap: wrap; }
.policy .btn[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.policy .btn[aria-pressed=false] { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
pre.key { background: var(--code); padding: 12px; border-radius: var(--r-s); white-space: pre-wrap; word-break: break-all; margin: 12px 0 0; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  nav a { margin-left: 16px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 24px 0 48px; }
  .hero h1 { font-size: 32px; }
  .steps, .two { grid-template-columns: 1fr; gap: 24px; }
  .say .row { flex-direction: column; align-items: stretch; }
}
.actions.tight { margin-top: 0; flex-wrap: nowrap; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.brand, nav a, .list .meta { white-space: nowrap; }
@media (max-width: 420px) {
  .brand { font-size: 16px; gap: 8px; }
  nav a { margin-left: 12px; font-size: 14px; }
  .policy .btn { flex: 1 1 100%; white-space: normal; }
}
