/* macOS-стиль: SF Pro на Apple, Inter на Windows/Android (ближайший аналог SF). */
:root{
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Inter","Segoe UI Variable Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --bg:#f2f2f7; --card:#ffffff; --text:#1d1d1f; --text2:#3a3a3c; --muted:#8e8e93; --line:#e5e5ea; --line2:#d1d1d6;
  --accent:#007aff; --accent-press:#0062cc; --accent-soft:rgba(0,122,255,.12);
  --sel:#7cb8ff; --ok:#248a3d; --ok-bg:#e3f5e8; --ok-line:#bfe6ca; --ok-dot:#34c759;
  --off:#8e8e93; --off-bg:#f2f2f7; --off-line:#e5e5ea;
  --err:#d70015; --btn2:#e5e5ea; --btn2-hover:#dcdce1; --field:#ffffff; --seg:#eeeef2;
  --shadow-card:0 1px 2px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.05);
  --shadow-seg:0 1px 3px rgba(0,0,0,.12),0 0 0 .5px rgba(0,0,0,.04);
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#1c1c1e; --card:#2c2c2e; --text:#f5f5f7; --text2:#d1d1d6; --muted:#98989d; --line:#3a3a3c; --line2:#48484a;
  --accent:#0a84ff; --accent-press:#409cff; --accent-soft:rgba(10,132,255,.2);
  --sel:#64a8ff; --ok:#30d158; --ok-bg:rgba(48,209,88,.14); --ok-line:rgba(48,209,88,.3); --ok-dot:#30d158;
  --off:#98989d; --off-bg:#3a3a3c; --off-line:#48484a;
  --err:#ff453a; --btn2:#3a3a3c; --btn2-hover:#48484a; --field:#1c1c1e; --seg:#1c1c1e;
  --shadow-card:0 0 0 .5px rgba(255,255,255,.06); --shadow-seg:0 1px 3px rgba(0,0,0,.5);
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--text);font:15px/1.4 var(--font);letter-spacing:-.01em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}
.wrap{max-width:720px;margin:0 auto;padding:28px 16px 40px}
header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 4px 18px}
h1{font-size:32px;line-height:1.1;font-weight:700;letter-spacing:-.025em;margin:0}
.subtitle{font-size:15px;color:var(--muted);margin-top:6px}
.hdr-right{display:flex;align-items:center;gap:8px;flex-shrink:0;margin-top:4px}
.badge{font-size:13px;font-weight:600;color:var(--accent);background:var(--accent-soft);border-radius:999px;padding:4px 11px}
.theme{width:30px;height:30px;padding:0;border-radius:50%;background:transparent;color:var(--muted)}
.theme:hover:not(:disabled){background:var(--btn2)}
.card{background:var(--card);border-radius:20px;padding:20px;box-shadow:var(--shadow-card);margin-bottom:14px}
label{display:block;font-size:13px;font-weight:500;color:var(--muted);margin:0 0 6px 2px}
input,select{width:100%;height:44px;padding:0 14px;border:1px solid var(--line2);border-radius:12px;background:var(--field);color:var(--text);font:inherit;outline:none;transition:border-color .15s,box-shadow .15s}
input::placeholder{color:var(--muted);opacity:.8}
input:focus,select:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.row{display:flex;gap:10px;align-items:center}
.row>*{min-width:0}
.grow{flex:1}
.field{margin-bottom:14px}
button{height:44px;padding:0 18px;border-radius:12px;border:none;background:var(--btn2);color:var(--text);font:inherit;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap;transition:background .15s,transform .05s}
button:hover:not(:disabled){background:var(--btn2-hover)}
button:active:not(:disabled){transform:scale(.985)}
button:disabled{opacity:.4;cursor:default}
button.primary{background:var(--accent);color:#fff;font-weight:600}
button.primary:hover:not(:disabled){background:var(--accent-press)}
button.link{background:none;color:var(--accent);height:auto;padding:0;font-weight:500}
button.link:hover:not(:disabled){background:none;text-decoration:underline}
.hidden{display:none!important}
.status{font-size:14px;color:var(--muted);margin-top:10px}
.status:empty{display:none}
.status.err{color:var(--err)}
.busy{position:relative;height:3px;border-radius:2px;background:var(--accent-soft);overflow:hidden;margin-top:12px}
.busy::after{content:"";position:absolute;top:0;left:-40%;width:40%;height:100%;border-radius:2px;background:var(--accent);animation:slide 1.1s ease-in-out infinite}
@keyframes slide{to{left:100%}}
.meta{font-size:13px;color:var(--muted);margin:0 2px}
.meta b{color:var(--text2);font-weight:600}
.search{margin-top:16px}
.search input{padding-left:40px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='%238e8e93' stroke-width='2.2'/%3E%3Cpath d='M15.5 15.5L21 21' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:14px center}
.seg{display:flex;background:var(--seg);border-radius:12px;padding:3px;gap:3px;margin:14px 0}
.seg button{flex:1;height:36px;border-radius:9px;background:none;font-size:15px;color:var(--muted);font-weight:500}
.seg button:hover:not(:disabled){background:none;color:var(--text2)}
.seg button.on{background:var(--card);color:var(--accent);font-weight:600;box-shadow:var(--shadow-seg)}
.list{display:flex;flex-direction:column;gap:10px;max-height:min(60vh,640px);overflow:auto;padding:2px;scrollbar-width:none}
.list::-webkit-scrollbar{display:none}
.obj{position:relative;border:1px solid var(--line);border-radius:16px;padding:14px 16px;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;background:var(--card);transition:border-color .12s}
.obj:hover{border-color:var(--line2)}
.obj.sel,.obj.sel:hover{border:2px solid var(--sel);padding:13px 15px}
.obj .top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:4px}
.obj .name{font-size:16px;font-weight:600;letter-spacing:-.015em;line-height:1.3;overflow-wrap:anywhere}
.pill{display:inline-flex;align-items:center;gap:6px;flex-shrink:0;font-size:13px;font-weight:600;padding:3px 10px;border-radius:999px;border:1px solid;white-space:nowrap}
.pill::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.pill.on{color:var(--ok);background:var(--ok-bg);border-color:var(--ok-line)}
.pill.on::before{background:var(--ok-dot)}
.pill.off{color:var(--off);background:var(--off-bg);border-color:var(--off-line)}
.obj .grp{font-size:14px;color:var(--muted)}
.obj .ln{font-size:14px;color:var(--text2);overflow-wrap:anywhere}
.obj .st{font-size:13px;color:var(--muted);margin-top:2px}
.empty{color:var(--muted);font-size:14px;padding:14px 4px;text-align:center}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.actions .primary{flex:1 1 100%;height:48px;font-size:16px}
.logs-card{padding:4px 8px}
.logs-toggle{width:100%;justify-content:space-between;height:44px;padding:0 10px;background:none;font-size:15px;color:var(--text2);font-weight:500}
.logs-toggle:hover:not(:disabled){background:none}
.logs-arrow{font-size:22px;line-height:1;color:var(--muted);transition:transform .15s}
pre.logs{margin:4px 4px 0;max-height:280px;overflow:auto;font:12px/1.5 ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;background:var(--bg);border-radius:12px;padding:12px;white-space:pre-wrap;word-break:break-word}
.logs-actions{display:flex;justify-content:flex-end;gap:18px;padding:10px 8px 10px}
.hint{font-size:13px;color:var(--muted);margin:0 0 10px 2px}
svg.ic{width:17px;height:17px;fill:currentColor}
@media (max-width:520px){
  .wrap{padding:22px 12px 32px}
  h1{font-size:30px}
  .card{padding:16px;border-radius:18px}
    }
