:root {
  --ink: #20231e;
  --muted: #62675f;
  --canvas: #f6f7f2;
  --paper: #fff;
  --line: #dce0d6;
  --acid: #d7f775;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #347138;
  outline-offset: 3px;
}
.skip {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 2;
  padding: .6rem;
  color: var(--ink);
  background: white;
  transform: translateY(-200%);
}
.skip:focus { transform: translateY(0); }
.wrap { width: min(100% - 64px, 1060px); margin-inline: auto; }
.site-head { background: #20241f; color: #fff; }
.head-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-tile {
  width: 27px;
  height: 27px;
  background: var(--acid);
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.brand-tile i {
  width: 18px;
  height: 13px;
  background: #252a20;
  clip-path: polygon(0 0, 24% 0, 33% 60%, 42% 15%, 60% 15%, 70% 60%, 79% 0, 100% 0, 80% 100%, 61% 100%, 51% 60%, 42% 100%, 21% 100%);
}
.brand-word { font-weight: 800; font-size: 17px; letter-spacing: -.06em; }
.brand-product { margin-left: 5px; padding-left: 15px; border-left: 1px solid #64695e; font-size: 14px; color: #e2e7dd; }
.logout { border: 0; background: transparent; color: #e9ece3; font-size: 14px; padding: 9px 0 9px 12px; }
.logout span { margin-left: 4px; color: var(--acid); }
.logout:hover, .quiet-link:hover, .back:hover, .refresh:hover { text-decoration: underline; }
.site-head :focus-visible { outline-color: var(--acid); }
.main { padding-block: clamp(36px, 6.5vw, 76px) 70px; }
h1, h2, p, dl, dd, fieldset { margin: 0; }
h1 { font-size: clamp(32px, 4.3vw, 53px); line-height: 1.06; font-weight: 680; letter-spacing: -.055em; }
h2 { font-size: 23px; line-height: 1.25; letter-spacing: -.035em; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 31px; }
.page-head h1 { display: flex; align-items: center; gap: 14px; }
.count {
  font-size: 17px;
  letter-spacing: 0;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 100px;
  min-width: 35px;
  height: 31px;
  padding-inline: 9px;
  display: grid;
  place-items: center;
  background: #edf0e7;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 620;
  line-height: 1.2;
  text-decoration: none;
}
.button:hover { text-decoration: none; }
.primary { background: var(--acid); color: #20281b; border-color: #bbd96b; }
.primary:hover { background: #cbed64; border-color: #9bb954; }
.plus { font-size: 22px; line-height: .8; font-weight: 430; }
.secondary { background: white; color: var(--ink); border-color: #c9cec2; }
.secondary:hover { background: #f1f4ec; }
.small { min-height: 38px; padding: 8px 13px; font-size: 13px; }
.empty, .bot-card, .editor, .login-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.empty { min-height: 310px; display: grid; justify-items: center; align-content: center; text-align: center; gap: 9px; padding: 34px; }
.empty p, .subtle, .help p { color: var(--muted); line-height: 1.55; font-size: 15px; }
.empty p { max-width: 420px; }
.empty-icon { position: relative; width: 52px; height: 47px; margin-bottom: 9px; }
.empty-icon i, .empty-icon b { position: absolute; display: block; width: 37px; height: 32px; border: 2px solid #444e38; border-radius: 8px; }
.empty-icon i { top: 3px; right: 2px; background: var(--acid); }
.empty-icon b { left: 3px; top: 11px; background: #fafcf7; }
.empty-icon b::before, .empty-icon b::after { content: ""; position: absolute; top: 11px; width: 4px; height: 5px; border-radius: 2px; background: #444e38; }
.empty-icon b::before { left: 9px; }
.empty-icon b::after { right: 9px; }
.bot-list, .stack, .choices { display: grid; }
.bot-list { gap: 12px; }
.bot-card { overflow: hidden; }
.bot-head, .bot-foot { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.bot-head { flex-wrap: wrap; }
.bot-foot { border-top: 1px solid #e6e9e1; }
.identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.bot-name { min-width: 0; overflow-wrap: anywhere; }
.bot-name h2 { font-size: 19px; margin-bottom: 4px; }
.bot-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: #eff3e9; font-size: 23px; font-weight: 600; }
.bot-mark.btc { color: #875111; background: #fbf0dd; border-color: #efddbd; }
.handle { font-size: 13px; text-decoration: none; color: var(--muted); }
.state { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; line-height: 1.3; border-radius: 999px; padding: 5px 10px; background: #f0f1ed; color: #535953; }
.state i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.state-online { background: #e6f4df; color: #306432; }
.state-starting, .state-offline { background: #fbf0d8; color: #7a5817; }
.state-error { background: #fae9e5; color: #9b4132; }
.metrics { display: flex; flex-wrap: wrap; gap: 16px clamp(22px, 5vw, 66px); }
.metrics dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.metrics dd { font-size: 14px; }
.bot-error { margin: 0; background: #fff3ef; padding: 10px 24px; color: #853e32; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.back, .refresh, .quiet-link { display: inline-flex; align-items: center; gap: 8px; color: #495044; font-size: 14px; text-decoration: none; }
.back { margin-bottom: 19px; }
.refresh { margin-top: 21px; }
.add-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(230px, 1fr); gap: clamp(26px, 4.5vw, 60px); align-items: start; }
.stack { gap: 25px; }
.editor, .login-card { padding: clamp(22px, 3vw, 34px); }
.field { display: grid; gap: 8px; min-width: 0; }
.field label, legend { font-size: 15px; font-weight: 650; }
.field input, .field select {
  background: #fff;
  border: 1px solid #bcc4b6;
  padding: 12px 13px;
  border-radius: 7px;
  color: var(--ink);
  min-width: 0;
  width: 100%;
}
.field input::placeholder { color: #737a6d; }
.field small, .choice small { color: var(--muted); font-size: 13px; line-height: 1.4; }
fieldset { padding: 0; border: 0; min-width: 0; }
legend { margin-bottom: 10px; padding: 0; }
.choices { gap: 7px; }
.choice { display: flex; align-items: flex-start; cursor: pointer; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.choice:has(input:checked) { background: #f2f6e7; border-color: #93a575; }
.choice input { flex: none; width: 17px; height: 17px; margin: 1px 0 0; accent-color: #495f27; }
.choice b { display: block; font-size: 14px; }
.choice small { display: block; margin-top: 3px; }
.form-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; padding-top: 4px; }
.help { padding: 18px 0 0; border-top: 2px solid #b1bc9f; }
.help h2 { font-size: 20px; }
.help ol { margin: 15px 0; padding-left: 24px; }
.help li { padding-left: 4px; margin-bottom: 8px; font-size: 14px; line-height: 1.55; }
.help p { font-size: 13px; }
code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .92em; background: #e8ecdf; padding: 1px 4px; border-radius: 4px; }
.login-layout { max-width: 430px; }
.login-card { margin-top: 2vh; }
.login-card h1 { font-size: 36px; margin-bottom: 11px; }
.login-card .stack { margin-top: 28px; }
.login-card .button { justify-self: start; }
.notice { border: 1px solid #cbd8bd; border-radius: 8px; padding: 13px 16px; margin: 0 0 20px; background: #eaf4e1; color: #344b30; line-height: 1.45; font-size: 14px; overflow-wrap: anywhere; }
.notice-error { background: #fff1ec; color: #8c3d2f; border-color: #e4c8bf; }
@media (max-width: 720px) {
  .wrap { width: calc(100% - 36px); }
  .add-grid { grid-template-columns: 1fr; }
  .bot-foot { align-items: flex-start; }
  .metrics { gap: 14px 23px; }
  .bot-head, .bot-foot { padding: 16px; }
  .brand-product { padding-left: 10px; margin-left: 0; }
  .head-inner { min-height: 59px; }
  .main { padding-top: 35px; }
  .help { margin-top: 0; }
}
@media (max-width: 480px) {
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 21px; gap: 14px; }
  .head-inner { gap: 5px; }
  .brand { gap: 7px; }
  .brand-word { font-size: 15px; }
  .brand-product, .logout { font-size: 13px; }
  .bot-head { align-items: flex-start; gap: 12px; }
  .bot-foot { flex-direction: column; gap: 15px; }
  .brand-tile { width: 24px; height: 24px; }
  .empty { min-height: 280px; padding: 23px; }
  .form-foot { gap: 12px; }
}
.site-nav { display: flex; gap: 4px; margin-left: 16px; margin-right: auto; }
.site-nav a { color: #e8eddf; font-size: 14px; font-weight: 530; text-decoration: none; padding: 8px 12px; border-radius: 6px; }
.site-nav a:hover { background: #343a30; }
.site-nav a[aria-current] { background: #414739; color: #ecfccb; }
@media (max-width: 660px) {
  .head-inner:has(.site-nav) .brand-product { display: none; }
  .site-nav { margin-left: 0; gap: 2px; }
  .site-nav a { font-size: 13px; padding: 8px; }
}
@media (max-width: 370px) {
  .head-inner:has(.site-nav) { flex-wrap: wrap; gap: 2px 8px; padding: 9px 0; }
  .head-inner:has(.site-nav) .site-nav { order: 3; width: 100%; }
}

.telegram-intro { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 760px; margin: -8px 0 24px; }
.field select { font: inherit; font-size: 16px; }
.bot-source { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 10px; padding: 0 24px 17px; font-size: 14px; }
.bot-source > span { color: var(--muted); }
.bot-source a { font-weight: 600; overflow-wrap: anywhere; }
.source-version { padding: 2px 5px; background: #f1f4ec; border-radius: 4px; }
.telegram-link-editor { padding: 14px 24px; border-top: 1px solid var(--line); }
.telegram-link-editor summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.link-form { display: flex; align-items: flex-start; gap: 15px; margin-top: 18px; }
.link-form .field { flex: 1; }
.link-form .button { margin-top: 27px; white-space: nowrap; }
.empty .button { margin-top: 20px; }
@media (max-width: 720px) {
  .bot-source { padding: 0 16px 16px; }
  .telegram-link-editor { padding: 14px 16px; }
  .link-form { flex-direction: column; }
  .link-form .field { width: 100%; }
  .link-form .button { margin-top: 0; }
}
