:root {
  --bg: #0b141a;
  --surface: #111b21;
  --surface-2: #202c33;
  --surface-3: #2a3942;
  --line: #2f3b43;
  --text: #e9edef;
  --muted: #8696a0;
  --accent: #00a884;
  --accent-strong: #008069;
  --accent-soft: rgba(0, 168, 132, .14);
  --link: #53bdeb;
  --good: #25d366;
  --warn: #e9a700;
  --danger: #ea0038;
  --radius: 8px;
  --wa-header: #202c33;
  --wa-panel: #111b21;
  --wa-chat-bg: #0b141a;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--wa-chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--link); }
code { color: #d9fdd3; background: rgba(0, 168, 132, .12); padding: 2px 5px; border-radius: 4px; }

#app { width: 100%; height: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; }
.top {
  flex-shrink: 0; min-height: 59px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--wa-header); box-shadow: 0 1px 3px rgba(11, 20, 26, .4);
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-logo-wrap { position: relative; flex-shrink: 0; }
.logo-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: none; background: var(--surface-3); }
.brand-logo-btn {
  flex-shrink: 0; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 50%;
  line-height: 0;
}
.brand-logo-btn:hover { filter: brightness(1.12); }
.brand-logo-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brand-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand-title-input {
  min-width: 180px; max-width: min(360px, 52vw);
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.04); color: var(--text);
  padding: 6px 10px; font-size: 1.05rem; font-weight: 800;
}
.brand-edit-btn {
  border: 0; background: transparent; cursor: pointer;
  font-size: .95rem; line-height: 1; padding: 4px 6px; border-radius: 8px;
  opacity: .85;
}
.brand-edit-btn:hover { background: var(--accent-soft); opacity: 1; }
.brand-logo-wrap .brand-edit-btn {
  position: absolute; right: -4px; bottom: -4px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .72rem; padding: 2px 5px;
}
.brand-save-btn { padding: 6px 12px; font-size: .76rem; }
.brand-avatar-panel { max-width: 420px; }
.brand-avatar-body { display: grid; gap: 10px; }
.brand-crop-frame {
  width: 220px; height: 220px; margin: 0 auto;
  border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(0, 168, 132, .45);
  background: rgba(0,0,0,.25);
}
#brandCropCanvas { display: block; width: 220px; height: 220px; }
.brand-crop-control {
  display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center;
  font-size: .78rem; color: var(--muted);
}
.brand-crop-control input[type=range] { width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: 1.13rem; letter-spacing: -.02em; }
.brand p { margin: 0; color: var(--muted); font-size: .8rem; }
.top-right, .auth, .auth-user { display: flex; align-items: center; gap: 10px; }
.auth-user { min-width: 0; }
.auth-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.auth-user-text { display: grid; gap: 1px; min-width: 0; }
.auth-user-name { font-size: .85rem; font-weight: 700; }
.auth-user-email { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .72rem; }
.btn-howto { border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: .76rem; }
.btn-howto:hover { color: var(--text); }

.topbar-update { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-update[hidden],
.topbar-update.hidden,
.master-power[hidden],
.master-power.hidden { display: none !important; }
.version-chip {
  display: inline-flex; align-items: center;
  font-size: .72rem; font-weight: 700; color: var(--muted);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 10px; white-space: nowrap;
}
.version-chip.has-update { color: var(--warn); border-color: rgba(255,200,97,.35); }
.update-btn { padding: 7px 12px; font-size: .78rem; box-shadow: none; }
.auto-update {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .76rem; font-weight: 600; color: var(--text);
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; cursor: pointer; user-select: none;
}
.auto-update input { margin: 0; }

.master-power { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); cursor: pointer; }
.master-power-label { font-size: .78rem; font-weight: 700; color: var(--muted); min-width: 72px; }
.master-power.operator-mode { cursor: default; }
.master-power.operator-mode .master-switch { pointer-events: none; opacity: .85; }

