/* PyHost — плоский тёмный интерфейс без градиентов и лишних эффектов */
:root {
  --bg: #333e4b;
  --hdr: #212932;
  --nav: #3a4552;
  --card: #3e4a58;
  --card-hi: #45515f;
  --card-lo: #38434f;
  --input: #4a5664;
  --input-hi: #525f6e;
  --line: #4b5866;
  --line-lo: #434f5c;
  --text: #e7ebf0;
  --text-2: #b4bec9;
  --muted: #8794a2;
  --accent: #2fb3a3;
  --blue: #2f73e8;
  --blue-hi: #3d80f0;
  --gray: #5c6774;
  --gray-hi: #66727f;
  --red: #c9403b;
  --red-hi: #d54b45;
  --green: #3aa65b;
  --yellow: #d6a336;
  --console: #161b21;
  --editor: #2c3641;
  --mono: "JetBrains Mono", "Cascadia Mono", "Fira Code", Consolas, "DejaVu Sans Mono", monospace;
  --font: "Open Sans", "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 3px;
  --wrap: 1240px;
  --sb: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); min-height: 100vh;
  -webkit-tap-highlight-color: transparent; }
a { color: #7fb0ff; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { margin-left: auto; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type=checkbox]:not(.switch input) { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border: 1.5px solid #7d8a98;
  border-radius: 2px; background: transparent; cursor: pointer; display: inline-grid; place-content: center; margin: 0; flex: none; }
