/* Палитра и типографика те же, что в грамматике монтажа: INK/BONE/VERM/EMER, Unbounded + Manrope */
:root {
  --ink: #17140F;
  --ink-2: #1F1B15;
  --ink-3: #2A2620;
  --bone: #EDE7D9;
  --mut: #8A8275;
  --verm: #FF3B2E;
  --emer: #12A66B;
  --line: #332E26;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--bone); text-decoration: none; }

h1, h2, h3, .display {
  font-family: 'Unbounded', 'Manrope', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px; }

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(23, 20, 15, 0.94);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.logo { font-family: 'Unbounded', sans-serif; font-weight: 900; font-size: 18px; letter-spacing: -0.03em; }
.logo span { color: var(--emer); }

.muted { color: var(--mut); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }

.row { display: flex; gap: 12px; align-items: center; }
.row.wrap-r { flex-wrap: wrap; }
.spacer { flex: 1; }

.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

button, .btn {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  background: var(--bone);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 18px;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.ghost, .btn.ghost { background: transparent; color: var(--bone); border-color: var(--line); }
button.accent { background: var(--emer); color: #06180F; }
button.danger { background: transparent; color: var(--verm); border-color: rgba(255, 59, 46, 0.4); }

input[type=text], input[type=password], input[type=number], select {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  color: var(--bone);
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  width: 100%;
}

input:focus, select:focus { outline: none; border-color: var(--emer); }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--mut); margin-bottom: 6px; }

/* прогресс */
.bar { height: 8px; background: var(--ink-3); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--emer); width: 0; transition: width 0.4s ease; }
.bar.err > i { background: var(--verm); }

.stage { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 10px 0; align-items: start; }
.stage + .stage { border-top: 1px solid rgba(51, 46, 38, 0.6); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); margin-top: 6px; }
.dot.running { background: var(--emer); animation: pulse 1.1s infinite; }
.dot.done { background: var(--emer); }
.dot.error { background: var(--verm); }
.dot.skipped { background: var(--mut); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.stage-title { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 14px; }
.stage-note { font-size: 13px; color: var(--mut); margin-top: 2px; }

/* карточки проектов */
.plist { display: grid; gap: 12px; }
.pitem {
  display: flex; gap: 16px; align-items: center;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px;
}
.pitem:hover { border-color: var(--mut); }

.badge {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 8px; background: var(--ink-3); color: var(--mut);
  white-space: nowrap;
}
.badge.done { background: rgba(18, 166, 107, 0.15); color: var(--emer); }
.badge.running { background: rgba(18, 166, 107, 0.15); color: var(--emer); }
.badge.error { background: rgba(255, 59, 46, 0.15); color: var(--verm); }
.badge.confirmed { background: rgba(237, 231, 217, 0.1); color: var(--bone); }

/* результаты */
.grid-out { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.out-card { background: var(--ink-3); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.out-card video { width: 100%; display: block; background: #000; }
.out-card .body { padding: 12px 14px; }
.out-card .name { font-weight: 700; font-size: 14px; margin-bottom: 8px; }

.drop {
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 22px;
  text-align: center; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.drop:hover, .drop.over { border-color: var(--emer); background: rgba(18, 166, 107, 0.06); }
.drop.has { border-style: solid; text-align: left; }

.storage { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.storage .bar { flex: 1; min-width: 90px; max-width: 160px; }

dialog {
  background: var(--ink-2); color: var(--bone); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; max-width: 440px; width: 92%;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }

pre.prompt {
  white-space: pre-wrap; font-family: 'Manrope', sans-serif; font-size: 13px;
  background: var(--ink-3); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; max-height: 340px; overflow: auto; margin: 0;
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--bone); color: var(--ink); font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: 12px; z-index: 50; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .wrap { padding: 20px 14px 60px; }
  h1 { font-size: 24px; }
  .pitem { flex-wrap: wrap; }
}
