:root {
  --ink: #111111;
  --paper: #fffdf5;
  --cream: #f7f1df;
  --yellow: #ffd93d;
  --blue: #70d6ff;
  --pink: #ff82b2;
  --green: #a8ef8b;
  --purple: #b8a1ff;
  --orange: #ffad5a;
  --red: #ff6b6b;
  --muted: #4d4d4d;
  --border: 3px solid var(--ink);
  --shadow: 7px 7px 0 var(--ink);
  --shadow-small: 4px 4px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--cream);
  background-image:
    linear-gradient(rgba(17,17,17,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,.055) 1px, transparent 1px);
  background-size: 28px 28px;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 12%, var(--yellow) 0 55px, transparent 57px),
    radial-gradient(circle at 93% 10%, var(--pink) 0 44px, transparent 46px),
    radial-gradient(circle at 88% 88%, var(--blue) 0 62px, transparent 64px);
  opacity: .45;
  z-index: -1;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
code {
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 2px 6px;
  font-weight: 800;
  word-break: break-all;
}

.sidebar {
  position: fixed;
  inset: 18px auto 18px 18px;
  width: 270px;
  padding: 20px;
  border: var(--border);
  background: var(--yellow);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand strong { display: block; font-size: 19px; letter-spacing: -.03em; }
.brand small { color: var(--muted); font-weight: 700; }
.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: var(--border);
  background: var(--blue);
  box-shadow: var(--shadow-small);
  font-weight: 950;
  font-size: 27px;
  transform: rotate(-3deg);
}
.brand-mark.small { width: 46px; height: 46px; font-size: 22px; }
.sidebar nav { display: grid; gap: 11px; flex: 1; }
.sidebar nav a {
  padding: 12px 14px;
  border: 2px solid transparent;
  font-weight: 900;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--paper);
  border-color: var(--ink);
  box-shadow: var(--shadow-small);
  transform: translate(-2px, -2px);
}

