:root{--bg:#0b0d12;--card:#141821;--card-hover:#1a2030;--text:#e8ecf5;
        --muted:#7d879c;--accent:#8b5cf6;--accent-2:#22d3ee;--live:#ef4444;--ok:#22c55e}
  *{box-sizing:border-box;margin:0;padding:0}

  /* Фикс для мобильных устройств */
  html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
  }
  body{
    background:var(--bg);color:var(--text);
    font-family:'Inter','Segoe UI',system-ui,sans-serif;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    display:flex;flex-direction:column;
  }

  header{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;
         background:rgba(11,13,18,.8);border-bottom:1px solid rgba(255,255,255,.06);
         flex-shrink: 0;}
  h1{font-size:18px;font-weight:600;display:flex;align-items:center;gap:10px}
  .btn-back{text-decoration:none;color:var(--muted);font-size:20px;transition:color .15s}
  .btn-back:hover{color:var(--text)}
  .header-left{display:flex;align-items:center;gap:16px}
  .header-actions{display:flex;gap:10px}
  #streamer{display:none}

  .controls{display:flex;flex-wrap:wrap;gap:10px;padding:12px 24px;
            background:var(--card);border-bottom:1px solid rgba(255,255,255,.05);
            align-items:center; flex-shrink: 0;}
  .controls select, .controls input {
    background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.1);
    color:#fff; padding:8px 12px; border-radius:8px; font-size:13px; outline:none;
  }
  .controls select:focus, .controls input:focus { border-color: var(--accent); }
  .controls .input-query { flex: 1; min-width: 150px; }

  .btn { background:transparent; border:1px solid rgba(255,255,255,0.2); color:#fff;
         padding:8px 14px; border-radius:8px; cursor:pointer; font-size:13px;
         transition:all 0.15s; display:inline-flex; align-items:center; gap:6px; }
  .btn:hover { background:rgba(255,255,255,0.1); }
  .btn-primary { background:var(--accent); border-color:var(--accent); font-weight:600; }
  .btn-primary:hover { background:#7c3aed; }
  .btn-live.on { background:var(--live); border-color:var(--live); animation:pulse 2s infinite; }
  @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.7} }

  .log-container {
    flex: 1; /* Занимает всё оставшееся место */
    overflow-y: auto;
    background: #000; padding: 16px;
    font-family: 'Consolas', 'Courier New', monospace; font-size: 13px;
    line-height: 1.5;
    min-height: 0; /* Важно для работы flex-скролла */
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
  }
  .log-line { white-space: pre-wrap; word-break: break-all; border-bottom: 1px solid rgba(255,255,255,0.02); padding: 2px 0;}
  .log-line:hover { background: rgba(255,255,255,0.05); }

  .t-time { color: #6b7280; }
  .lvl-INFO { color: #38bdf8; }
  .lvl-WARNING { color: #fbbf24; }
  .lvl-ERROR, .lvl-CRITICAL { color: #ef4444; font-weight: 600; background: rgba(239,68,68,0.1); }

  .empty { color: var(--muted); text-align: center; margin-top: 50px; }
  .empty.error { color: var(--live); }

  .modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 100; align-items: center; justify-content: center; }
  .modal.show { display: flex; }
  .modal-content { background: var(--card); padding: 32px; border-radius: 20px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; border: 1px solid rgba(255,255,255,.1); box-shadow: 0 24px 64px rgba(0,0,0,.8); }
  .modal-content h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
  .modal-content input { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 12px; border-radius: 10px; font-size: 14px; outline: none; }
  .modal-content input:focus { border-color: var(--accent); }
  .modal-content .btn-row { display: flex; gap: 10px; margin-top: 8px; }
  .modal-content button { flex: 1; padding: 12px; border-radius: 10px; border: none; cursor: pointer; font-weight: 600; }
  .modal-content .btn-save { background: var(--accent); color: #fff; }
  .modal-content .btn-cancel { background: rgba(255,255,255,0.1); color: #fff; }
