/* ==================================================================
   AMNESIA PANEL — Premium Black & Red Theme with Modern Typography
   ================================================================== */

:root, [data-theme="dark"] {
  --bg:      #040404;
  --bg1:     #0a0a0c;
  --bg2:     #121216;
  --bg3:     #1a1a20;
  --bg4:     #24242d;

  --fg:        #9ca3af;
  --fg-bright: #f3f4f6;
  --dim:       #6b7280;
  --dim2:      #4b5563;

  --acc:      #e11d48;
  --acc-hi:   #fb7185;
  --acc2:     #be123c;
  --acc-glow: rgba(225, 29, 72, 0.25);

  --red:      #be123c;
  --red-hi:   #e11d48;
  --red-glow: rgba(225, 29, 72, 0.3);

  --ok:       #10b981;
  --ok-hi:    #34d399;
  --ok-glow:  rgba(16, 185, 129, 0.2);

  --warn:     #f59e0b;

  --border:    rgba(255, 255, 255, 0.06);
  --border2:   rgba(255, 255, 255, 0.12);
  --border-hi: rgba(255, 255, 255, 0.25);

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.6);
  --shadow:    0 12px 32px rgba(0,0,0,0.7);
  --shadow-lg: 0 32px 80px rgba(0,0,0,0.9);

  --radius:    8px;
  --radius-lg: 16px;

  --login-bg: radial-gradient(circle at 50% 50%, rgba(225, 29, 72, 0.08), transparent 60%), #040404;
  --main-bg:  #040404;
}

[data-theme="light"] {
  --bg:      #e8eaef;
  --bg1:     #f4f5f8;
  --bg2:     #ffffff;
  --bg3:     #eef0f4;
  --bg4:     #e2e6ec;

  --fg:        #475569;
  --fg-bright: #1e293b;
  --dim:       #64748b;
  --dim2:      #94a3b8;

  --acc:      #e11d48;
  --acc-hi:   #be123c;
  --acc-glow: rgba(225, 29, 72, 0.15);

  --red:      #be123c;
  --red-hi:   #e11d48;
  --red-glow: rgba(225, 29, 72, 0.15);

  --ok:       #059669;
  --ok-hi:    #10b981;
  --ok-glow:  rgba(16, 185, 129, 0.15);

  --border:    rgba(0, 0, 0, 0.08);
  --border2:   rgba(0, 0, 0, 0.15);
  --border-hi: rgba(0, 0, 0, 0.3);

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow:    0 12px 32px rgba(0,0,0,0.1);
  --shadow-lg: 0 32px 80px rgba(0,0,0,0.15);

  --login-bg: radial-gradient(circle at 50% 50%, rgba(225, 29, 72, 0.05), transparent 60%), #e8eaef;
  --main-bg:  #e8eaef;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 14px/1.6 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  color: var(--fg);
  background: var(--main-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Анімований фоновий градієнт */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 15% 50%, rgba(225, 29, 72, 0.06), transparent 40%),
              radial-gradient(circle at 85% 30%, rgba(225, 29, 72, 0.04), transparent 40%);
  animation: bgPulse 10s ease-in-out infinite alternate;
  pointer-events: none;
  will-change: transform, opacity;
}
[data-theme="light"] body::before {
  background: radial-gradient(circle at 15% 50%, rgba(225, 29, 72, 0.04), transparent 40%),
              radial-gradient(circle at 85% 30%, rgba(225, 29, 72, 0.03), transparent 40%);
}

@keyframes bgPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; }
}

/* Шум (Noise) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }
b, strong { color: var(--fg-bright); font-weight: 600; }
::selection { background: var(--acc-glow); color: var(--fg-bright); }

.ph { font-size: 16px; line-height: 1; display: inline-block; vertical-align: middle; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

.term-out::-webkit-scrollbar-thumb { background: var(--acc); border-radius: 3px; }

/* ================================================================
   BACKGROUND LOGO (Повернуто Urbanist)
   ================================================================ */