.content { margin-left: 310px; padding: 28px 28px 46px; max-width: 1700px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 7px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: .98;
  letter-spacing: -.05em;
}
h2 { margin-bottom: 0; font-size: 22px; line-height: 1.1; }
.hero-text { margin: 0; color: var(--muted); line-height: 1.55; font-weight: 700; }
.eyebrow {
  display: inline-block;
  margin: 0 0 9px;
  padding: 5px 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero-card {
  padding: 28px;
  border: var(--border);
  background: var(--paper);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute;
  width: 88px;
  height: 88px;
  right: 24px;
  bottom: -42px;
  border: var(--border);
  background: var(--purple);
  transform: rotate(18deg);
}
.status-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: var(--border);
  background: var(--green);
  box-shadow: var(--shadow-small);
  font-weight: 900;
  z-index: 1;
}
.status-dot {
  width: 13px;
  height: 13px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
}
.status-dot.online { background: #2dd66f; }
.status-dot.offline { background: var(--red); }

.grid { display: grid; gap: 18px; }
.cards { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 18px; }
.split { grid-template-columns: 1.25fr .75fr; margin-bottom: 18px; }
.card {
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
}
.metric {
  min-height: 152px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.metric:nth-child(1) { background: var(--green); }
.metric:nth-child(2) { background: var(--blue); }
.metric:nth-child(3) { background: var(--yellow); }
.metric:nth-child(4) { background: var(--purple); }
.metric:nth-child(5) { background: var(--orange); }
.metric:nth-child(6) { background: var(--pink); }
.metric::after {
  content: "";
  position: absolute;
  width: 55px;
  height: 55px;
  right: -23px;
  bottom: -23px;
  border: 3px solid var(--ink);
  background: rgba(255,255,255,.45);
  transform: rotate(18deg);
}
.metric span, .metric small { font-weight: 800; }
.metric small { color: #333; }
.metric strong { margin: auto 0 5px; font-size: 30px; letter-spacing: -.04em; }
.section-card, .split > .card { padding: 22px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.badge {
  border: 2px solid var(--ink);
  background: var(--yellow);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 3px 3px 0 var(--ink);
}
.badge.ok { background: var(--green); }

.bar-chart { min-height: 220px; display: flex; align-items: end; gap: 12px; padding: 22px 4px 0; }
.bar-item { flex: 1; min-width: 25px; display: grid; gap: 8px; align-items: end; height: 200px; text-align: center; font-size: 11px; font-weight: 900; }
.bar {
  width: 100%;
  min-height: 5px;
  border: 2px solid var(--ink);
  background: var(--blue);
  position: relative;
}
.bar-item:nth-child(2n) .bar { background: var(--pink); }
.bar-item:nth-child(3n) .bar { background: var(--yellow); }
.bar-item:nth-child(4n) .bar { background: var(--purple); }
.bar em { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 950; }
.rank-list, .item-list, .error-list, .jobs { display: grid; gap: 11px; }
.rank {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}
.rank b { width: 29px; height: 29px; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--yellow); }
.rank:nth-child(2n) b { background: var(--blue); }
.rank:nth-child(3n) b { background: var(--pink); }
.item, .error-item, .job {
  padding: 13px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}
.item strong, .item small, .error-item strong, .error-item small { display: block; }
.item small, .error-item small, .job small { margin-top: 6px; color: var(--muted); word-break: break-word; }
.error-item { background: #fff0f2; border-left-width: 7px; }
.error-item code { display: block; margin-top: 9px; padding: 9px; white-space: pre-wrap; word-break: break-word; background: #fff; }
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); }
table { width: 100%; border-collapse: collapse; min-width: 940px; background: #fff; }
th, td { padding: 13px 11px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); text-align: left; font-size: 13px; vertical-align: top; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
th { background: var(--yellow); font-weight: 950; }
td small { color: var(--muted); word-break: break-word; }
.status-label { display: inline-flex; padding: 5px 8px; border: 2px solid var(--ink); background: #eee; font-size: 11px; font-weight: 950; }
.status-label.success { background: var(--green); }
.status-label.failed, .status-label.denied, .status-label.limit { background: var(--pink); }
.status-label.received, .status-label.queued { background: var(--orange); }

.stack { display: grid; gap: 14px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 950; }
input, select, textarea {
  width: 100%;
  border: var(--border);
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
  box-shadow: 3px 3px 0 var(--ink);
}
input:focus, select:focus, textarea:focus { background: #fffbe5; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
textarea { resize: vertical; }
button, .ghost, .primary, .danger {
  border: var(--border);
  padding: 11px 15px;
  color: var(--ink);
  font-weight: 950;
  box-shadow: var(--shadow-small);
  transition: transform .12s ease, box-shadow .12s ease;
}
button:hover, .ghost:hover, .primary:hover, .danger:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
button:active, .ghost:active, .primary:active, .danger:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.primary { background: var(--green); }
.ghost { display: inline-block; background: #fff; text-align: center; }
.danger { background: var(--red); }
.full { width: 100%; display: block; }
.center { text-align: center; }
.danger-zone { padding: 22px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; background: #ffe6e6; }
.danger-zone p:last-child, .public-note p { margin-bottom: 0; color: var(--muted); line-height: 1.7; font-weight: 700; }
.public-note { background: #eaffdf; }
.alert { padding: 13px 15px; margin-bottom: 18px; border: var(--border); background: var(--green); box-shadow: var(--shadow-small); font-weight: 900; }
.alert.error { background: var(--pink); }
.hidden { display: none; }
.empty { color: var(--muted); padding: 20px 0; text-align: center; font-weight: 800; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card { width: min(450px, 100%); padding: 32px; border: var(--border); background: var(--paper); box-shadow: 10px 10px 0 var(--ink); }
.login-card .brand-mark { margin-bottom: 24px; }
.login-card p { color: var(--muted); line-height: 1.65; font-weight: 700; }
.public-link { display: inline-block; margin-bottom: 20px; padding: 7px 9px; border: 2px solid var(--ink); background: var(--yellow); font-weight: 900; box-shadow: 3px 3px 0 var(--ink); }
.helper { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 14px 0 0; font-weight: 700; }
.job strong, .job small { display: block; }
.job.failed { background: #ffe0e5; }
.job.completed { background: #e2ffd6; }
.job.running, .job.queued { background: #fff4c6; }

@media (max-width: 1250px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 920px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    margin: 14px;
    flex-direction: row;
    align-items: center;
    padding: 14px 16px;
    overflow-x: auto;
  }
  .brand { margin: 0 20px 0 0; min-width: max-content; }
  .sidebar nav { display: flex; flex: 1; }
  .sidebar nav a { white-space: nowrap; }
  .sidebar form, .sidebar > .ghost { display: none; }
  .content { margin-left: 0; padding: 14px 14px 38px; }
  .split { grid-template-columns: 1fr; }
  .hero-card { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .topbar, .danger-zone { align-items: flex-start; flex-direction: column; }
  .metric { min-height: 128px; padding: 15px; }
  .metric strong { font-size: 25px; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .hero-card, .section-card, .split > .card { padding: 18px; }
  h1 { font-size: 34px; }
  .status-wrap { width: 100%; }
}

.hero-actions { display: flex; align-items: center; gap: 14px; z-index: 2; }
.session-picker {
  min-width: 220px;
  padding: 9px 11px;
  border: var(--border);
  background: var(--yellow);
  box-shadow: var(--shadow-small);
}
.session-picker select { margin-top: 5px; padding: 8px 10px; box-shadow: none; border-width: 2px; }
.compact { padding: 8px 11px; border-width: 2px; box-shadow: 3px 3px 0 var(--ink); font-size: 12px; }
.session-manager { margin-bottom: 18px; background: #fff8cf; }
.create-bot-panel { margin-bottom: 20px; padding: 18px; border: var(--border); background: var(--blue); box-shadow: var(--shadow-small); }
.create-bot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.create-bot-grid .check-label { display: flex; align-items: center; gap: 9px; min-height: 49px; }
.check-label input { width: 22px; height: 22px; padding: 0; box-shadow: 2px 2px 0 var(--ink); }
.session-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.session-card { padding: 16px; border: var(--border); background: #fff; box-shadow: var(--shadow-small); }
.session-card:nth-child(3n+1) { background: #f0ffdf; }
.session-card:nth-child(3n+2) { background: #e4f7ff; }
.session-card:nth-child(3n) { background: #fff0f6; }
.session-card.selected { outline: 5px solid var(--purple); outline-offset: -7px; transform: rotate(-.3deg); }
.session-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.session-card h3 { margin: 3px 0 0; font-size: 20px; line-height: 1.05; }
.session-card small { font-weight: 850; color: var(--muted); }
.session-identity { min-height: 36px; margin: 15px 0 10px; font-weight: 800; word-break: break-all; }
.session-flags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.session-flags span { padding: 4px 7px; border: 2px solid var(--ink); background: var(--yellow); font-size: 10px; font-weight: 950; }
.session-status { padding: 6px 8px; border: 2px solid var(--ink); background: var(--red); font-size: 10px; font-weight: 950; box-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
.session-status.online { background: var(--green); }
.session-status.waiting { background: var(--orange); }
.session-error { margin: 8px 0; padding: 8px; border: 2px solid var(--ink); background: #ffdce4; font-size: 11px; font-weight: 800; }
.session-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pairing-dialog { width: min(520px, calc(100% - 28px)); border: 4px solid var(--ink); background: var(--paper); box-shadow: 10px 10px 0 var(--ink); padding: 28px; }
.pairing-dialog::backdrop { background: rgba(17,17,17,.72); }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; padding: 0; background: var(--pink); font-size: 25px; line-height: 1; }
.pairing-content { min-height: 290px; display: grid; place-items: center; align-content: center; gap: 13px; text-align: center; margin: 20px 0; padding: 18px; border: var(--border); background: var(--blue); }
.pairing-content small { color: var(--muted); font-weight: 800; }
.qr-image { width: min(340px, 100%); border: var(--border); background: #fff; padding: 8px; box-shadow: var(--shadow-small); image-rendering: pixelated; }
.pairing-code { padding: 18px 22px; border: 4px solid var(--ink); background: var(--yellow); box-shadow: var(--shadow); font-size: clamp(30px, 8vw, 48px); font-weight: 950; letter-spacing: .12em; }
.pairing-success { padding: 20px; border: var(--border); background: var(--green); box-shadow: var(--shadow); font-size: 20px; font-weight: 950; }
.pairing-loader { width: 56px; height: 56px; border: 7px solid var(--ink); border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1250px) {
  .session-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .create-bot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .hero-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .session-picker { width: 100%; min-width: 0; }
}
@media (max-width: 640px) {
  .session-grid, .create-bot-grid { grid-template-columns: 1fr; }
  .session-card-head { flex-direction: column; }
  .pairing-dialog { padding: 20px; }
}

.session-manager-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.session-manager-actions .danger{white-space:nowrap}
@media(max-width:640px){.session-manager-actions{width:100%}.session-manager-actions button{flex:1}}

.account-login-card { width: min(500px, 100%); }
.captcha-box { display: grid; place-items: center; gap: 8px; padding: 14px; border: var(--border); background: var(--blue); box-shadow: 5px 5px 0 var(--ink); }
.captcha-box svg { width: min(100%, 240px); height: auto; display: block; }
.captcha-box small { font-weight: 900; }
.otp-input { text-align: center; font-size: 28px; font-weight: 950; letter-spacing: .32em; }
.auth-switch { margin-top: 18px; padding-top: 16px; border-top: 3px dashed var(--ink); font-weight: 800; }
.auth-switch a { color: inherit; text-decoration: underline; text-decoration-thickness: 3px; }
.sidebar-auth { display: grid; gap: 10px; }
.pairing-actions { display: grid; gap: 8px; margin-top: 12px; text-align: center; }
.pairing-actions small { font-weight: 800; }
.pairing-actions button[disabled] { opacity: .65; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }
.session-flags { flex-wrap: wrap; }

.wide-auth-card { width: min(560px, 100%); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 17px; }
.auth-links a { padding: 8px 10px; border: 2px solid var(--ink); background: var(--blue); box-shadow: 3px 3px 0 var(--ink); font-size: 12px; font-weight: 950; }
label small { color: var(--muted); font-weight: 750; line-height: 1.45; }

.payment-section { margin-bottom: 18px; background: #e8f7ff; }
.payment-credit { min-width: 130px; padding: 10px 14px; border: var(--border); background: var(--yellow); box-shadow: var(--shadow-small); text-align: center; }
.payment-credit span, .payment-credit strong { display: block; }
.payment-credit span { font-size: 11px; font-weight: 900; }
.payment-credit strong { font-size: 28px; line-height: 1; }
.payment-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; border: var(--border); background: var(--green); box-shadow: var(--shadow-small); margin-bottom: 16px; }
.payment-intro div { display: grid; gap: 4px; }
.payment-intro strong { font-size: clamp(24px, 4vw, 38px); line-height: 1; }
.payment-intro span { font-weight: 850; }
.payment-list { display: grid; gap: 11px; }
.payment-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px; border: 3px solid var(--ink); background: #fff; box-shadow: 4px 4px 0 var(--ink); }
.payment-item.pending { background: #fff7c8; }
.payment-item.paid { background: #e6ffd8; }
.payment-item.expired, .payment-item.failed, .payment-item.cancelled { background: #ffe2e8; }
.payment-item > div:first-child { display: grid; gap: 4px; }
.payment-item strong { font-size: 20px; }
.payment-item small, .payment-item span { font-weight: 800; }
.payment-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.payment-content { min-height: 310px; display: grid; place-items: center; align-content: center; gap: 13px; text-align: center; margin: 20px 0; padding: 18px; border: var(--border); background: var(--yellow); }
.payment-content > strong { font-size: 28px; }
.payment-content > small { font-weight: 850; line-height: 1.5; }
.payment-qr { width: min(300px, 100%); aspect-ratio: 1; object-fit: contain; border: var(--border); background: #fff; box-shadow: var(--shadow-small); }
.payment-success { padding: 20px; border: var(--border); background: var(--green); box-shadow: var(--shadow); font-size: 22px; font-weight: 950; }
.payment-dialog .pairing-actions a { display: block; }

@media (max-width: 640px) {
  .payment-intro, .payment-item { align-items: stretch; flex-direction: column; }
  .payment-intro button { width: 100%; }
  .payment-item-actions { justify-content: flex-start; }
  .auth-links a { width: 100%; text-align: center; }
}
