/* ─── Tool page styles — naследует переменные из app.css ──────────── */

/* nav tool button — отдельный визуал */
.cat--tool {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}
.cat--tool:hover { filter: brightness(1.08); }
.cat--tool-active {
  box-shadow: var(--shadow);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tool {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px var(--pad) 96px;
}

@media (max-width: 720px) {
  .tool { padding: 28px 20px 64px; }
}

/* ─── Hero ─────────────────────────────────────────────────────────── */
.tool__hero {
  text-align: center;
  margin-bottom: 36px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.tool__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  margin-bottom: 16px;
}
.tool__hero h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1.05;
}
.tool__lead {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--fg-2);
  max-width: 760px;
  margin: 0 auto 16px;
  line-height: 1.55;
}
.tool__meta {
  font-size: 13px;
  color: var(--fg-3);
  font-family: var(--mono);
}

/* ─── Form ─────────────────────────────────────────────────────────── */
.tool__form-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}
@media (max-width: 720px) {
  .tool__form-card { padding: 20px; border-radius: var(--r-md); }
}

.field {
  display: block;
  margin-bottom: 20px;
}
.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.field textarea,
.field input[type="text"],
.field select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
}
.field textarea:focus,
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.field-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

/* button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 15px;
  font-family: var(--sans);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { filter: brightness(1.08); }
.btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--fg);
}
.btn--ghost:hover { background: var(--bg-1); }

.form-error {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--c-spc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-spc) 35%, transparent);
  color: var(--c-spc);
  font-size: 14px;
}

/* ─── Pipeline ─────────────────────────────────────────────────────── */
.tool__pipeline { margin-bottom: 32px; }
.pipeline__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.pipeline__head h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  margin: 0;
}
.pipeline__progress {
  font-family: var(--mono);
  color: var(--fg-3);
  font-size: 14px;
}

.agents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.agent-card[data-status="running"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}
.agent-card[data-status="done"] {
  border-color: color-mix(in srgb, var(--c-ai) 50%, var(--line));
}
.agent-card[data-status="error"] {
  border-color: color-mix(in srgb, var(--c-spc) 50%, var(--line));
}

.agent-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.agent-card__icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  font-size: 16px;
}
.agent-card__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  flex: 1;
}
.agent-card__status {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--fg-3);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.agent-card[data-status="running"] .agent-card__status {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
}
.agent-card[data-status="done"] .agent-card__status {
  background: color-mix(in srgb, var(--c-ai) 18%, transparent);
  color: var(--c-ai);
}
.agent-card[data-status="error"] .agent-card__status {
  background: color-mix(in srgb, var(--c-spc) 14%, transparent);
  color: var(--c-spc);
}

.agent-card__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-2);
}
.agent-card__body .kv {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 4px 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.agent-card__body .kv:last-child { border-bottom: 0; }
.agent-card__body .kv__k {
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.agent-card__body ul {
  margin: 6px 0;
  padding-left: 18px;
}
.agent-card__body ul li { margin: 3px 0; }
.agent-card__body em {
  color: var(--fg-3);
  font-style: italic;
}
.agent-card__body .chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  font-size: 12px;
  margin: 2px 4px 2px 0;
}

.agent-card__body .quote {
  border-left: 3px solid var(--accent);
  padding: 6px 12px;
  margin: 8px 0;
  font-style: italic;
  color: var(--fg);
  background: var(--bg-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.agent-card__skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agent-card__skeleton span {
  height: 10px;
  background: linear-gradient(90deg, var(--bg-2), var(--bg-1), var(--bg-2));
  background-size: 200% 100%;
  border-radius: 4px;
  animation: pulse 1.4s infinite;
}
.agent-card__skeleton span:nth-child(2) { width: 80%; }
.agent-card__skeleton span:nth-child(3) { width: 60%; }
@keyframes pulse {
  0% { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}

.dot { display:inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.dot--live { animation: blink 1.5s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ─── Summary ──────────────────────────────────────────────────────── */
.tool__summary {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.tool__summary h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  margin: 0 0 16px;
}
.summary__body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
  margin: 0 0 20px;
}
.summary__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── Footer ───────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px var(--pad);
  font-size: 13px;
  color: var(--fg-3);
  background: var(--bg-1);
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.footer a { color: var(--fg-2); text-decoration: none; }
.footer a:hover { color: var(--accent); }