input[type=checkbox]:not(.switch input):checked { background: var(--blue); border-color: var(--blue); }
input[type=checkbox]:not(.switch input):checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
input[type=checkbox]:not(.switch input):focus-visible { outline: 2px solid #6f8db3; outline-offset: 1px; }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; flex: none; vertical-align: -3px; }

/* ---------------- шапка ---------------- */
.hdr { background: var(--hdr); height: 56px; position: sticky; top: 0; z-index: 50; }
.hdr .in { max-width: var(--wrap); margin: 0 auto; height: 100%; display: flex; align-items: center; padding: 0 16px; }
.logo { display: flex; white-space: nowrap; flex: none; align-items: center; font-size: 26px; letter-spacing: .5px; line-height: 1; user-select: none;
  color: var(--yellow); text-decoration: none !important; font-weight: 300; }
.logo b { background: #e5534b; color: #fff; padding: 2px 4px 1px; font-weight: 400; }
.logo i { font-style: normal; }
.hdr nav { margin-left: auto; display: flex; height: 100%; }
.hdr nav a, .hdr nav button { width: 64px; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #c9d1da; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; position: relative; }
.hdr nav a:hover, .hdr nav button:hover { color: #fff; text-decoration: none; background: #262f39; }
.hdr nav .on { border-bottom-color: var(--accent); color: #fff; }
.hdr nav svg.i { width: 18px; height: 18px; }
.badge { position: absolute; top: 12px; right: 16px; background: var(--red); color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; line-height: 16px; text-align: center; font-weight: 600; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: #e3b341; color: #2a2f36; font-weight: 700;
  font-size: 12px; display: flex; align-items: center; justify-content: center; text-transform: uppercase; }

.subnav { background: var(--nav); border-bottom: 1px solid #333d49; position: sticky; top: 56px; z-index: 40; }
.subnav .in { max-width: var(--wrap); margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  padding: 0 12px; justify-content: center; }
.subnav .in::-webkit-scrollbar { display: none; }
.subnav a { color: #c3ccd6; padding: 11px 9px 9px; font-size: 13px; white-space: nowrap;
  border-bottom: 2px solid transparent; }
.subnav a:hover { color: #fff; text-decoration: none; }
.subnav a.on { color: #fff; font-weight: 600; border-bottom-color: var(--accent); }

.page { max-width: var(--wrap); margin: 0 auto; padding: 24px 16px 40px; }
.foot { text-align: center; color: #75818e; font-size: 12px; padding: 18px 0 30px; }

/* ---------------- кнопки ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border: 0; border-radius: var(--r); background: var(--gray); color: #fff; cursor: pointer; font-size: 13.5px;
  white-space: nowrap; text-decoration: none !important; user-select: none; }
.btn:hover { background: var(--gray-hi); }
.btn:disabled, .btn.dis { opacity: .5; cursor: default; pointer-events: none; }
.btn.blue { background: var(--blue); } .btn.blue:hover { background: var(--blue-hi); }
.btn.red { background: var(--red); } .btn.red:hover { background: var(--red-hi); }
.btn.green { background: var(--green); } .btn.green:hover { background: #43b465; }
.btn.ghost { background: transparent; color: var(--text-2); } .btn.ghost:hover { background: var(--card-hi); color: var(--text); }
.btn.line { background: transparent; border: 1px solid var(--line); color: var(--text-2); }
.btn.line:hover { background: var(--card-hi); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 14px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn.up { text-transform: uppercase; letter-spacing: .3px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- карточки / формы ---------------- */
.card { background: var(--card); border-radius: var(--r); }
.card + .card { margin-top: 14px; }
.card-h { padding: 11px 16px; background: #2f3944; border-radius: var(--r) var(--r) 0 0; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .3px; color: #dfe5eb; display: flex; align-items: center; gap: 8px; min-height: 40px; }
.card-b { padding: 16px; }
.card-b.tight { padding: 0; }
.card-f { padding: 12px 16px; border-top: 1px solid var(--line-lo); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ro { background: #56626f; color: #dfe5eb; font-size: 10px; padding: 2px 7px; border-radius: 9px; letter-spacing: .3px; }
.page-h { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 20px; font-weight: 600; margin: 0; }
.page-h .sub { color: var(--muted); font-size: 13px; }
h2.sec { font-size: 18px; font-weight: 600; margin: 26px 0 12px; }

label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.inp, select.inp, textarea.inp { width: 100%; height: 36px; background: var(--input); border: 1px solid transparent;
  border-radius: var(--r); padding: 0 10px; color: var(--text); outline: none; font-size: 13.5px; }
textarea.inp { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.inp:focus { border-color: #6f8db3; background: var(--input-hi); }
.inp::placeholder { color: #8b97a4; }
select.inp { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23c3ccd6' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.inp.mono { font-family: var(--mono); font-size: 12.5px; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13.5px; }
.chk input { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; cursor: pointer; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #5a6674; border-radius: 10px; transition: background .15s; }
.switch i::after { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff;
  border-radius: 50%; transition: transform .15s; }
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(16px); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.vars { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.vars .card { margin: 0; }
.input-group { display: flex; }
.input-group .inp { border-radius: var(--r) 0 0 var(--r); }
.input-group .btn { border-radius: 0 var(--r) var(--r) 0; height: 36px; }
.input-group .suffix { background: #56626f; color: var(--text-2); padding: 0 10px; display: flex; align-items: center;
  border-radius: 0 var(--r) var(--r) 0; font-size: 12.5px; }

/* ---------------- метки статуса ---------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r);
  background: #56626f; font-size: 12px; color: #e7ebf0; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-running { background: #2c5a3e; color: #8fe0a8; }
.st-starting, .st-installing { background: #5b4a22; color: #f0cd7a; }
.st-stopping { background: #5b4a22; color: #f0cd7a; }
.st-offline { background: #56626f; color: #d5dce3; }
.st-crashed { background: #6a2c2c; color: #ff9d97; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 2px; background: #56626f; color: #dbe2e8; }
.tag.blue { background: #2b4a77; color: #b6d0ff; } .tag.green { background: #2c5a3e; color: #9fe5b4; }
.tag.red { background: #6a2c2c; color: #ffb0ab; } .tag.yellow { background: #5b4a22; color: #f0cd7a; }

/* ---------------- список приложений ---------------- */
.apps { display: flex; flex-direction: column; gap: 8px; }
.app-row { display: grid; grid-template-columns: 66px minmax(160px, 1.4fr) minmax(170px, 1.2fr) 150px 110px 6px; align-items: center;
  gap: 16px; background: var(--card); border-radius: var(--r); padding: 14px 6px 14px 16px; color: var(--text);
  min-height: 76px; cursor: pointer; }
.app-row:hover { background: var(--card-hi); text-decoration: none; }
.app-ico { width: 66px; height: 40px; border-radius: 20px; background: #59656f; display: flex; align-items: center; justify-content: center; color: #e8edf2; }
.app-ico svg.i { width: 19px; height: 19px; }
.app-name { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-desc { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-addr { color: #9aa6b2; font-size: 13.5px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-res { font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: 2px; }
.stripe { width: 5px; align-self: stretch; border-radius: 3px; background: var(--red); margin: -6px 0; }
.stripe.running { background: var(--green); } .stripe.starting, .stripe.installing, .stripe.stopping { background: var(--yellow); }
.stripe.offline { background: #b8434a; } .stripe.crashed { background: #e5534b; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); background: var(--card); border-radius: var(--r); }
.empty svg.i { width: 36px; height: 36px; margin-bottom: 10px; stroke-width: 1.5; }
.empty h3 { color: var(--text); font-weight: 600; margin: 0 0 6px; }

/* ---------------- выбор шаблона ---------------- */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.preset { background: var(--card-lo); border: 1px solid var(--line-lo); border-radius: var(--r); padding: 12px; cursor: pointer; }
.preset:hover { border-color: #6a7887; }
.preset.on { border-color: var(--blue); background: #34465c; }
.preset b { display: block; font-weight: 600; margin-bottom: 3px; }
.preset span { font-size: 12px; color: var(--muted); }

/* ---------------- консоль ---------------- */
.app-title { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.app-title h1 { margin: 0; font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-title .desc { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.tips { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 40px; margin-top: 8px; font-size: 12px; }
.tips a { color: #c4cdd6; text-decoration: underline; text-decoration-color: #6b7784; cursor: pointer; }
.tips a.hl { color: #6ee0a0; }
.con-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; align-items: start; }
.console { background: var(--console); border-radius: var(--r); display: flex; flex-direction: column; min-height: 560px; height: calc(100vh - 290px); max-height: 900px; }
.con-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid #262d35; font-size: 11px; overflow-x: auto; scrollbar-width: none; }
.con-tabs button { background: none; border: 0; color: #7c8794; padding: 4px 9px 6px; cursor: pointer; text-transform: uppercase;
  letter-spacing: .3px; border-bottom: 2px solid transparent; white-space: nowrap; }
.con-tabs button.on { color: #e7ebf0; border-bottom-color: #5b6673; }
.con-tabs button .n { color: #5d6875; margin-left: 3px; }
.con-tabs .sp { flex: 1; }
.con-out { flex: 1; overflow-y: auto; padding: 10px 12px; font: 12.5px/1.55 var(--mono); color: #d7dde4;
  white-space: pre-wrap; word-break: break-word; overscroll-behavior: contain; }
.con-out .ln.sys { color: #c8d0d8; }
.con-out .ln.old { opacity: .55; }
.con-out .ln.cmd { color: #8d98a5; }
.con-out .ln.k-error { color: #ff9d97; }
.con-out .ln.k-warn { color: #f0cd7a; }
.tips-toggle { display: none; }
.con-out .ts { color: #59636e; margin-right: 8px; user-select: none; }
.con-in { display: flex; align-items: center; border-top: 1px solid #262d35; padding: 0 10px; height: 40px; gap: 8px; }
.con-in span { color: #5d6875; font-family: var(--mono); }
.con-in input { flex: 1; background: none; border: 0; outline: none; font: 12.5px var(--mono); color: #e7ebf0; height: 100%; min-width: 0; }
.con-in input::placeholder { color: #5d6875; }
.con-follow { position: absolute; right: 18px; bottom: 54px; }
.con-wrap { position: relative; }

.side { display: flex; flex-direction: column; gap: 10px; }
.tile { background: #4f5b68; border-radius: var(--r); padding: 12px; display: flex; gap: 12px; align-items: center; min-height: 52px; }
.tile .ic { width: 30px; height: 30px; border-radius: var(--r); background: #444f5b; display: flex; align-items: center; justify-content: center; flex: none; color: #dfe5eb; }
.tile .ic.red { background: var(--red); color: #fff; } .tile .ic.green { background: var(--green); color: #fff; }
.tile .ic.yellow { background: #a67c22; color: #fff; }
.tile .k { font-size: 11.5px; color: #cdd5dd; line-height: 1.3; }
.tile .v { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.35; word-break: break-word; }
.tile .v .muted { font-weight: 400; font-size: 11.5px; }
.tile .v.off { color: #98a3ae; font-weight: 400; }
.tile.addr { display: block; }
.tile.addr .box { background: #444f5b; border-radius: var(--r); padding: 8px 10px; margin-top: 8px; font: 11.5px var(--mono); }
.tile.addr .box div { display: flex; gap: 10px; align-items: center; padding: 2px 0; cursor: pointer; }
.tile.addr .box div:hover b { text-decoration: underline; }
.tile.addr .box em { font-style: normal; color: #9ba6b1; width: 30px; font-size: 9.5px; text-transform: uppercase; }
.meter { height: 3px; background: #444f5b; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; background: #8fb8f5; }
.meter i.warn { background: var(--yellow); } .meter i.crit { background: #e5534b; }

.power { background: #4f5b68; border-radius: var(--r); padding: 10px; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.power .btn { height: 40px; min-width: 120px; }
.charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.chart { background: var(--card); border-radius: var(--r); padding: 10px 12px 8px; position: relative; }
.chart .ch { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; margin-bottom: 4px; }
.chart .ch b { font-weight: 600; }
.chart .ch .val { margin-left: auto; color: var(--text-2); font-family: var(--mono); font-size: 11.5px; }
.chart canvas { width: 100%; height: 110px; display: block; }
.chart .legend { display: flex; gap: 12px; font-size: 11px; color: var(--text-2); }
.chart .legend i { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 5px; }
.chart .tip { position: absolute; pointer-events: none; background: #222a33; border: 1px solid #56626f; border-radius: var(--r);
  padding: 5px 8px; font-size: 11.5px; white-space: nowrap; z-index: 2; color: var(--text); }

/* ---------------- файлы ---------------- */
.fbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); min-width: 0; }
.crumbs a { color: var(--text-2); cursor: pointer; }
.crumbs a:last-child { color: var(--text); }
.crumbs .sep { color: #6c7885; }
.ftable { background: var(--card); border-radius: var(--r); }
.frow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 110px 150px 44px; align-items: center; min-height: 44px;
  border-bottom: 1px solid var(--line-lo); padding: 0 6px 0 10px; gap: 6px; }
.frow:last-child { border-bottom: 0; }
.frow.head { min-height: 38px; font-size: 11.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .3px; background: #37424e; border-radius: var(--r) var(--r) 0 0; }
.frow.item:hover { background: var(--card-hi); }
.frow.item.sel { background: #3b4f66; }
.frow .nm { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.frow .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .nm svg.i { color: #9aa6b2; }
.frow .nm svg.i.dir { color: #e3b341; }
.frow.dot .nm span { color: #a4afba; }
.frow .sz, .frow .mt { font-size: 12.5px; color: var(--text-2); text-align: right; }
.frow .mt { padding-right: 6px; }
.frow .more { justify-self: end; }
.frow.drop { outline: 2px dashed #6f8db3; outline-offset: -2px; }
.selbar { display: flex; gap: 8px; align-items: center; background: #34465c; border-radius: var(--r); padding: 8px 12px; margin-bottom: 10px; flex-wrap: wrap; }
.dropzone { position: fixed; inset: 0; background: rgba(33, 41, 50, .85); z-index: 200; display: flex; align-items: center;
  justify-content: center; font-size: 20px; border: 3px dashed #6f8db3; pointer-events: none; }
.upl { position: fixed; right: 16px; bottom: 16px; width: 320px; background: #222a33; border-radius: var(--r); z-index: 150; padding: 12px; border: 1px solid #3d4855; }
.upl .meter { height: 5px; }
.disk-meter { min-width: 160px; font-size: 12px; color: var(--text-2); }

/* редактор */
.editor-card { background: var(--card); border-radius: var(--r); overflow: hidden; }
.editor-top { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: #37424e; flex-wrap: wrap; }
.editor-top .fn { font-family: var(--mono); font-size: 13px; }
.editor-top .dirty { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.editor-card .CodeMirror { height: calc(100vh - 250px); min-height: 380px; background: var(--editor); color: #dfe5eb; font: 13px/1.6 var(--mono); }
.editor-card .CodeMirror-gutters { background: #303b47; border-right: 1px solid #3c4855; }
.editor-card .CodeMirror-linenumber { color: #6f7c8a; }
.editor-card .CodeMirror-cursor { border-left: 2px solid #e7ebf0; }
.editor-card .CodeMirror-selected, .editor-card .CodeMirror-focused .CodeMirror-selected { background: #3f5774 !important; }
.editor-card .CodeMirror-activeline-background { background: #333f4c; }
.editor-card .CodeMirror-matchingbracket { color: #fff !important; background: #4b5d72; }
.editor-card .CodeMirror-dialog { background: #37424e; color: var(--text); border-bottom: 1px solid #4b5866; }
.editor-card .CodeMirror-dialog input { color: var(--text); font-family: var(--mono); }
.cm-s-pyhost .cm-keyword { color: #f48fb1; } .cm-s-pyhost .cm-def { color: #82b1ff; }
.cm-s-pyhost .cm-string, .cm-s-pyhost .cm-string-2 { color: #a5d6a7; } .cm-s-pyhost .cm-comment { color: #7f8c99; font-style: italic; }
.cm-s-pyhost .cm-number { color: #ffcc80; } .cm-s-pyhost .cm-builtin { color: #80deea; }
.cm-s-pyhost .cm-variable-2 { color: #dfe5eb; } .cm-s-pyhost .cm-meta { color: #ffd54f; }
.cm-s-pyhost .cm-atom { color: #ffab91; } .cm-s-pyhost .cm-operator { color: #b0bec5; }
.cm-s-pyhost .cm-property { color: #b39ddb; } .cm-s-pyhost .cm-tag { color: #f48fb1; } .cm-s-pyhost .cm-attribute { color: #82b1ff; }
.cm-s-pyhost .cm-header { color: #82b1ff; font-weight: 600; } .cm-s-pyhost .cm-variable-3, .cm-s-pyhost .cm-type { color: #80deea; }

/* ---------------- таблицы ---------------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600;
  padding: 10px 12px; background: #37424e; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line-lo); vertical-align: middle; font-size: 13.5px; }
.tbl tr:hover td { background: #424e5c; }
.tbl .act { text-align: right; white-space: nowrap; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-lo); flex-wrap: wrap; }
.list-item:first-child { border-top: 0; }
.list-item .ttl { font-weight: 600; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.cmdline { background: #2b3540; border-radius: var(--r); padding: 12px 14px; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; color: #e3e8ee; }
.copybox { display: flex; align-items: center; gap: 8px; background: #343f4b; border-radius: var(--r); padding: 6px 6px 6px 12px; font: 12.5px var(--mono); }
.copybox span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note { background: #34465c; border-left: 3px solid #5b8fd8; padding: 10px 14px; border-radius: var(--r); font-size: 13px; color: #d5e2f3; margin-bottom: 14px; }
.note.warn { background: #4c4229; border-color: var(--yellow); color: #f2e2b9; }
.note.err { background: #4f3134; border-color: #e5534b; color: #f7c9c6; }
.livelog { background: var(--console); border-radius: var(--r); font: 12px/1.5 var(--mono); padding: 10px 12px; max-height: 260px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; color: #d7dde4; }

/* ---------------- модальные окна / меню / уведомления ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 25, 31, .66); z-index: 300; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal { background: var(--card); border-radius: 4px; width: 100%; max-width: 480px; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.modal.wide { max-width: 720px; }
.modal-h { padding: 14px 18px; font-weight: 600; font-size: 15px; display: flex; align-items: center; border-bottom: 1px solid var(--line-lo); }
.modal-b { padding: 18px; }
.modal-f { padding: 12px 18px 16px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.menu { position: fixed; z-index: 320; background: #2a333d; border: 1px solid #45515e; border-radius: var(--r); min-width: 190px; padding: 4px 0; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 14px; cursor: pointer; text-align: left; color: var(--text); font-size: 13.5px; }
.menu button:hover { background: #38434f; }
.menu button.red { color: #ff8e88; }
.menu hr { margin: 4px 0; border-color: #3d4855; }
.menu .mh { padding: 6px 14px 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.drop-panel { position: fixed; top: 56px; z-index: 310; background: #2a333d; border: 1px solid #45515e; border-radius: 0 0 var(--r) var(--r); width: 360px; max-height: 70vh; overflow-y: auto; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.notif { padding: 10px 14px; border-bottom: 1px solid #38434f; font-size: 13px; cursor: pointer; }
.notif:hover { background: #333d48; }
.notif.unread { border-left: 3px solid var(--blue); }
.notif .when { font-size: 11px; color: var(--muted); }
.toasts { position: fixed; top: 66px; right: 16px; z-index: 400; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast { background: #222a33; border-left: 3px solid var(--blue); border-radius: var(--r); padding: 10px 14px; font-size: 13.5px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.toast.err { border-color: #e5534b; } .toast.ok { border-color: var(--green); } .toast.warn { border-color: var(--yellow); }
.search-box { max-width: 560px; }
.search-res a { display: flex; gap: 10px; padding: 10px 14px; color: var(--text); border-top: 1px solid var(--line-lo); align-items: center; }
.search-res a:hover, .search-res a.on { background: var(--card-hi); text-decoration: none; }

/* вход */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; flex-direction: column; gap: 22px; }
.auth-card { background: var(--card); border-radius: 4px; width: 100%; max-width: 380px; padding: 26px 24px 20px; }
.auth-card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.auth-card p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }

/* терминал */
.term-card { background: var(--console); border-radius: var(--r); padding: 8px; height: calc(100vh - 230px); min-height: 380px; }
.term-keys { display: none; gap: 6px; padding: 8px 0 0; overflow-x: auto; }
.term-keys button { background: #3e4a58; border: 0; color: var(--text); border-radius: var(--r); padding: 0 12px; height: 34px; font: 12px var(--mono); flex: none; }

.qr svg { width: 180px; height: 180px; background: #fff; border-radius: var(--r); display: block; }
.stat-big { font-size: 22px; font-weight: 600; }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card { background: var(--card); border-radius: var(--r); padding: 14px 16px; }
.stat-card .k { font-size: 12px; color: var(--muted); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.spin { width: 16px; height: 16px; border: 2px solid #6b7785; border-top-color: #e7ebf0; border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes sp { to { transform: rotate(360deg); } }
.mobile-only { display: none; }

/* ================= телефон / планшет ================= */
@media (max-width: 1100px) {
  .app-row { grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr) 110px 6px; }
  .app-row .app-res { display: none; }
  .app-ico { width: 56px; }
  .charts { grid-template-columns: 1fr 1fr; }
  .charts .chart:last-child { grid-column: span 2; }
}
@media (max-width: 860px) {
  .con-grid { grid-template-columns: minmax(0, 1fr); }
  .con-wrap { min-width: 0; }
  .side { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .side .tile.addr, .side .tile.wide { grid-column: span 2; }
  .console { height: 58vh; min-height: 340px; }
  .vars, .grid2, .grid3 { grid-template-columns: 1fr; }
  .stats4 { grid-template-columns: 1fr 1fr; }
  .tips { grid-template-columns: 1fr; }
  .subnav .in { justify-content: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .hdr { height: 52px; }
  .hdr .in { padding: 0 6px 0 12px; }
  .logo { font-size: 20px; }
  .hdr nav a, .hdr nav button { width: 44px; }
  .hdr nav .nav-apps { display: none; }
  .tips { display: none; margin-bottom: 4px; }
  .tips.open { display: grid; }
  .tips-toggle { display: inline-flex; margin-top: 6px; }
  .badge { right: 6px; top: 10px; }
  .subnav { top: 52px; }
  .subnav a { padding: 12px 10px 10px; font-size: 13.5px; }
  .drop-panel { top: 52px; left: 0 !important; right: 0; width: auto; border-radius: 0; }
  .page { padding: 14px 10px 90px; }
  .page-h h1 { font-size: 18px; }
  .page-h .btn { flex: 1; }
  .app-row { grid-template-columns: 44px minmax(0, 1fr) 5px; gap: 12px; padding: 12px 6px 12px 12px; min-height: 68px; }
  .app-row .app-addr, .app-row .app-st { display: none; }
  .app-row .mobile-only { display: flex; }
  .app-ico { width: 44px; height: 44px; border-radius: 22px; }
  .app-name { font-size: 16px; }
  .app-title h1 { font-size: 17px; }
  .app-title .top-power { display: none; }
  .power { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 60; border-radius: 0; padding: 8px 8px calc(8px + var(--sb));
    background: #2a333d; border-top: 1px solid #3d4855; flex-wrap: nowrap; }
  .power .btn { min-width: 0; flex: 1; padding: 0 6px; font-size: 12.5px; height: 42px; }
  .power .btn .lbl-long { display: none; }
  .power .btn svg.i { display: none; }
  .power .btn[data-p=kill] svg.i { display: inline; }
  .power .extra { display: none; }
  .charts { grid-template-columns: 1fr; }
  .charts .chart:last-child { grid-column: auto; }
  .con-in { height: 46px; }
  .con-in input { font-size: 16px; } /* без автозума iOS */
  .con-out { font-size: 11.5px; padding: 8px; }
  .con-out .ts { display: none; }
  .inp, select.inp, textarea.inp { font-size: 16px; height: 42px; }
  textarea.inp { height: auto; }
  .btn { height: 38px; }
  .btn.sm { height: 32px; }
  .fbar .btns .btn .lbl { display: none; }
  .fbar .btns .btn { width: 40px; padding: 0; }
  .fbar { gap: 8px; }
  .frow { grid-template-columns: 30px minmax(0, 1fr) 40px; min-height: 54px; padding: 0 4px 0 8px; }
  .frow .sz, .frow .mt { display: none; }
  .frow .nm { flex-wrap: wrap; row-gap: 0; }
  .frow .nm .meta { display: block !important; width: 100%; padding-left: 26px; font-size: 11.5px; color: var(--muted); margin-top: -2px; }
  .frow.head .hsz, .frow.head .hmt { display: none; }
  .editor-card .CodeMirror { height: calc(100vh - 190px); font-size: 12.5px; }
  .editor-top .btn .lbl { display: none; }
  .tbl.resp thead { display: none; }
  .tbl.resp, .tbl.resp tbody, .tbl.resp tr, .tbl.resp td { display: block; width: 100%; }
  .tbl.resp tr { border-top: 1px solid var(--line-lo); padding: 8px 4px; }
  .tbl.resp td { border: 0; padding: 3px 10px; }
  .tbl.resp td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
  .tbl.resp .act { text-align: left; padding-top: 8px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv > div:nth-child(even) { margin-bottom: 8px; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { max-width: none; border-radius: 10px 10px 0 0; max-height: 92vh; overflow-y: auto; padding-bottom: var(--sb); }
  .menu.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; border-radius: 10px 10px 0 0; padding: 8px 0 calc(8px + var(--sb)); }
  .menu.sheet button { padding: 13px 18px; font-size: 15px; }
  .toasts { left: 10px; right: 10px; top: auto; bottom: 74px; max-width: none; }
  .term-card { height: calc(100vh - 250px); padding: 4px; }
  .term-keys { display: flex; }
  .stats4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .upl { left: 10px; right: 10px; width: auto; bottom: 10px; }
  .card-b { padding: 14px 12px; }
  .selbar { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 60; border-radius: 0; padding: 10px 10px calc(10px + var(--sb)); }
}