.amn-bg, .amn-bg-app {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: baseline;
  font: 900 clamp(140px, 25vw, 380px)/1 'Urbanist', 'Arial Rounded MT Bold', sans-serif;
  letter-spacing: -.05em;
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  filter: drop-shadow(0 0 100px rgba(225, 29, 72, 0.4));
  will-change: opacity;
}
[data-theme="light"] .amn-bg, [data-theme="light"] .amn-bg-app { opacity: 0.15; filter: drop-shadow(0 0 80px rgba(225, 29, 72, 0.2)); }

.amn-bg-app { opacity: 0.35; }
[data-theme="light"] .amn-bg-app { opacity: 0.15; }

.amn-bg i, .amn-bg-app i {
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--c);
}
.amn-bg i::before, .amn-bg i::after, .amn-bg-app i::before, .amn-bg-app i::after {
  content: attr(data-l);
  display: block;
}
.amn-bg i::before, .amn-bg-app i::before {
  clip-path: inset(0 0 .44em 0);
  transform: translateX(var(--d));
}
.amn-bg i::after, .amn-bg-app i::after {
  position: absolute;
  left: 0; top: 0;
  clip-path: inset(var(--g) 0 0 0);
}
.amn-bg svg, .amn-bg-app svg {
  position: absolute;
  left: .12em; top: -.13em;
  width: .33em; height: .33em;
  overflow: visible;
}

/* Скануючий ефект */
.amn-bg::after, .amn-bg-app::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(225,29,72,0.15) 50%, transparent 100%);
  animation: scan 6s linear infinite;
  mix-blend-mode: overlay;
  pointer-events: none;
  will-change: transform;
}
@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ================================================================
   HEADER LOGO (Повернуто Urbanist)
   ================================================================ */
.logo-amnesia {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  font: 900 22px/1 'Urbanist', 'Arial Rounded MT Bold', sans-serif;
  letter-spacing: -.04em;
  margin-right: 12px;
  transition: transform 0.3s ease;
}
.logo-amnesia:hover { transform: scale(1.05); }
.logo-amnesia i { position: relative; display: inline-block; font-style: normal; color: var(--c); }
.logo-amnesia i::before, .logo-amnesia i::after { content: attr(data-l); display: block; }
.logo-amnesia i::before { clip-path: inset(0 0 .44em 0); transform: translateX(var(--d)); }
.logo-amnesia i::after { position: absolute; left: 0; top: 0; clip-path: inset(var(--g) 0 0 0); }
.logo-amnesia svg { position: absolute; left: .12em; top: -.13em; width: .33em; height: .33em; overflow: visible; }

/* ================================================================
   TYPOGRAPHY OVERRIDES
   ================================================================ */
h1, h2, h3, .tab-btn, button {
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
}

.login-box h1 {
  font-family: 'Urbanist', sans-serif;
  font-weight: 900;
}

/* ================================================================
   LOGIN
   ================================================================ */
.login-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  overflow: hidden;
  background: var(--login-bg);
}

.login-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 52px 44px;
  text-align: center;
  border-radius: 24px;
  border: 1px solid var(--border2);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03) inset;
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  background: rgba(18, 18, 22, 0.7);
}
[data-theme="light"] .login-box { background: rgba(255, 255, 255, 0.85); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.05) inset; }

.login-header { margin-bottom: 40px; }

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
  border: 1px solid var(--border2);
  color: var(--acc-hi);
  box-shadow: 0 16px 40px var(--acc-glow), inset 0 0 20px rgba(255,255,255,0.05);
  transition: all 0.4s ease;
}
.login-box:hover .login-logo { transform: translateY(-4px) scale(1.05); box-shadow: 0 24px 60px var(--acc-glow), inset 0 0 20px rgba(255,255,255,0.1); }
.login-logo .ph { font-size: 42px; }

.login-box h1 {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--fg-bright);
  text-transform: uppercase;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.login-sub { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--dim); font-family: 'Space Grotesk', sans-serif; }