.btn { border: 0; border-radius: 8px; padding: 9px 16px; color: #fff; background: var(--accent); cursor: pointer; font-weight: 600; font-size: .85rem; box-shadow: none; }
.btn:hover { background: var(--accent-strong); filter: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { color: var(--text); background: var(--surface-3); box-shadow: none; border: 1px solid var(--line); }
.btn.secondary:hover { background: #3b4a54; }
.btn.danger { color: #fff; background: #c62828; border-color: #b71c1c; }
.btn.danger:hover { background: #b71c1c; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.between { justify-content: space-between; }
.hint { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.hidden { display: none !important; }

#main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, .42fr) minmax(480px, 1.58fr); gap: 0; padding-top: 0; }
.side-rail {
  min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 0;
  padding: 0; border: none; border-right: 1px solid var(--line); border-radius: 0;
  background: var(--wa-panel); box-shadow: none; position: relative; z-index: 5;
}
.nav-menu {
  position: relative; left: auto; right: auto; top: auto;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 0;
  overflow: auto;
  padding: 8px 0; border: none; border-radius: 0;
  background: var(--wa-panel); box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}
.nav-menu::-webkit-scrollbar { width: 8px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.22);
  border-radius: 8px;
}
.nav-item {
  display: block; width: 100%; text-align: left;
  border: none; border-radius: 0; padding: 12px 20px;
  color: var(--text); background: transparent; cursor: pointer; font-weight: 500;
}
.nav-item:hover, .nav-item.active { background: var(--surface-3); border: none; }
.nav-group { display: grid; gap: 0; padding-top: 0; border-top: 1px solid var(--line); }
.nav-group-label {
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); padding: 12px 20px 6px;
}
.nav-add { width: calc(100% - 32px); margin: 8px 16px; }
.channel-sidebar-list {
  flex: 1 1 auto; min-height: 80px; max-height: none; overflow: auto;
  display: flex; flex-direction: column; gap: 0;
}
.main-workspace {
  min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  padding: 0; border: none; border-radius: 0;
  background: var(--wa-chat-bg); box-shadow: none; position: relative;
}
.guest-channel-lock {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: rgba(8, 12, 20, .62);
  text-align: center;
}
.guest-channel-lock.hidden { display: none !important; }
.channel-guest-inert .channel-open { pointer-events: none; opacity: .92; }
.guest-channel-lock p { margin: 0; max-width: 28rem; color: #d7def0; }
.nav-item[hidden],
.nav-item.hidden { display: none !important; }
.card { min-width: 0; }
.rail-heading { margin: 0 0 8px; font-size: .95rem; letter-spacing: -.01em; }
.channel-rail-head { margin-top: 4px; }
.channel-rail-head .rail-heading { margin: 0; }
.channel-rail-hint { margin: 0 0 6px; }

.workspace-topbar {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: stretch;
  gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--wa-header);
  overflow: visible;
}
.workspace-chrome {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  min-width: 0; overflow: visible;
}
.workspace-chrome-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px;
  min-width: 0; overflow: visible;
}
.workspace-title { display: grid; gap: 6px; min-width: 0; flex: 1; }
.top-cell, .workspace-chrome .top-field, .workspace-chrome .top-slot {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-width: 0; flex: 0 0 auto;
  overflow: visible;
}
.top-cell-id { min-width: 132px; }
.top-cell-row {
  display: flex; align-items: center; gap: 4px; height: 32px; min-width: 0;
}
.workspace-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.workspace-title-row strong, .top-cell-id strong {
  font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 188px;
}
.workspace-title strong { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-title .hint { margin: 0; }
.btn-icon {
  flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255,255,255,.04); color: var(--muted); cursor: pointer;
  width: 32px; height: 32px; padding: 0; font-size: .85rem; line-height: 1;
}
.btn-icon:hover { color: var(--text); border-color: var(--accent); }
.workspace-name-input {
  min-width: 0; max-width: 160px; height: 32px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-3); color: var(--text); padding: 4px 8px; font-size: .85rem;
}
.channel-top-strip {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px;
  margin: 0; padding: 0; border: none; border-radius: 0; background: transparent;
  min-width: 0; overflow: visible;
}
.channel-strip-field.hidden { display: none !important; }
.channel-top-strip.hidden { display: none !important; }
.top-slot-label, .workspace-chrome .top-field > span:not(.top-field-input-row):not(.top-field-label-row), .call-names-mini span {
  min-height: 18px; height: auto; font-size: .72rem; font-weight: 700; letter-spacing: .01em;
  color: #c5d0d8; line-height: 1.25; white-space: nowrap;
  overflow: visible; max-width: none; text-transform: none;
}
.top-field-listen {
  flex: 0 1 280px;
  min-width: 240px;
}
.top-field-label-row {
  display: flex; align-items: center; gap: 8px; min-height: 18px; height: auto;
  overflow: visible; position: relative; z-index: 2;
}
.top-field-label-row > span {
  min-height: 18px; height: auto; font-size: .72rem; font-weight: 700; color: #c5d0d8; line-height: 1.25;
  overflow: visible;
}
.top-help-link {
  border: none; background: none; padding: 0; cursor: pointer;
  color: #f5c84a; font-size: .72rem; font-weight: 800; letter-spacing: .02em;
  line-height: 1.25; text-decoration: underline; text-underline-offset: 2px;
  flex-shrink: 0; z-index: 2;
}
.top-help-link:hover { color: #ffe08a; }
.top-field-input-row {
  display: flex; align-items: center; gap: 6px; min-width: 0; height: 32px;
}
.top-field-input-row input { flex: 1; min-width: 0; }
.workspace-chrome .top-field-listen input {
  width: 196px; min-width: 168px;
}
.top-paste-btn {
  height: 32px;
  padding: 0 12px;
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: var(--surface-3) !important;
  color: var(--text) !important;
  font-weight: 700 !important;
  font-size: .75rem !important;
  box-shadow: none !important;
}
.top-field-writer { position: relative; }
.writer-pick-panel { max-width: 420px; width: min(420px, 92vw); }
.writer-pick-list { display: grid; gap: 8px; margin-top: 10px; max-height: min(52vh, 420px); overflow: auto; }
.writer-pick-list button {
  display: block; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-3); color: var(--text);
  padding: 10px 12px; cursor: pointer; font-size: .86rem; font-weight: 600;
}
.writer-pick-list button:hover { border-color: var(--accent); background: var(--accent-soft); }
.writer-pick-list .hint { font-weight: 500; margin-top: 2px; display: block; }
.publisher-help-panel { max-width: 520px; }
.publisher-help-img {
  width: 100%; max-width: 360px; border-radius: 10px; margin: 8px 0 16px;
  border: 1px solid var(--line);
}
.publisher-help-panel h3 { margin: 12px 0 6px; font-size: .9rem; color: var(--accent); }
.publisher-help-panel ol { margin: 0 0 8px; padding-left: 1.2rem; color: var(--muted); }
.publisher-help-panel code { font-size: .78rem; }
.workspace-chrome .top-field input {
  width: 132px; height: 32px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--text); padding: 4px 8px; font-size: .8rem;
}
.workspace-chrome .top-field input.handle-ok {
  color: var(--good); border-color: rgba(73,214,163,.55); box-shadow: 0 0 0 1px rgba(73,214,163,.18);
  font-weight: 700;
}
.workspace-chrome .top-field input.handle-bad {
  color: var(--danger); border-color: rgba(255,119,127,.55); box-shadow: 0 0 0 1px rgba(255,119,127,.18);
  font-weight: 700;
}
.top-slot { align-content: end; }
.top-slot-wide { flex: 1; min-width: min(280px, 100%); }
.top-power-slot .channel-power { margin: 0; height: 32px; }
.top-power-slot .channel-power span { font-size: .78rem; font-weight: 800; color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: .72rem; box-shadow: none; height: 32px; box-sizing: border-box; }
.top-role-status, .top-cookie-status {
  display: inline-flex; align-items: center; height: 32px; box-sizing: border-box;
  font-size: .72rem; font-weight: 800;
  border-radius: 8px; padding: 0 8px; white-space: nowrap;
  background: #0a0a0a;
}
.top-role-status.role-admin { color: #ffc861; }
.top-role-status.role-mod { color: #7ec8ff; }
.top-role-status.role-normal { color: #fff; }
.top-role-status.role-wait { color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.top-cookie-status.cookie-fresh { color: var(--good); background: #0a0a0a; }
.top-cookie-status.cookie-stale { color: var(--warn); background: #0a0a0a; }
.top-cookie-status.cookie-none { color: var(--danger); background: #0a0a0a; }
.top-cookie-status.cookie-wait { color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.top-system-status {
  display: block; font-size: .72rem; font-weight: 700; padding: 4px 8px; border-radius: 8px; line-height: 1.3;
}
.top-system-status.hidden { display: none !important; }
.top-system-status.sys-ok { color: var(--good); background: rgba(73,214,163,.08); border: 1px solid rgba(73,214,163,.25); }
.top-system-status.sys-warn { color: var(--warn); background: rgba(255,200,97,.08); border: 1px solid rgba(255,200,97,.25); }
.top-system-status.sys-bad { color: var(--danger); background: rgba(255,119,127,.08); border: 1px solid rgba(255,119,127,.25); }
.channel-license-chip {
  display: inline-flex; align-items: center; height: 32px; box-sizing: border-box;
  font-size: .72rem; font-weight: 800; border-radius: 8px; padding: 0 10px;
  white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
  color: var(--good); background: rgba(73,214,163,.1); border: 1px solid rgba(73,214,163,.28);
}
.top-slot-license .top-cell-row { gap: 6px; }
.channel-license-chip.is-trial {
  color: #cfe8ff; background: rgba(80,140,220,.12); border-color: rgba(80,140,220,.35);
}
.channel-license-chip.is-urgent {
  color: #ff3b4a;
  background: rgba(255, 20, 40, .12);
  border-color: #ff2a3a;
  text-shadow: 0 0 6px #ff1a2e, 0 0 14px rgba(255, 40, 60, .95), 0 0 22px rgba(255, 0, 40, .65);
  animation: license-neon-pulse 1.2s ease-in-out infinite;
}
@keyframes license-neon-pulse {
  0%, 100% { text-shadow: 0 0 4px #ff1a2e, 0 0 10px rgba(255, 40, 60, .7); }
  50% { text-shadow: 0 0 10px #ff4455, 0 0 22px #ff0022, 0 0 32px rgba(255, 0, 40, .9); }
}
.license-chip.is-urgent {
  color: #ff3b4a;
  border-color: #ff2a3a;
  background: rgba(255, 20, 40, .14);
  text-shadow: 0 0 6px #ff1a2e, 0 0 14px rgba(255, 40, 60, .9);
  animation: license-neon-pulse 1.2s ease-in-out infinite;
}
.workspace-topbar-actions {
  display: flex; align-items: center; gap: 8px; flex: 1 1 220px;
  min-width: 180px; margin-left: auto; height: auto; flex-wrap: wrap;
}
.workspace-topbar-actions #topSystemStatus {
  flex: 1 1 200px;
  min-width: 160px;
  margin: 0;
}
.unsaved-banner { color: var(--danger); font-size: .72rem; font-weight: 700; white-space: nowrap; }

.channel-workspace { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.panel-view { display: grid; gap: 14px; }
.panel-view.hidden { display: none !important; }
.layout-operator [data-ai-card] { display: none !important; }
.channel-admins { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); }
.yt-card.channel-admins { margin-top: 12px; }
.channel-admins h4 { margin: 0 0 8px; }
.channel-identity-strip .channel-admins { margin-top: 8px; }
.identity-block { margin-top: 12px; padding-top: 10px; }
.channel-identity-strip .identity-block + .identity-block { border-top: 1px solid var(--line); }
.identity-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #dbe6fa; margin-bottom: 4px; }
.identity-note { display: block; margin-top: 4px; }
.identity-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.admin-search-results { display: grid; gap: 6px; margin: 8px 0; }
.admin-search-hit, .admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
}
.saved-flash {
  flex-shrink: 0; margin: 10px 0 0; padding: 10px 14px;
  border-radius: 10px; border: 1px solid rgba(73,214,163,.4);
  background: rgba(73,214,163,.12); color: var(--good); font-weight: 700;
}
@keyframes save-neon-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(73, 214, 163, 0);
    outline-color: rgba(73, 214, 163, .2);
  }
  45% {
    box-shadow: 0 0 22px 6px rgba(73, 214, 163, .55);
    outline-color: rgba(120, 255, 200, .95);
  }
}
.save-neon-pulse {
  outline: 2px solid rgba(73, 214, 163, .85);
  border-radius: 10px;
  animation: save-neon-pulse 0.9s ease-in-out 3;
}
.channel-nav-item {
  display: grid; gap: 2px; text-align: left; border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 12px 16px; color: var(--text); background: transparent; cursor: pointer;
}
.channel-nav-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 500; }
.channel-nav-item span { color: var(--muted); font-size: .78rem; }
.channel-nav-item:hover { background: var(--surface-3); }
.channel-nav-item.active {
  background: var(--surface-3);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}
.channel-nav-item.has-license-req { border-left: 3px solid var(--warn); }
.nav-license-warn {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px; font-style: normal; font-size: .64rem; font-weight: 800;
  color: #3a2a00; background: var(--warn);
}
.ulic-bars { display: flex; flex-direction: column; gap: 12px; }
.ulic-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px !important;
}
.ulic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ulic-channel-chip {
  font-size: .78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.ulic-channel-chip.is-ok { background: rgba(73,214,163,.18); color: var(--good); }
.ulic-channel-chip.is-bad { background: rgba(255,90,90,.16); color: #ffb4b4; }
.ulic-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ulic-form [data-admin-q] { flex: 1 1 220px; min-width: 180px; }
.ulic-form [data-admin-amount] { width: 4rem !important; }
.ulic-inline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ulic-card .admin-row.ulic-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ulic-remain {
  font-size: .78rem;
  font-weight: 800;
  margin-left: auto;
}
.ulic-remain.is-ok { color: var(--good); }
.ulic-remain.is-bad { color: #ff8d8d; }
.ulic-remain.is-trial { color: var(--warn); }
.ulic-user-meta em { display: block; font-style: normal; color: var(--muted); font-size: .72rem; }
.ulic-bar.ulic-strip {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 6px 10px !important;
  overflow-x: auto;
  min-height: 42px;
}
.ulic-name {
  flex: 0 0 148px;
  min-width: 120px;
  max-width: 168px;
  display: flex;
  flex-direction: column;
  gap: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: .88rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.ulic-name:hover { color: var(--accent); text-decoration: underline; }
.ulic-name .hint { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.ulic-strip [data-admin-q] { width: 168px; flex: 0 0 168px; min-width: 140px; }
.ulic-strip [data-admin-amount] { width: 3.2rem !important; flex: 0 0 3.2rem; }
.ulic-strip [data-admin-unit] { width: auto; flex: 0 0 auto; }
.ulic-strip .ulic-inline-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 180px;
}
.ulic-strip .admin-row.ulic-user {
  padding: 0;
  border: none;
  border-radius: 0;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.ulic-user-meta { font-size: .78rem; color: var(--muted); }
.ulic-user-meta strong { color: var(--text); margin-right: 4px; }
.ulic-empty { white-space: nowrap; }
.ulic-summary { color: var(--muted); font-size: .72rem; font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
.ulic-hint { white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.ulic-pending {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; flex: 0 0 auto;
  padding: 2px 6px; border-radius: 8px;
  background: rgba(255,200,97,.12); border: 1px solid rgba(255,200,97,.35);
}
.ulic-strip .license-req-inbox {
  display: flex; flex-wrap: nowrap; gap: 6px; margin: 0; flex: 0 0 auto;
}
.ulic-hits {
  position: absolute;
  z-index: 30;
  top: calc(100% - 2px);
  left: 156px;
  min-width: 240px;
  max-width: 360px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.ulic-hits:empty { display: none; }
.admin-row-actions { display: flex; flex-wrap: nowrap; gap: 4px; flex-shrink: 0; }
.channel-admins-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.license-req-inbox { margin: 10px 0 12px; }
.license-req-inbox.hidden { display: none !important; }
.license-req-card {
  padding: 10px 12px; border: 1px solid rgba(255,200,97,.4);
  border-radius: 12px; background: rgba(255,200,97,.1);
}
.license-req-card-label { font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--warn); margin-bottom: 4px; }
.billing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.billing-grid .yt-card { padding: 12px; display: grid; gap: 8px; }
.announce-card { padding: 12px; display: grid; gap: 8px; }
.announce-card textarea { width: 100%; min-height: 72px; resize: vertical; }
.announce-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.announce-pick-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: .88rem;
}
.announce-pick-row span { color: var(--muted); font-size: .78rem; }
.license-iban-box {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(73,214,163,.3); background: rgba(73,214,163,.08);
  font-size: .85rem; display: grid; gap: 4px;
}
.license-iban-num { font-weight: 800; letter-spacing: .04em; word-break: break-all; }
.license-iban-warn { color: var(--warn); font-weight: 700; margin: 6px 0 0; }
.license-req-price { font-size: .9rem; font-weight: 700; margin: 8px 0; }
.license-req-duration-row { display: flex; gap: 8px; align-items: center; }
.license-req-duration-row select {
  height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-3); color: var(--text); padding: 0 8px;
}
.license-req-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(160px, .9fr); gap: 16px; align-items: start; }
.license-req-side { display: grid; gap: 10px; justify-items: stretch; }
.license-req-sent {
  padding: 12px 14px; border-radius: 12px; font-weight: 700;
  color: #b8f5d0; background: rgba(73,214,163,.16); border: 1px solid rgba(73,214,163,.4);
}
.license-req-rejected {
  padding: 12px 14px; border-radius: 12px; font-weight: 700;
  color: #ffd0d3; background: rgba(255,119,127,.12); border: 1px solid rgba(255,119,127,.35);
}
.channel-empty { display: grid; place-items: center; gap: 6px; min-height: 240px; color: var(--muted); text-align: center; padding: 24px; }

.owner-sections .system-key-card + .system-key-card { margin-top: 10px; }
#globalSettingsRow, #globalSettingsGrid, .owner-sections > .row { margin-top: 12px; }
#pollerStatus { margin-top: 12px !important; }

/* Canlı dinleme — 2 kolon: sağlıklı | uyku/durdurulmuş/arızalı */
.live-strip {
  flex-shrink: 0;
  margin-top: 10px;
  width: 100%;
  border: 1px solid rgba(124, 156, 255, 0.22);
  border-radius: 12px;
  background: rgba(16, 24, 39, 0.92);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}
.live-strip-inner { padding: 8px 12px 10px; }
.live-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.live-strip-title {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #a9bcff;
}
.live-strip-global { font-size: .74rem; font-weight: 700; color: var(--muted); }
.live-strip-global.ok { color: var(--good); }
.live-strip-global.off { color: var(--warn); }
.live-strip-channels {
  display: block;
  max-height: none;
  overflow: visible;
}
.live-strip-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
  min-height: 0;
}
.live-strip-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.live-strip-col-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.live-strip-col-head.ok { color: #9ee8c8; }
.live-strip-col-head.rest { color: #f0c674; }
.live-strip-col-head span {
  font-variant-numeric: tabular-nums;
  opacity: .85;
}
.live-strip-col-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
}
.live-strip-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.live-strip-chip-name {
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.live-strip-chip-status {
  font-size: .66rem;
  color: var(--muted);
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}
.live-strip-chip.ok .live-strip-chip-name { color: #9ee8c8; }
.live-strip-chip.warn .live-strip-chip-name { color: var(--warn); }
.live-strip-chip.idle .live-strip-chip-name { color: #c8d4ea; }
.live-strip-chip.err .live-strip-chip-name { color: #ffb4b8; }
@media (max-width: 720px) {
  .live-strip-cols { grid-template-columns: 1fr; }
  .live-strip-col-list { max-height: 220px; }
}

.system-key-card, .yt-card { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.system-key-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.system-key-card h3 { margin: 0 0 3px; font-size: .87rem; }
.system-key-card p { margin-bottom: 0; }
.collapsible-body.collapsed { display: none; }
.settings-toggle { flex: 0 0 auto; min-width: 55px; padding: 7px 10px; }
.system-key-grid, .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.system-key-grid { margin-top: 12px; }
.system-key-field, label { display: grid; gap: 5px; color: #b5c4dc; font-size: .76rem; }
.system-key-field-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.system-key-status { font-size: .68rem; font-weight: 700; color: var(--good); }
.system-key-status.off { color: var(--muted); }
.credential-field { gap: 6px; }
.credential-label { font-size: .76rem; color: #b5c4dc; }
.credential-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}
.credential-input-wrap input,
.credential-input-wrap .credential-input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.35;
  padding: 8px 10px;
}
.credential-input.masked {
  -webkit-text-security: disc;
  text-security: disc;
  font-family: system-ui, sans-serif;
}
.btn-credential-paste {
  flex: 0 0 auto;
  align-self: stretch;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(124, 156, 255, .12);
  color: #c8d8f8;
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-credential-paste:hover { background: rgba(124, 156, 255, .22); border-color: var(--accent); }
.btn-credential-paste.paste-ok { background: rgba(73, 214, 163, .2); border-color: var(--good); color: #b8f5d8; }
.oauth-uri-guide { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.18); }
.oauth-uri-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.oauth-uri-list li { display: grid; gap: 4px; }
.oauth-uri-label { font-size: .72rem; color: #b5c4dc; }
.oauth-uri-label em { color: var(--muted); font-style: normal; }
.oauth-uri-code { display: block; font-size: .72rem; word-break: break-all; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.04); }
.oauth-uri-note { margin-top: 8px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; color: var(--text); background: #0c1422; outline: none; }
textarea { resize: vertical; min-height: 74px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,156,255,.12); }
.app-config-note { grid-column: 1 / -1; }
.yt-card-label { color: #dbe6fa; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.yt-card-meta { margin-top: 6px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.yt-card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.yt-card-name { font-weight: 600; font-size: .82rem; color: var(--muted); max-width: 52%; }
.yt-card-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.yt-channel-title { font-weight: 800; font-size: .92rem; color: #e8f0ff; text-align: right; line-height: 1.25; max-width: 240px; }
.live-status-line { margin-top: 8px; font-size: .85rem; line-height: 1.45; color: #c8d8f0; padding: 8px 10px; background: rgba(0,0,0,.2); border-radius: 8px; }
.yt-badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.yt-badge.bagli { color: #b8f5d8; background: rgba(73,214,163,.14); }
.yt-badge.kota { color: #ffe4a8; background: rgba(255,200,97,.14); }
.yt-badge.kopuk { color: #ffc4c8; background: rgba(255,119,127,.12); }
.yt-badge.oauth-err { color: #ffb4b4; background: rgba(255,80,80,.18); }

.keeper-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.keeper-row.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.keeper-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 800; letter-spacing: .04em;
  padding: 6px 10px; border-radius: 999px; border: 1px solid transparent;
}
.keeper-badge.keeper-ok { color: #b8f5d8; background: rgba(73,214,163,.16); border-color: rgba(73,214,163,.35); }
.keeper-badge.keeper-warn { color: #ffe4a8; background: rgba(255,200,97,.14); border-color: rgba(255,200,97,.35); }
.keeper-badge.keeper-off { color: #ffc4c8; background: rgba(255,119,127,.12); border-color: rgba(255,119,127,.28); }
.keeper-meta { margin: 8px 0 0; }
.keeper-install { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.keeper-steps { margin: 6px 0 8px 18px; }
.keeper-path {
  display: block; padding: 8px 10px; border-radius: 8px;
  background: rgba(0,0,0,.28); color: #c6d3ff; font-size: .74rem;
  word-break: break-all;
}
.keeper-channel-line { font-size: .82rem; margin: 0; line-height: 1.45; }
.keeper-ok-line { color: var(--good); }
.keeper-warn-line { color: var(--warn); }
.keeper-miss { color: var(--danger); }

.channel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.channel-head h3 { margin: 0; font-size: 1.1rem; }
.channel-power { display: flex; align-items: center; gap: 8px; color: var(--good); }
.channel-power input, .switch input { width: auto; accent-color: var(--good); }
.channel-power span, .switch span { font-size: .75rem; }
.traits { display: grid; gap: 8px; }
.character-picker { display: grid; gap: 10px; }
.character-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.character-picker-count { margin: 0; font-weight: 700; color: var(--text); }
.character-picker-msg { color: var(--warn); font-size: .74rem; }
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}
.character-btn {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s, opacity .15s;
}
.character-btn strong { font-size: .8rem; line-height: 1.2; }
.character-btn span { font-size: .68rem; color: var(--muted); line-height: 1.35; }
.character-btn:hover:not(.disabled):not(.conflict) {
  border-color: rgba(73,214,163,.45);
  background: rgba(73,214,163,.06);
}
.character-btn.selected {
  border-color: rgba(73,214,163,.75);
  background: rgba(73,214,163,.12);
  box-shadow: inset 0 0 0 1px rgba(73,214,163,.25);
}
.character-btn.disabled { opacity: .45; cursor: not-allowed; }
.character-btn.conflict { opacity: .55; cursor: not-allowed; border-color: rgba(248,113,113,.35); }
.vulgar-picker {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #c48b9f;
  background: #0c0a0b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 8px;
}
.vulgar-picker-copy {
  flex: 0 0 auto;
  min-width: 0;
}
.vulgar-picker-title {
  margin: 0;
  font-size: .72rem;
  font-weight: 800;
  color: #c48b9f;
  letter-spacing: .01em;
  line-height: 1.25;
  white-space: nowrap;
}
.vulgar-picker .hint {
  margin: 2px 0 0;
  font-size: .66rem;
  line-height: 1.3;
  color: #b76e79;
}
.vulgar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 0 1 auto;
  grid-template-columns: none;
}
.vulgar-btn {
  min-height: 0;
  width: auto;
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 7px;
  display: grid;
  gap: 2px;
  text-align: left;
  background: #0c0a0b !important;
  color: #c48b9f !important;
  border: 1px solid #c48b9f !important;
  box-shadow: none;
}
.vulgar-btn strong { color: #c48b9f; font-size: .72rem; }
.vulgar-btn span {
  display: block;
  color: #b76e79;
  font-size: .64rem;
  line-height: 1.3;
  white-space: nowrap;
}
.vulgar-btn:hover:not(.disabled) {
  background: #161214 !important;
  border-color: #b76e79 !important;
}
.vulgar-btn.selected {
  background: #1a1216 !important;
  border-color: #b76e79 !important;
  box-shadow: 0 0 0 1px #b76e79 !important;
}
.lang-picker { margin-top: 8px; }
.lang-picker > .hint { margin: 2px 0 6px; font-size: .7rem; line-height: 1.3; }
.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  grid-template-columns: none;
}
.lang-btn {
  min-height: 0;
  width: auto;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lang-btn strong { font-size: .72rem; font-weight: 700; }
.lang-btn.lang-auto {
  padding: 3px 10px;
  border-color: rgba(96, 165, 250, .55);
  background: rgba(37, 99, 235, .12);
}
.lang-btn.lang-auto span {
  font-size: .62rem;
  color: var(--muted);
  line-height: 1.2;
}
.lang-btn.lang-auto.selected {
  border-color: rgba(96, 165, 250, .95);
  background: rgba(37, 99, 235, .28);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .4);
}
.character-length { margin-top: 4px; }
.trait { display: grid; grid-template-columns: 110px minmax(80px,1fr) 36px; align-items: center; gap: 9px; }
.trait span { color: var(--muted); font-size: .75rem; }
input[type=range] { padding: 0; accent-color: var(--accent); }
.switch { display: inline-flex; grid-template-columns: none; align-items: center; gap: 7px; }
.switch input { width: 16px; height: 16px; }
.security-penalties { display: grid; gap: 8px; margin-top: 10px; }
.security-penalties .switch { width: fit-content; }
.identity-fields { margin-top: 12px; }
.uri { word-break: break-all; }
.field { display: grid; gap: 5px; }
.channel-actions-bottom { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.oauth-advanced summary { cursor: pointer; color: var(--muted); font-size: .78rem; }

.ai-provider-row { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); overflow: hidden; }
.ai-provider-row + .ai-provider-row { margin-top: 8px; }
.ai-provider-head-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; }
.ai-provider-head { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; border: 0; color: var(--text); background: transparent; cursor: pointer; text-align: left; }
.ai-provider-head strong { font-size: .82rem; }
.ai-provider-toggle { flex-shrink: 0; font-size: .72rem; padding: 5px 10px; }
.ai-provider-disabled { opacity: .78; }
.ai-provider-disabled.ai-provider-connected { border-color: rgba(148,163,184,.25); }
.ai-provider-details { display: none; padding: 0 12px 12px; }
.ai-provider-open .ai-provider-details { display: block; }
.ai-provider-connected { border-color: rgba(73,214,163,.28); }
.ai-provider-order { margin: 8px 0; }
.ai-provider-key-tools, .ai-provider-actions { margin-top: 8px; flex-wrap: wrap; }
.ai-gemini-slots { display: grid; gap: 8px; margin-top: 8px; }
.ai-gemini-slots label { font-size: .78rem; }
.ai-priority-badge { color: var(--good); font-size: .72rem; font-weight: 700; }
.ai-status { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.ai-status-on { color: var(--good); }
.ai-status-off { color: var(--muted); }
.ai-status-cool { color: var(--warn); }
.ai-status-paused { color: #94a3b8; }
.ai-user-status-value { margin-top: 8px; padding: 10px 12px; border-radius: 10px; font-size: .82rem; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.03); }
.ai-user-status-value.active { color: var(--good); background: rgba(73,214,163,.1); }

.memory { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: rgba(255,255,255,.02); }
.memory + .memory { margin-top: 8px; }
.memory-summary { cursor: pointer; list-style: none; }
.memory-summary::-webkit-details-marker { display: none; }
.memory-summary h3 { margin: 0 0 2px; font-size: .84rem; }
.memory-body { margin-top: 8px; }
.out { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #0a101b; border: 1px solid var(--line); color: #d7e3fb; font-size: .78rem; white-space: pre-wrap; word-break: break-word; }

.gate { width: min(760px, 100%); margin: auto; padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: rgba(16,24,39,.94); text-align: center; box-shadow: 0 22px 70px rgba(0,0,0,.3); }
.gate h2 { margin-bottom: 8px; }
.gate-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}
.gate-admin-btn { display: inline-flex; align-items: center; gap: 8px; }
.gate-key { font-size: 1rem; line-height: 1; }
.login-form { width: min(390px, 100%); margin: 24px auto 0; display: grid; gap: 12px; text-align: left; }
.login-form .btn { margin-top: 4px; }
.login-form .hint { min-height: 18px; margin: 0; color: var(--danger); text-align: center; }

.howto-modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; }
.howto-backdrop { position: absolute; inset: 0; background: rgba(1,4,10,.72); backdrop-filter: blur(5px); }
.howto-panel { position: relative; width: min(620px, 100%); max-height: 85vh; overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.howto-head { display: flex; justify-content: space-between; align-items: center; }
.howto-head h2 { margin: 0; font-size: 1rem; }
.howto-close { border: 0; color: var(--muted); background: transparent; font-size: 1.5rem; cursor: pointer; }
.howto-body { color: var(--muted); font-size: .86rem; line-height: 1.55; }
.howto-body h3 { color: var(--text); font-size: .88rem; margin: 18px 0 4px; }
.license-req-panel { width: min(720px, 100%); }
.about-panel { width: min(520px, 100%); text-align: center; }
.about-body { display: grid; gap: 14px; justify-items: center; }
.about-talha-logo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.about-body p { margin: 0; color: var(--text); font-size: .9rem; line-height: 1.6; }
.msg-join-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr); gap: 16px 20px; align-items: start; }

html.embedded-panel body { overflow: hidden; }
html.embedded-panel #app { padding: 12px 16px; }
html.embedded-panel .brand p,
html.embedded-panel .btn-howto { display: none; }
html.embedded-panel .top { padding-bottom: 12px; }

.license-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: min(420px, 48vw);
  padding: 4px 8px 4px 10px;
  border: 1px solid rgba(70, 180, 110, .35);
  border-radius: 999px;
  background: rgba(70, 180, 110, .12);
  color: #b8f5d0;
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.2;
}
.license-chip.hidden { display: none !important; }
.license-chip:not(.is-ok) {
  border-color: rgba(255, 196, 90, .4);
  background: rgba(255, 196, 90, .1);
  color: #ffe0a3;
}
.license-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.license-chip .btn,
.license-chip .btn.secondary {
  margin: 0;
  padding: 3px 8px;
  font-size: .68rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.license-chip .btn + .btn { margin-left: 0; }
.license-chip.is-warn {
  border-color: rgba(255, 196, 90, .55);
  background: rgba(255, 196, 90, .16);
  color: #ffe7b0;
}
.license-chip.is-locked {
  border-color: rgba(255, 119, 127, .45);
  background: rgba(255, 119, 127, .12);
  color: #ffc4c8;
}
.license-lock {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 11, 20, .78);
  backdrop-filter: blur(8px);
}
.license-lock.hidden { display: none !important; }
.license-lock-card {
  width: min(440px, 100%);
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  text-align: center;
}
.license-lock-card h2 { margin-bottom: 8px; font-size: 1.15rem; }
.license-lock-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.45; }
.license-lock-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.license-panel {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.license-panel.is-ok { border-color: rgba(70, 180, 110, .35); }
.license-panel.is-warn { border-color: rgba(255, 196, 90, .45); }
.license-panel.is-locked { border-color: rgba(255, 119, 127, .4); }
.license-panel.is-tech { border-color: rgba(124, 156, 255, .45); }
.license-panel-status { font-weight: 750; margin-bottom: 6px; }
.license-panel-msg { margin: 0 0 10px; color: var(--muted); }
.license-panel-actions { margin-top: 8px; }
.tech-login-box {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.tech-login-box summary { cursor: pointer; font-weight: 650; color: var(--text); }
.tech-login-box label { display: grid; gap: 4px; margin-top: 10px; font-size: .82rem; }
.tech-login-box input { width: 100%; }

#main.layout-operator { grid-template-columns: minmax(250px, .475fr) minmax(640px, 2.525fr); }

@media (max-width: 1050px) {
  body { overflow: auto; }
  #app { min-height: 100%; height: auto; }
  #main, #main.layout-operator { grid-template-columns: 1fr; min-height: 0; }
  .side-rail { max-height: none; overflow: visible; }
  .main-workspace { min-height: 680px; }
  .channel-workspace { overflow: visible; }
  .msg-join-row { grid-template-columns: 1fr; }
  .license-req-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  #app { padding: 13px; }
  .top { align-items: flex-start; flex-direction: column; }
  .top-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .topbar-update .auto-update span { display: none; }
  .brand-title-row { align-items: flex-start; flex-direction: column; gap: 3px; }
  .grid2, .system-key-grid { grid-template-columns: 1fr; }
  .workspace-topbar { flex-direction: column; align-items: stretch; }
  .workspace-chrome-row { flex-wrap: wrap; }
  .workspace-topbar-actions { margin-left: 0; justify-content: flex-start; }
  .main-workspace { min-height: auto; }
  .gate { padding: 24px 16px; }
}

.keeper-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.keeper-modal {
  background: var(--card, #1e293b);
  border: 1px solid var(--line, #334155);
  border-radius: 14px;
  padding: 18px;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.keeper-modal h3 { margin: 0 0 4px; }

.keeper-modal label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.keeper-modal input {
  font-weight: 400;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line, #334155);
  background: #0c1422;
  color: inherit;
}

.msg-option-block { margin-top: 8px; }
.msg-option-title { font-weight: 600; margin: 0 0 6px; font-size: .92rem; color: #e8f0ff; }
.msg-radio { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; font-size: .88rem; }
.msg-radio input { width: auto; margin: 0; }
.msg-radio-hint { margin: 0 0 8px 26px; font-size: .82rem; }
.msg-custom-input { width: 100%; max-width: 420px; margin: 6px 0 0 26px; }
.workspace-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.btn-human-mode {
  font-size: .68rem;
  font-weight: 700;
  padding: 0 8px;
  height: 32px;
  white-space: nowrap;
  border-radius: 8px;
  border: 1px solid rgba(255, 180, 120, .35);
  background: rgba(255, 140, 60, .08);
  color: #ffc9a0;
  cursor: pointer;
  letter-spacing: .02em;
}
.btn-human-mode:hover { background: rgba(255, 140, 60, .16); }
.btn-human-mode.active {
  border-color: rgba(120, 255, 180, .45);
  background: rgba(80, 220, 140, .14);
  color: #b8f5d8;
  box-shadow: 0 0 12px rgba(80, 220, 140, .12);
}
.human-mode-suppressed { display: none !important; }
.human-mode-panel textarea {
  min-height: 220px;
  font-size: .88rem;
  line-height: 1.45;
}
.human-depth-card { margin-top: 4px; }
.human-depth-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 8px;
}
.human-depth-row input[type='range'] { flex: 1; min-width: 0; }
.human-depth-edge { font-size: .72rem; color: var(--muted); font-weight: 700; }
.human-depth-row strong { min-width: 2rem; text-align: right; font-variant-numeric: tabular-nums; }
.human-depth-band {
  margin: 0 0 4px;
  font-size: .92rem;
  font-weight: 800;
  color: #9ee8c8;
}
.human-depth-legend {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  font-size: .76rem;
  color: var(--muted);
}
.human-depth-legend b { color: #d8e2f8; }
.human-camp-card .human-camp-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.human-camp-mode-btn.active {
  background: linear-gradient(135deg, var(--accent-strong), #7898ff);
  color: #fff;
  border-color: transparent;
}
.human-camp-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #1a2e1a;
  background: rgba(120, 220, 140, .85);
  vertical-align: middle;
}
.human-camp-badge.hidden { display: none !important; }
.top-field-listen input:disabled {
  opacity: .95;
  cursor: not-allowed;
  border-color: rgba(120, 220, 140, .35);
}

.ai-pool-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin: 0 0 14px;
  padding: 4px 0 2px;
}
.ai-pool-total {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .01em;
  min-width: 6.5rem;
  color: var(--text);
}
.ai-pool-provider-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}
.ai-pool-pbtn {
  padding: 10px 16px !important;
  font-size: .92rem !important;
  font-weight: 700;
  border-radius: 12px;
  min-height: 42px;
}
.ai-pool-pbtn strong {
  margin-left: 6px;
  font-size: 1rem;
  opacity: .95;
}
.ai-pool-pbtn.active {
  border-color: rgba(91, 141, 239, .7);
  background: rgba(91, 141, 239, .18);
}
.ai-pool-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
  align-items: center;
}
.ai-pool-add input {
  min-width: 180px;
  flex: 1;
}
.ai-pool-provider-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 140px;
}
.ai-pool-site-btn {
  height: 28px;
  padding: 0 10px;
  font-size: .72rem;
}
.ai-pool-key-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 280px;
  min-width: 0;
}
.ai-pool-key-wrap input { flex: 1; min-width: 0; }
.ai-pool-paste-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  background: #c0122a;
  color: #fff;
  font-weight: 800;
  letter-spacing: .04em;
  text-shadow: 0 0 8px #ff2a44, 0 0 16px rgba(255, 20, 50, .9);
  box-shadow: 0 0 10px rgba(255, 30, 50, .55), 0 0 22px rgba(255, 0, 40, .35);
  border: 1px solid #ff3348;
}
.ai-pool-paste-btn:hover { background: #e01832; }
.ai-pool-add-err { width: 100%; color: #ff8a96; font-weight: 700; }
.ai-pool-list { display: flex; flex-direction: column; gap: 8px; }
.ai-pool-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 10px;
  background: rgba(15, 23, 42, .35);
}
.ai-pool-row.status-resting { border-color: rgba(250, 204, 21, .35); }
.ai-pool-row.status-invalid,
.ai-pool-row.status-expired { border-color: rgba(248, 113, 113, .4); }
.ai-pool-row-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  flex: 1;
}
.ai-pool-mask { font-family: ui-monospace, monospace; font-size: .85rem; color: #94a3b8; }
.ai-pool-status {
  font-size: .78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, .12);
  color: #6ee7b7;
}
.ai-pool-row.status-resting .ai-pool-status {
  background: rgba(250, 204, 21, .12);
  color: #fde68a;
}
.ai-pool-row.status-invalid .ai-pool-status,
.ai-pool-row.status-expired .ai-pool-status {
  background: rgba(248, 113, 113, .12);
  color: #fca5a5;
}
.ai-pool-err { color: #fca5a5; max-width: 100%; }
.ai-pool-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-pool-row-actions [data-pool-help] {
  border-color: rgba(96, 165, 250, .45);
  color: #bfdbfe;
}

.call-names-mini {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  margin: 0;
  min-width: 108px;
  max-width: 140px;
}
.call-names-mini span {
  font-size: .62rem;
  opacity: .85;
}
.call-names-mini input {
  font-size: .8rem;
  padding: 4px 8px;
  height: 32px;
  box-sizing: border-box;
  width: 100%;
}
input.handle-resolved {
  border-color: #46b46e !important;
  color: #b8f5d0;
}
.license-assign-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.license-assign-row input[type='number'] { width: 4.5rem; }
.macro-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}
.macro-add-row input { flex: 1; min-width: 90px; }
.macros-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}
.macros-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
  margin: 0;
}
.macros-mini input[type='number'] {
  width: 3.25rem;
  min-width: 3.25rem;
  flex: none;
  padding: 6px 6px;
}
.macros-name {
  width: 7.2rem;
  min-width: 6rem;
  flex: 0 0 7.2rem;
}
.macros-text { flex: 1; min-width: 140px; }
.macros-search {
  width: min(100%, 240px);
  margin-top: 8px;
}
.macros-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.macro-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.macro-row code { font-size: .82rem; min-width: 4.5rem; }
.macro-row input[type='number'] { width: 4.2rem; }
.macro-row input[data-cmd-text],
.macro-row input[data-tmr-text] { flex: 1; min-width: 140px; }


/* —— WhatsApp tema: kartlar, modaller, formlar —— */
.yt-card, .channel-admins, .system-key-card {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface-2) !important;
  box-shadow: none !important;
}
.yt-card-label { color: var(--accent) !important; font-weight: 600 !important; }
.gate {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--surface-2) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.4) !important;
}
.howto-panel {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--surface-2) !important;
}
.howto-backdrop { background: rgba(11, 20, 26, .85) !important; }
.live-strip {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface-2) !important;
  box-shadow: none !important;
}
.live-strip-chip { background: var(--surface-3) !important; border-color: var(--line) !important; }
.saved-flash {
  border-color: rgba(37, 211, 102, .4) !important;
  background: rgba(0, 168, 132, .15) !important;
  color: #d9fdd3 !important;
}
.license-req-card {
  border-color: rgba(233, 167, 0, .45) !important;
  background: rgba(233, 167, 0, .1) !important;
}
.license-req-sent {
  color: #d9fdd3 !important;
  background: rgba(0, 168, 132, .16) !important;
  border-color: rgba(0, 168, 132, .4) !important;
}
input, select, textarea {
  background: var(--surface-3) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
}
.switch input:checked + span,
.master-switch input:checked + span { color: var(--good) !important; }
.out { background: var(--surface) !important; border-color: var(--line) !important; }
.ai-pool-row { border-color: var(--line) !important; background: var(--surface-3) !important; }
.ai-pool-pbtn.active { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
.unsaved-banner { color: var(--warn) !important; }
.brand p { font-size: .75rem; color: var(--muted); }
.top-right .btn { border-radius: 20px; }
#loginGate { background: var(--wa-chat-bg); }
.guest-channel-lock { background: rgba(11, 20, 26, .88) !important; }

/* —— RSK Bot teması (rskbot.com) —— */
html[data-theme="rskbot"] {
  --bg: #070b14;
  --surface: #0d1324;
  --surface-2: #141d34;
  --surface-3: #1c2844;
  --line: #2a3a62;
  --text: #eef2ff;
  --muted: #8fa3d4;
  --accent: #8b5cf6;
  --accent-strong: #6d28d9;
  --accent-soft: rgba(139, 92, 246, .18);
  --link: #c4b5fd;
  --good: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --wa-header: linear-gradient(135deg, #121a32 0%, #1a1040 100%);
  --wa-panel: #0d1324;
  --wa-chat-bg: #070b14;
}

html[data-theme="rskbot"] body {
  background-color: var(--wa-chat-bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(139, 92, 246, .14), transparent 55%),
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(59, 130, 246, .1), transparent 50%),
    linear-gradient(180deg, #070b14 0%, #0a1020 100%);
}

html[data-theme="rskbot"] .top {
  background: linear-gradient(135deg, #121a32 0%, #1a1040 100%);
  border-bottom-color: rgba(139, 92, 246, .25);
  box-shadow: 0 2px 18px rgba(109, 40, 217, .15);
}

html[data-theme="rskbot"] .side-rail,
html[data-theme="rskbot"] .main-workspace,
html[data-theme="rskbot"] .card {
  border-color: rgba(139, 92, 246, .12);
}

html[data-theme="rskbot"] .btn:not(.secondary):not(.danger) {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  border-color: rgba(167, 139, 250, .35);
  color: #fff;
}

html[data-theme="rskbot"] .btn:not(.secondary):not(.danger):hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(124, 58, 237, .35);
}

html[data-theme="rskbot"] .nav-item.active,
html[data-theme="rskbot"] .channel-sidebar-item.active {
  background: var(--accent-soft);
  border-color: rgba(139, 92, 246, .35);
  color: #e9d5ff;
}

html[data-theme="rskbot"] .logo-img {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, .45), 0 4px 16px rgba(109, 40, 217, .25);
}

html[data-theme="rskbot"] code {
  color: #ddd6fe;
  background: rgba(139, 92, 246, .14);
}

html[data-theme="rskbot"] .brand-crop-frame {
  border-color: rgba(139, 92, 246, .5);
}

html[data-theme="rskbot"] .guest-channel-lock {
  background: rgba(7, 11, 20, .9) !important;
  border: 1px solid rgba(139, 92, 246, .2);
}

html[data-theme="rskbot"] h1#brandTitleText {
  background: linear-gradient(90deg, #e9d5ff, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

