:root {
  --bg: #f4f5f7; --card: #ffffff; --line: #e4e6eb; --text: #14171c; --muted: #68707d;
  --accent: #2457d6; --accent-soft: #e8eefc;
  --red: #d92d20; --red-soft: #fdecea; --red-line: #f6c7c2;
  --amber: #b86e00; --amber-soft: #fff4dd; --amber-line: #f3dba5;
  --green: #16803c; --green-soft: #e5f5ea;
  --track: #e9ebef; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014; --card: #181b21; --line: #2a2e37; --text: #f1f3f6; --muted: #99a1ae;
    --accent: #7ea2ff; --accent-soft: #1c2742;
    --red: #ff6b5e; --red-soft: #2c1614; --red-line: #5a2621;
    --amber: #f2b648; --amber-soft: #2b2110; --amber-line: #57431a;
    --green: #4cc97a; --green-soft: #12281a;
    --track: #2a2e37; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1014; --card: #181b21; --line: #2a2e37; --text: #f1f3f6; --muted: #99a1ae;
  --accent: #7ea2ff; --accent-soft: #1c2742;
  --red: #ff6b5e; --red-soft: #2c1614; --red-line: #5a2621;
  --amber: #f2b648; --amber-soft: #2b2110; --amber-line: #57431a;
  --green: #4cc97a; --green-soft: #12281a;
  --track: #2a2e37; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  padding: env(safe-area-inset-top) 0 calc(28px + env(safe-area-inset-bottom));
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }

header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 14px; }
h1 { font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.updated { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
        font-weight: 600; font-size: 15px; white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }

h2 { font-size: 21px; margin: 30px 0 12px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
h2 .count { font-size: 14px; font-weight: 600; color: var(--muted); background: var(--track); padding: 2px 10px; border-radius: 999px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 22px 0 10px; font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); display: block; }
.grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }

/* верх: горит / ждёт */
.top { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.stack { display: grid; gap: 12px; margin-top: 12px; }
.stack:empty { display: none; }
.alert { border-radius: 18px; padding: 16px; border: 1px solid; }
.alert.fire { background: var(--red-soft); border-color: var(--red-line); }
.alert.wait { background: var(--amber-soft); border-color: var(--amber-line); }
.alert.calm { background: var(--green-soft); border-color: transparent; }
.alert-title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.alert.fire .alert-title { color: var(--red); }
.alert.wait .alert-title { color: var(--amber); }
.alert.calm .alert-title { color: var(--green); margin: 0; font-size: 17px; }
.alert-title .num { margin-left: auto; font-size: 26px; font-variant-numeric: tabular-nums; }
.item { display: block; padding: 12px 0; border-top: 1px solid var(--line); }
.alert.fire .item { border-color: var(--red-line); }
.alert.wait .item { border-color: var(--amber-line); }
.alert-title + .item, .wait-list .item:first-child { border-top: 0; }
.item:last-child { padding-bottom: 2px; }
.item b { display: block; font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.item span { font-size: 17px; }

/* проекты */
.proj { transition: border-color .15s, transform .15s; }
.proj:active { transform: scale(.985); }
.proj-head { display: flex; align-items: center; gap: 10px; }
.proj-name { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; }
.proj-name::after { content: "\00a0›"; color: var(--muted); font-weight: 400; }
.tag { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; flex: none; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.wait { background: var(--amber-soft); color: var(--amber); }
.tag.fire { background: var(--red-soft); color: var(--red); }
.tag.pause { background: var(--track); color: var(--muted); }
.now { margin: 10px 0 6px; }
.last { color: var(--muted); font-size: 15px; }

/* Jarvis: задача с шагами */
.task { padding: 4px 0 16px; }
.task + .task { border-top: 1px solid var(--line); padding-top: 16px; }
.task:last-child { padding-bottom: 4px; }
.task-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.task-title { font-weight: 700; font-size: 18px; min-width: 0; }
.task-dur { color: var(--muted); font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps li { font-size: 13px; color: var(--muted); padding-top: 10px; position: relative; text-align: left; }
.steps li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 999px; background: var(--track); }
.steps li.past { color: var(--text); }
.steps li.past::before { background: var(--green); }
.steps li.cur { color: var(--accent); font-weight: 700; }
.steps li.cur::before { background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .steps li.cur::before { animation: none; } }
.idle { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; font-size: 16px; padding: 2px 0 6px; }

.log { list-style: none; margin: 8px 0 0; padding: 0; }
.log li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.card > .log:first-child { margin-top: 0; }
.card > .log:first-child li:first-child { border-top: 0; padding-top: 2px; }
.log li:last-child { padding-bottom: 2px; }
.log time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.log small { display: block; color: var(--muted); font-size: 14px; }
details { margin-top: 10px; }
summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 16px; padding: 6px 0; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: " ▾"; }
details[open] summary::after { content: " ▴"; }

/* серверы */
.srv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.srv-name { font-size: 19px; font-weight: 700; flex: 1; }
.srv-sub { color: var(--muted); font-size: 14px; font-weight: 400; display: block; }
.meter { margin: 12px 0; }
.meter-row { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; margin-bottom: 6px; }
.meter-row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.bar i.amber { background: var(--amber); }
.bar i.red { background: var(--red); }
.facts { margin: 14px 0 0; padding: 0; list-style: none; }
.facts li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 16px; }
.facts li:last-child { padding-bottom: 0; }
.facts li span:last-child { margin-left: auto; color: var(--muted); text-align: right; }
.g { color: var(--green); } .a { color: var(--amber); } .r { color: var(--red); } .n { color: var(--muted); }

/* страница проекта */
.back { padding-top: 16px; }
.back a { color: var(--accent); font-weight: 600; font-size: 16px; display: inline-block; padding: 6px 10px 6px 0; }
.proj-header { padding-top: 6px; }
.lead { font-size: 19px; margin: 0 0 18px; }
.numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.number { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.number b { display: block; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.number span { color: var(--muted); font-size: 15px; }
.plan { list-style: none; margin: 0; padding: 0; }
.plan li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.plan li:first-child { border-top: 0; padding-top: 2px; }
.plan li:last-child { padding-bottom: 2px; }
.plan .mark { width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; border: 2px solid var(--muted); }
.plan .now .mark { border-color: var(--accent); background: var(--accent); }
.plan small { display: block; color: var(--muted); font-size: 14px; }
.plan .now small { color: var(--accent); font-weight: 600; }
.links { display: grid; gap: 10px; }
.link { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.link-label { flex: 1; min-width: 0; font-weight: 600; color: var(--accent); }
.link-label small { display: block; color: var(--muted); font-weight: 400; font-size: 14px; }
.chev { color: var(--muted); font-size: 22px; }

/* вход */
.auth { max-width: 380px; margin: 12vh auto 0; }
.auth h1 { margin-bottom: 18px; }
.auth label { display: block; font-size: 15px; color: var(--muted); margin: 10px 0 6px; }
.auth label:first-of-type { margin-top: 0; }
.auth input[type=password] { width: 100%; min-height: 50px; font: inherit; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.auth input:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.msg { color: var(--red); margin: 10px 0 0; font-size: 15px; }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 14px; min-height: 50px; padding: 0 18px;
       border: 0; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--card); }

footer { color: var(--muted); font-size: 13px; text-align: center; margin-top: 28px; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; padding: 10px; }

@media (min-width: 760px) {
  .wrap { padding: 0 28px; }
  h1 { font-size: 36px; }
  .top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
  .top.single { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .wait-list { column-count: 2; column-gap: 28px; }
  .wait-list .item { break-inside: avoid; border-top: 0; border-bottom: 1px solid var(--amber-line); padding-top: 10px; }
  .log.two { column-count: 2; column-gap: 28px; }
  .log.two li { break-inside: avoid; }
  .numbers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .proj:hover { border-color: var(--accent); }
}
@media (min-width: 1080px) {
  .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.w1{width:1%}.w2{width:2%}.w3{width:3%}.w4{width:4%}.w5{width:5%}.w6{width:6%}.w7{width:7%}.w8{width:8%}.w9{width:9%}.w10{width:10%}.w11{width:11%}.w12{width:12%}.w13{width:13%}.w14{width:14%}.w15{width:15%}.w16{width:16%}.w17{width:17%}.w18{width:18%}.w19{width:19%}.w20{width:20%}.w21{width:21%}.w22{width:22%}.w23{width:23%}.w24{width:24%}.w25{width:25%}.w26{width:26%}.w27{width:27%}.w28{width:28%}.w29{width:29%}.w30{width:30%}.w31{width:31%}.w32{width:32%}.w33{width:33%}.w34{width:34%}.w35{width:35%}.w36{width:36%}.w37{width:37%}.w38{width:38%}.w39{width:39%}.w40{width:40%}.w41{width:41%}.w42{width:42%}.w43{width:43%}.w44{width:44%}.w45{width:45%}.w46{width:46%}.w47{width:47%}.w48{width:48%}.w49{width:49%}.w50{width:50%}.w51{width:51%}.w52{width:52%}.w53{width:53%}.w54{width:54%}.w55{width:55%}.w56{width:56%}.w57{width:57%}.w58{width:58%}.w59{width:59%}.w60{width:60%}.w61{width:61%}.w62{width:62%}.w63{width:63%}.w64{width:64%}.w65{width:65%}.w66{width:66%}.w67{width:67%}.w68{width:68%}.w69{width:69%}.w70{width:70%}.w71{width:71%}.w72{width:72%}.w73{width:73%}.w74{width:74%}.w75{width:75%}.w76{width:76%}.w77{width:77%}.w78{width:78%}.w79{width:79%}.w80{width:80%}.w81{width:81%}.w82{width:82%}.w83{width:83%}.w84{width:84%}.w85{width:85%}.w86{width:86%}.w87{width:87%}.w88{width:88%}.w89{width:89%}.w90{width:90%}.w91{width:91%}.w92{width:92%}.w93{width:93%}.w94{width:94%}.w95{width:95%}.w96{width:96%}.w97{width:97%}.w98{width:98%}.w99{width:99%}.w100{width:100%}