.login-form { display: flex; flex-direction: column; gap: 20px; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group .ph { position: absolute; left: 20px; font-size: 18px; color: var(--dim); pointer-events: none; transition: color 0.3s; }
.input-group:focus-within .ph { color: var(--acc-hi); }

.input-group input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  font-size: 15px;
  background: var(--bg1);
  color: var(--fg-bright);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus { border-color: var(--acc); background: var(--bg2); box-shadow: 0 0 0 4px var(--acc-glow), inset 0 2px 6px rgba(0,0,0,0.1); }

.err { color: var(--red-hi); min-height: 20px; font-size: 13px; font-weight: 500; text-align: left; }

.login-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border2); }

/* ================================================================
   LANG SWITCH
   ================================================================ */
.lang-switch { display: inline-flex; border: 1px solid var(--border2); border-radius: 8px; overflow: hidden; background: var(--bg1); }
.lang-btn { border: none; border-radius: 0; padding: 6px 16px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; background: transparent; color: var(--dim); box-shadow: none; transition: all 0.2s; font-family: 'Space Grotesk', sans-serif; }
.lang-btn:hover { color: var(--fg-bright); background: var(--bg3); transform: none; box-shadow: none; }
.lang-btn.active { background: var(--acc); color: #fff; }

/* ================================================================
   HEADER / NAV
   ================================================================ */
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: var(--bg1);
  border-bottom: 1px solid var(--border2);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background-color: rgba(10, 10, 12, 0.8);
}
[data-theme="light"] header { background-color: rgba(244, 245, 248, 0.85); border-bottom-color: var(--border); }

.logo { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.logo small { color: var(--dim); font-weight: 600; font-size: 11px; padding: 4px 10px; background: var(--bg3); border-radius: 8px; border: 1px solid var(--border2); font-family: 'Space Grotesk', sans-serif; }

nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red-hi); box-shadow: 0 0 12px var(--red-glow); transition: background 0.3s, box-shadow 0.3s; }
.dot.on { background: var(--ok); box-shadow: 0 0 12px var(--ok-glow); animation: pulseDot 1.5s infinite; }

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 var(--ok-glow); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.theme-toggle { width: 38px; height: 38px; padding: 0; border-radius: 50%; background: var(--bg3); border: 1px solid var(--border2); color: var(--dim); box-shadow: none; transition: transform 0.3s ease, background 0.3s, border-color 0.3s; }
.theme-toggle:hover { color: var(--fg-bright); border-color: var(--border-hi); background: var(--bg4); transform: scale(1.1) rotate(15deg); }
.theme-toggle .ph { font-size: 20px; }

.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; box-shadow: none; }

/* ================================================================
   BUTTONS
   ================================================================ */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg3); color: var(--fg);
  border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 10px 20px; font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 0.3px; white-space: nowrap; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
button:hover { border-color: var(--border-hi); background: var(--bg4); color: var(--fg-bright); transform: translateY(-2px); box-shadow: var(--shadow); }
button:active { transform: translateY(0); }

button.primary { background: linear-gradient(135deg, var(--acc-hi), var(--acc)); border-color: var(--acc); color: #fff; box-shadow: 0 4px 20px var(--acc-glow); }
button.primary:hover { background: linear-gradient(135deg, var(--acc), var(--acc-hi)); box-shadow: 0 8px 32px var(--acc-glow); transform: translateY(-2px); }

button.danger { background: var(--bg3); border-color: var(--border2); color: var(--red-hi); }
button.danger:hover { background: var(--red-glow); border-color: var(--red-hi); color: var(--red-hi); }

button.ok-btn { background: var(--bg3); border-color: var(--border2); color: var(--ok-hi); }
button.ok-btn:hover { background: var(--ok-glow); border-color: var(--ok); color: var(--ok-hi); }

button.active { border-color: var(--acc); color: var(--acc-hi); background: var(--acc-glow); }

.tab-btn { background: transparent; border: 1px solid transparent; color: var(--dim); padding: 8px 18px; border-radius: 10px; box-shadow: none; transition: all 0.2s ease; }
.tab-btn:hover { color: var(--fg-bright); background: var(--bg3); transform: none; box-shadow: none; }
.tab-btn.active { color: var(--fg-bright); background: var(--bg3); border-color: var(--border2); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); animation: pulseGlow 2s ease-in-out infinite; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 0 rgba(225,29,72,0); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 20px rgba(225,29,72,0.15); }
}

