/* Палитра и детали — как у кабинета nocookie: графит и лайм */
:root {
  --bg: #08080a;
  --bg-1: #0c0c0f;
  --surface: #111114;
  --surface-2: #16161a;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --line-3: rgba(255, 255, 255, .2);
  --text: #ededef;
  --muted: #8d8d96;
  --dim: #5d5d66;
  --acc: #bef264;
  --acc-strong: #d9f99d;
  --acc-soft: rgba(190, 242, 100, .12);
  --acc-line: rgba(190, 242, 100, .35);
  --ok: #bef264;
  --info: #7dd3fc;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 14px;
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
* { scrollbar-color: #2a2a30 transparent; scrollbar-width: thin; }
::selection { background: var(--acc); color: var(--bg); }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--acc-strong); }
h1 { font-size: 22px; margin: 0; font-weight: 600; letter-spacing: -.02em; }
h2 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
h2::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--acc); flex: none; }
.mono { font-family: var(--mono); }

/* шапка */
.stripe { height: 3px; background: linear-gradient(90deg, var(--acc), transparent 70%); }
header.top {
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
header.top .bar { display: flex; align-items: center; gap: 14px; height: 56px; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: -.02em; }
.brand .logo { width: 22px; height: 22px; border-radius: 6px; background: var(--acc); display: grid; place-items: center; }
.brand .logo::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bg); }
.bar .crumb { color: var(--dim); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .crumb a { color: var(--muted); }
.bar .right { margin-left: auto; display: flex; gap: 8px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.topbar .grow { flex: 1; min-width: 0; }
.sub { color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }
a.sub:hover { color: var(--acc-strong); }

/* кнопки */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 500 14px/20px var(--font); color: var(--text); background: rgba(255, 255, 255, .02);
  border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 13px; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s; vertical-align: middle;
}
button:hover:not(:disabled), .btn:hover { border-color: var(--line-3); background: rgba(255, 255, 255, .05); color: var(--text); }
button:active:not(:disabled) { transform: scale(.98); }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--acc); border-color: var(--acc); color: #0a0a0a; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--acc-strong); border-color: var(--acc-strong); color: #0a0a0a; }
button.acc, .btn.acc { border-color: var(--acc-line); background: var(--acc-soft); color: var(--acc-strong); }
button.acc:hover:not(:disabled) { border-color: var(--acc); background: var(--acc-soft); color: var(--acc-strong); }
button.danger { color: var(--err); }
button.danger:hover:not(:disabled) { border-color: rgba(248, 113, 113, .5); color: var(--err); }
button.small { padding: 4px 9px; font-size: 12.5px; line-height: 18px; border-radius: 7px; }

/* поля */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 9px 11px; width: 100%; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc-line); box-shadow: 0 0 0 4px var(--acc-soft); }
input::placeholder, textarea::placeholder { color: var(--dim); }
select option { background: var(--surface); }
textarea { resize: vertical; min-height: 90px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.hint { font-size: 12px; color: var(--dim); margin-top: 5px; }

.panel {
  background: linear-gradient(180deg, #101013, #0b0b0e); border: 1px solid #1c1c21;
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  animation: nc-in .5s cubic-bezier(.2, .7, .2, 1) backwards;
}
@keyframes nc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .panel, .login form { animation: none; } }

.alert { display: flex; gap: 10px; border: 1px solid rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .07); border-radius: 11px; padding: 11px 13px; margin-bottom: 16px; font-size: 13.5px; color: var(--muted); }
.alert b { color: var(--warn); font-weight: 600; }

/* вход */
.login { min-height: 100vh; display: grid; place-items: start center; padding: 15vh 16px 0; position: relative; isolation: isolate;
  background: radial-gradient(600px 360px at 50% 0%, rgba(255, 255, 255, .06), transparent 70%), var(--bg); }