/* ================================================================
   INPUTS / SELECTS
   ================================================================ */
input, select {
  background: var(--bg1); color: var(--fg-bright);
  border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 10px 16px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 500; outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input::placeholder { color: var(--dim2); }
input:focus, select:focus { border-color: var(--acc); background: var(--bg2); box-shadow: 0 0 0 3px var(--acc-glow), inset 0 2px 4px rgba(0,0,0,0.05); }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; cursor: pointer;
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content { position: relative; z-index: 1; }
.view { padding: 32px; max-width: 100%; margin: 0 auto; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 { position: relative; margin: 0 0 24px; padding-left: 20px; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg, var(--fg-bright), var(--acc-hi)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
h2::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 80%; border-radius: 4px; background: linear-gradient(180deg, var(--red-hi), var(--acc-hi)); }
h3 { margin: 0 0 16px; font-size: 20px; font-weight: 600; color: var(--fg-bright); }

/* ================================================================
   TABLES
   ================================================================ */
.tbl-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border2);
  background: var(--bg2);
  box-shadow: var(--shadow);
}

.tbl {
  width: 100%; border-collapse: collapse; background: transparent;
  min-width: 1000px;
}
.tbl th { padding: 16px 24px; text-align: left; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; background: var(--bg3); border-bottom: 1px solid var(--border2); white-space: nowrap; font-family: 'Space Grotesk', sans-serif; }
.tbl td { padding: 16px 24px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background 0.2s, transform 0.2s, box-shadow 0.2s; }
.tbl tbody tr:hover td { background: var(--acc-glow); }
.tbl tbody tr:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(225,29,72,0.15); position: relative; z-index: 1; }
.tbl.small th, .tbl.small td { padding: 12px 18px; font-size: 13px; }

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================================
   MISC / BADGES
   ================================================================ */
.empty { color: var(--dim); padding: 64px; text-align: center; font-size: 15px; font-weight: 500; background: var(--bg2); border-radius: var(--radius-lg); border: 2px dashed var(--border2); margin-top: 16px; }

.tag { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border2); border-radius: 24px; padding: 6px 16px; font-size: 12px; font-weight: 700; color: var(--dim); background: var(--bg3); white-space: nowrap; font-family: 'Space Grotesk', sans-serif; }
.tag.on { color: var(--ok-hi); border-color: var(--ok); background: var(--ok-glow); }

.bots-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

/* ================================================================
   CONTROL
   ================================================================ */
.ctrl-top { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.browser-pane { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }

.tabstrip { display: flex; align-items: stretch; gap: 2px; padding: 10px 10px 0; background: var(--bg1); border-bottom: 1px solid var(--border2); overflow-x: auto; }
.btab { position: relative; display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 10px 16px; background: var(--bg2); border: 1px solid var(--border2); border-bottom: none; border-radius: 12px 12px 0 0; color: var(--dim); white-space: nowrap; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s; }
.btab:hover { color: var(--fg-bright); background: var(--bg3); }
.btab.active { color: var(--fg-bright); background: var(--bg); border-color: var(--border-hi); }
.btab.active::before { content: ''; position: absolute; top: 0; left: 16px; right: 16px; height: 2px; border-radius: 0 0 2px 2px; background: linear-gradient(90deg, var(--red-hi), var(--acc-hi)); }
.btab-title { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.btab-x { color: var(--dim); padding: 2px; border-radius: 4px; display: flex; }
.btab-x:hover { color: var(--red-hi); background: var(--red-glow); }
.btab.add { padding: 10px 16px; color: var(--dim); }
.btab.add:hover { color: var(--ok-hi); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border2); background: var(--bg3); align-items: center; }
.toolbar.navrow { background: var(--bg2); }
.toolbar.navrow input { flex: 1; min-width: 150px; border-radius: 24px; padding-left: 20px; }

#screen-wrap, #mon-screen-wrap { position: relative; min-height: 400px; display: flex; align-items: center; justify-content: center; background: #000; outline: none; }
[data-theme="light"] #screen-wrap, [data-theme="light"] #mon-screen-wrap { background: #141824; }
#mon-screen-wrap { min-height: 340px; }
#screen, #mon-screen { max-width: 100%; max-height: 74vh; user-select: none; }
#screen-off, #mon-off, #desk-off { position: absolute; color: var(--dim); font-size: 16px; font-weight: 600; padding: 24px 36px; background: var(--bg2); border-radius: 16px; border: 1px solid var(--border2); text-align: center; pointer-events: none; box-shadow: var(--shadow-lg); }
#screen-wrap:fullscreen, #mon-screen-wrap:fullscreen { min-height: 100vh; background: #000; }
#screen-wrap:fullscreen #screen, #mon-screen-wrap:fullscreen #mon-screen { max-height: 100vh; }

/* ================================================================
   MONITOR
   ================================================================ */
.mon-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 16px 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.mon-bar b { margin-right: 12px; display: flex; align-items: center; gap: 8px; }

.chk { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.chk input[type="checkbox"] { appearance: none; width: 20px; height: 20px; border: 1px solid var(--border2); border-radius: 6px; background: var(--bg1); cursor: pointer; position: relative; transition: all 0.2s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.chk input[type="checkbox"]:checked { background: var(--acc); border-color: var(--acc); }
.chk input[type="checkbox"]:checked::after { content: ''; position: absolute; top: 3px; left: 7px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ================================================================
   PANES
   ================================================================ */
.pane-tabs { display: flex; gap: 8px; margin: 24px 0 16px; flex-wrap: wrap; }
.ptab { background: var(--bg2); border: 1px solid var(--border2); color: var(--dim); padding: 10px 24px; border-radius: 24px; font-weight: 600; box-shadow: none; transition: all 0.2s ease; }
.ptab:hover { color: var(--fg-bright); border-color: var(--border-hi); background: var(--bg3); transform: none; box-shadow: none; }
.ptab.active { color: #fff; border-color: var(--acc); background: var(--acc); box-shadow: 0 4px 16px var(--acc-glow); }

.pane { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }

.term-out { background: var(--bg1); border: 1px solid var(--border2); border-radius: var(--radius); padding: 20px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; color: var(--ok-hi); max-height: 350px; min-height: 140px; overflow-y: auto; box-shadow: inset 0 4px 12px rgba(0,0,0,0.3); }
[data-theme="light"] .term-out { background: #1a2030; color: #a7f3d0; border-color: #2a3441; }
.term-in { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ================================================================
   BUILDER / SETTINGS
   ================================================================ */
.builder-form { display: flex; flex-wrap: wrap; gap: 24px; align-items: end; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.builder-form label { display: flex; flex-direction: column; gap: 10px; color: var(--dim); font-size: 13px; font-weight: 600; }
.builder-form label.chk { flex-direction: row; align-items: center; padding-bottom: 10px; }
.builder-form .wide { flex-basis: 100%; flex-direction: row; align-items: center; gap: 14px; }

#b-log { margin-top: 20px; min-height: 80px; max-height: 240px; }

/* ================================================================
   BUILD FILES (категоризированный вывод сборки)
   ================================================================ */
.build-files { margin-top: 24px; display: flex; flex-direction: column; gap: 24px; }

.build-cat {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.build-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-bright);
  font-size: 15px;
}
.build-cat-head .ph { font-size: 20px; color: var(--acc-hi); }
.build-cat-hint {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
}

.build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.build-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.build-card:hover {
  transform: translateY(-3px);
  border-color: var(--acc);
  background: var(--bg4);
  box-shadow: 0 10px 28px var(--acc-glow);
  color: var(--fg-bright);
}

.build-card-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--acc-glow);
  border: 1px solid var(--border2);
  color: var(--acc-hi);
}
.build-card-icon .ph { font-size: 22px; }

.build-card-body { flex: 1; min-width: 0; }
.build-card-title { font-weight: 600; font-size: 14px; color: var(--fg-bright); font-family: 'Space Grotesk', sans-serif; }
.build-card-desc { font-size: 12px; color: var(--dim); margin-top: 2px; }
.build-card-file {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--dim2);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-card-dl {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--acc-hi);
  background: transparent;
  border: 1px solid var(--border2);
  transition: background 0.2s, color 0.2s;
}
.build-card:hover .build-card-dl {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}

.hint { color: var(--dim); font-size: 13px; font-weight: 500; }
.hint code { background: var(--bg3); padding: 3px 8px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 12px; border: 1px solid var(--border2); }

/* ================================================================
   STEAL
   ================================================================ */
.steal-detail { margin-top: 24px; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.cookie-row { padding: 8px 14px; border-bottom: 1px solid var(--border2); font-size: 13px; font-family: 'JetBrains Mono', monospace; }
.cookie-row b { color: var(--acc-hi); }
.sec-block { margin: 20px 0; }
.sec-block > .sec-title { color: var(--ok-hi); font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ================================================================
   TOASTS
   ================================================================ */
#toasts { position: fixed; right: 32px; bottom: 32px; display: flex; flex-direction: column; gap: 12px; z-index: 100; }
.toast { background: var(--bg2); border: 1px solid var(--border2); border-left: 4px solid var(--acc); border-radius: 12px; padding: 18px 24px; max-width: 400px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); background-color: rgba(18, 18, 22, 0.9); }
[data-theme="light"] .toast { background-color: rgba(255, 255, 255, 0.95); }
.toast.err { border-left-color: var(--red-hi); }
@keyframes toastSlideIn { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: translateX(0); } }

/* ================================================================
   BOT STATUS LINE
   ================================================================ */
.bot-status { font-size: 12px; font-weight: 600; color: var(--ok-hi); margin-top: 6px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-status.dim, .dim { color: var(--dim); }
.bot-note { font-size: 11px; font-weight: 500; color: var(--warn); margin-top: 2px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-btn { padding: 6px 10px; font-size: 15px; margin-left: 8px; gap: 4px; }
#cam-screen { border: 1px solid var(--border2); }
h3 .ph { font-size: 18px; }

/* ================================================================
   BOT TABS — табы открытых ботов (как в браузере)
   ================================================================ */
.bt-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border2);
  border-radius: 8px 8px 0 0;
  background: var(--bg2);
  color: var(--dim);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
}
.bt-tab:hover { background: var(--bg3); color: var(--fg); }
.bt-tab.active {
  background: var(--bg3);
  color: var(--fg-bright);
  border-bottom: 2px solid var(--acc);
}
.bt-tab .bt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
}
.bt-tab .bt-dot.on { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,.5); }
.bt-tab .bt-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.bt-tab .bt-close {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  font-size: 14px;
  color: var(--dim);
  flex-shrink: 0;
}
.bt-tab .bt-close:hover { background: var(--acc-glow); color: var(--acc-hi); }
.bt-tab-back {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--dim);
  cursor: pointer;
}
.bt-tab-back:hover { color: var(--fg-bright); background: var(--bg3); }

/* бейдж трансляции в табе */
.bt-tab .bt-stream {
  font-size: 10px;
  color: var(--acc-hi);
  font-weight: 600;
}

/* бейдж названия билда рядом с именем бота */
.bot-build {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--acc, #2f81f7);
  background: rgba(47, 129, 247, 0.12);
  border: 1px solid rgba(47, 129, 247, 0.35);
  border-radius: 6px;
  padding: 1px 7px;
  vertical-align: middle;
  margin-left: 4px;
}