.login::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.4px); background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(640px 420px at 50% 10%, #000, transparent 75%); mask-image: radial-gradient(640px 420px at 50% 10%, #000, transparent 75%); }
.login form { width: 100%; max-width: 360px; padding: 24px; border: 1px solid #222227; border-radius: 16px;
  background: linear-gradient(180deg, #111114, #0c0c0f); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  animation: nc-in .7s cubic-bezier(.2, .7, .2, 1) backwards; }
.login .brand { justify-content: center; font-size: 22px; margin-bottom: 22px; }
.error { color: var(--err); font-size: 13px; min-height: 20px; }

/* список сайтов */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; color: var(--text);
  background: linear-gradient(180deg, #101013, #0b0b0e); border: 1px solid #1c1c21; border-radius: var(--radius);
  transition: border-color .2s, background-color .2s;
}
.card:hover { border-color: var(--acc-line); color: var(--text); }
.card .head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.card .name { font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .url { font: 12px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.card.add { align-items: center; justify-content: center; color: var(--muted); border-style: dashed; min-height: 128px; background: none; }
.card.add:hover { color: var(--acc-strong); }
.ava {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none;
  font-weight: 600; font-size: 14px; text-transform: uppercase; background: var(--surface-2); border: 1px solid var(--line-2);
}
.ava.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 18px; }
.empty { padding: 40px; text-align: center; color: var(--dim); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 18px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.badge.mono { font: 500 11px/18px var(--mono); letter-spacing: .02em; }
.badge.on { color: var(--acc-strong); border-color: var(--acc-line); background: var(--acc-soft); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .35); }
.st-done { color: var(--ok); }
.st-deployed { color: var(--info); }
.st-running, .st-queued { color: var(--warn); }
.st-error { color: var(--err); }
.st-reverted { color: var(--dim); }
.badge.st-done { border-color: var(--acc-line); }
.badge.st-deployed { border-color: rgba(125, 211, 252, .35); }
.badge.st-error { border-color: rgba(248, 113, 113, .35); }

/* возможности сайта под заголовком */
.caps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* форма задачи */
.taskform textarea { min-height: 110px; font-size: 14.5px; background: var(--bg-1); }
.taskform.drag { outline: 2px dashed var(--acc-line); outline-offset: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }
.toggles { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 14px; }
.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--muted); user-select: none; font-size: 13.5px; }
.toggle input { display: none; }
.toggle i { width: 30px; height: 18px; border-radius: 99px; background: #26262c; position: relative; transition: .2s; flex: none; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: .2s; }
.toggle input:checked + i { background: var(--acc); }
.toggle input:checked + i::after { left: 14px; background: #0a0a0a; }
.toggle input:checked ~ span { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 2px 4px 2px 8px; display: inline-flex; align-items: center; gap: 4px; }
.chip button { border: 0; background: none; padding: 0 4px; color: var(--muted); }
.chip img { height: 22px; border-radius: 3px; }

/* лог задачи */
.task-head { display: flex; align-items: center; gap: 10px; }
.task-head h2 { margin: 0; flex: 1; }
.prompt { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0; font-size: 15px; }
.log { font-size: 13.5px; }
.log > div { margin: 4px 0; }
.log .msg { white-space: pre-wrap; overflow-wrap: anywhere; padding: 6px 0; line-height: 1.6; }
.log .info { color: var(--dim); font: 12px/1.6 var(--mono); }
.log summary { cursor: pointer; font: 12px/1.6 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
.log summary:hover { color: var(--text); }
.log summary b { color: var(--acc); font-weight: 500; }
.log summary.err b { color: var(--err); }
.log pre, .oplog {
  margin: 4px 0 8px; padding: 9px 11px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; color: #b4b4bb;
}
.log .result, .log .fail, .log .deploy { padding: 10px 14px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; margin: 10px 0; }
.log .result { border-left: 3px solid var(--acc); }
.log .fail { border-left: 3px solid var(--err); }
.log .deploy { border-left: 3px solid var(--info); }
.log .deploy pre { margin-bottom: 0; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line-2); border-top-color: var(--acc); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.op-title { display: flex; align-items: center; gap: 8px; font-weight: 500; }
details > summary.sub { cursor: pointer; margin-top: 8px; }

/* история */
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 12px; align-items: baseline; padding: 9px 10px; border-radius: 9px; cursor: pointer; transition: background-color .15s; }
.history li + li { border-top: 1px solid var(--line); }
.history li:hover, .history li.active { background: color-mix(in srgb, var(--acc) 6%, transparent); }
.history li.active { box-shadow: inset 2px 0 0 var(--acc); }
.history .p { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history .d { color: var(--dim); font: 12px var(--mono); white-space: nowrap; }
.history .s { font-size: 12.5px; white-space: nowrap; }

/* diff2html в тёмной теме */
.diff { margin-top: 14px; overflow-x: auto; }
.diff .d2h-dark-color-scheme, .diff .d2h-file-wrapper, .diff .d2h-file-list-wrapper { background: var(--bg); }
.diff .d2h-file-header, .diff .d2h-file-wrapper, .diff .d2h-file-list-wrapper, .diff .d2h-file-list > li { border-color: var(--line-2); }
.diff .d2h-file-header { background: var(--surface); }
.diff .d2h-code-line, .diff .d2h-code-linenumber { font-family: var(--mono); font-size: 12px; }

/* настройки */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.section { margin-top: 8px; }
.access-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--acc-line); background: var(--acc-soft); border-radius: 11px; color: var(--acc-strong); font-size: 13px; margin-bottom: 16px; }
.access-note.muted { border-color: var(--line-2); background: var(--bg-1); color: var(--muted); }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 10px; display: none; max-width: calc(100% - 32px); z-index: 40; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); }
#toast.show { display: block; }
#toast.err { border-color: rgba(248, 113, 113, .5); color: var(--err); }

@media (max-width: 640px) {
  .cols { grid-template-columns: 1fr; }
  .topbar .actions { width: 100%; }
  .history .d.date { display: none; }
}
