:root {
  --bg: #f3f5f7;
  --surface: #fff;
  --surface-soft: #f8fafb;
  --ink: #24303d;
  --soft: #72808f;
  --line: #dfe5eb;
  --accent: #60788f;
  --accent-dark: #465f76;
  --accent-soft: #eaf0f5;
  --danger: #b65353;
  --shadow: rgba(30, 45, 60, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(145deg, #f5f7f9, #eef2f5);
  overflow-x: hidden;
}
.wash {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.7;
}
.wash-one {
  width: 520px;
  height: 520px;
  background: #dbe8f2;
  right: -180px;
  top: -210px;
}
.wash-two {
  width: 440px;
  height: 440px;
  background: #e8edf2;
  left: -190px;
  bottom: -190px;
}
.hidden {
  display: none !important;
}
.kicker {
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 8px;
}
.language {
  border: 1px solid var(--line);
  background: #ffffffcc;
  color: var(--ink);
  border-radius: 999px;
  min-width: 42px;
  padding: 8px 10px;
  font: 700 10px inherit;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.language.floating {
  position: fixed;
  right: 28px;
  top: 24px;
  z-index: 5;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
  position: relative;
}
.login-card {
  width: min(410px, 100%);
  background: #fffffff2;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 46px 44px;
  box-shadow: 0 24px 70px var(--shadow);
  position: relative;
}
.login-mark,
.app-mark {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #d8e2ea;
}
.login-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 26px;
  font-size: 18px;
}
.login-mark.small {
  margin: 0 auto 20px;
  width: 40px;
  height: 40px;
}
.app-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 14px;
}
.login-card h1 {
  font:
    600 32px/1.18 Inter,
    "Segoe UI",
    sans-serif;
  letter-spacing: -0.035em;
  margin: 10px 0 14px;
}
.lead {
  font-size: 14px;
  line-height: 1.65;
  color: var(--soft);
  margin-bottom: 30px;
}
label {
  display: grid;
  gap: 7px;
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 600;
  color: #536170;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  padding: 11px 12px;
  font: 13px inherit;
  outline: 0;
  transition: 0.2s;
}
textarea {
  resize: vertical;
  line-height: 1.55;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #8ca2b5;
  box-shadow: 0 0 0 3px #60788f16;
}
.primary,
.secondary {
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font: 700 11px inherit;
  letter-spacing: 0.02em;
  padding: 11px 15px;
  transition: 0.15s;
}
.primary {
  background: var(--accent);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.primary:hover {
  background: var(--accent-dark);
}
.primary.full {
  width: 100%;
  margin-top: 12px;
}
.primary.large {
  padding: 15px 18px;
}
.secondary {
  background: #fff;
  border: 1px solid #9aabba;
  color: var(--accent-dark);
}
.footnote,
.hint {
  font-size: 10px;
  color: #8a96a2;
  line-height: 1.5;
}
.footnote {
  text-align: center;
  margin: 18px 0 0;
}
.form-error {
  min-height: 18px;
  font-size: 10px;
  color: var(--danger);
  padding-top: 4px;
}
.app {
  display: grid;
  grid-template-columns: 218px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 28px 20px 22px;
  background: #f8fafbe6;
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}
.wordmark {
  display: flex;
  align-items: center;
  margin-bottom: 44px;
}
.sidebar nav {
  display: grid;
  gap: 4px;
}
.nav-item {
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  display: flex;
  gap: 11px;
  align-items: center;
  color: #6f7d8b;
  font: 600 11px inherit;
  cursor: pointer;
}
.nav-item i {
  font: normal 14px/1 Arial;
  color: #b4bec7;
}
.nav-item:hover,
.nav-item.active {
  color: var(--ink);
  background: #eaf0f5;
}
.nav-item.active i {
  color: var(--accent);
}
.sidebar-end {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.profile {
  display: flex;
  gap: 9px;
  align-items: center;
}
.profile > div:first-child {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.profile b,
.profile small {
  display: block;
}
.profile b {
  font-size: 11px;
}
.profile small {
  font-size: 9px;
  color: var(--soft);
  text-transform: uppercase;
}
.ink-button,
.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font: 600 11px inherit;
}
.workspace {
  padding: 36px clamp(26px, 5vw, 75px) 80px;
  max-width: 1500px;
  width: 100%;
  margin: auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.topbar h1 {
  font:
    600 29px Inter,
    "Segoe UI",
    sans-serif;
  letter-spacing: -0.03em;
  margin: 0;
}
.top-actions {
  display: flex;
  gap: 9px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.stat {
  background: #ffffffd9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  position: relative;
}
.stat:after {
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background: #9aabba;
  left: 20px;
  bottom: -1px;
}
.stat strong {
  font:
    600 28px Inter,
    "Segoe UI",
    sans-serif;
  letter-spacing: -0.03em;
  display: block;
}
.stat span {
  font-size: 10px;
  color: var(--soft);
}
.paper {
  position: relative;
  background: #ffffffdc;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 24px;
  box-shadow: 0 8px 28px #24303d08;
  margin-bottom: 12px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 12px;
}
.intro {
  display: flex;
  gap: 18px;
  align-items: center;
  background: linear-gradient(110deg, #fff, #f1f6f9);
}
.info-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font: 700 14px Inter, "Segoe UI", sans-serif;
}
.paper h2 {
  font:
    600 18px Inter,
    "Segoe UI",
    sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
}
.paper p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--soft);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.status {
  font-size: 9px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.status.good {
  color: #507464;
  border-color: #a8c0b5;
}
.table-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.row-title b,
.row-title small {
  display: block;
}
.row-title small {
  color: var(--soft);
  margin-top: 3px;
}
.badge {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--soft);
}
.badge.running,
.badge.completed,
.badge.active {
  color: #507464;
  border-color: #a8c0b5;
}
.badge.failed,
.badge.blocked,
.badge.disabled {
  color: var(--danger);
  border-color: #d9adad;
}
.actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}
.mini {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  padding: 5px 7px;
  font: 600 9px inherit;
  cursor: pointer;
  color: var(--ink);
}
.mini:hover {
  border-color: #9aabba;
  color: var(--accent-dark);
}
.empty-state {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.bot-placeholder {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.bot-settings {
  display: grid;
  gap: 22px;
}
.bot-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.bot-summary .badge {
  margin-left: auto;
}
.bot-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.button-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.test-form {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}
.test-form h3 {
  font-size: 13px;
  margin: 0 0 16px;
}
.test-form .primary:disabled {
  opacity: 0.55;
  cursor: wait;
}
.compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 12px;
}
.compose-side .paper {
  margin-bottom: 12px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tokens {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: -5px 0 18px;
}
.tokens button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font: 10px monospace;
  padding: 4px 7px;
  cursor: pointer;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
summary {
  font-size: 11px;
  cursor: pointer;
  margin-bottom: 15px;
}
.counter {
  font: 10px monospace;
  color: var(--soft);
}
.discord-preview {
  background: #313338;
  color: #dbdee1;
  border-radius: 9px;
  padding: 16px;
  display: flex;
  gap: 11px;
  min-height: 135px;
  font-family: Arial, sans-serif;
}
.bot-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #6d8295;
  color: #fff;
  font: 600 13px Inter;
}
.discord-preview b {
  font-size: 13px;
}
.bot-tag {
  font-size: 7px;
  background: #5865f2;
  padding: 2px 4px;
  margin-left: 5px;
  border-radius: 3px;
}
.discord-preview small {
  font-size: 8px;
  color: #949ba4;
  margin-left: 6px;
}
.discord-preview p {
  color: #dbdee1;
  font: 12px/1.5 Arial;
  margin: 5px 0;
  white-space: pre-wrap;
}
.preview-embed {
  border-left: 3px solid var(--accent);
  background: #2b2d31;
  padding: 10px;
  margin-top: 8px;
  max-width: 360px;
}
.preview-embed b {
  font-size: 12px;
}
.preview-embed p {
  margin: 4px 0;
}
.confirm {
  display: flex;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 10px;
  line-height: 1.5;
}
.confirm input,
.check input {
  width: auto;
}
.check {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 15px;
}
legend {
  font-size: 10px;
  color: var(--soft);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 0;
  width: min(450px, calc(100% - 30px));
  box-shadow: 0 25px 90px #24303d26;
}
dialog::backdrop {
  background: #25324066;
  backdrop-filter: blur(5px);
}
dialog form,
.secret-card {
  padding: 28px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 24px;
}
.modal-head button {
  border: 0;
  background: none;
  font-size: 24px;
  color: var(--soft);
  cursor: pointer;
}
.secret-card {
  text-align: center;
}
.secret-card code {
  display: block;
  padding: 14px;
  border: 1px dashed #9aabba;
  border-radius: 9px;
  background: var(--surface-soft);
  margin: 20px 0;
  font-size: 16px;
  user-select: all;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: #fff;
  padding: 13px 17px;
  border-radius: 9px;
  font-size: 11px;
  box-shadow: 0 12px 40px #0002;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s;
  z-index: 10;
}
.toast.show {
  opacity: 1;
  transform: none;
}
@media (max-width: 950px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    padding: 15px 20px;
  }
  .wordmark {
    margin: 0;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    justify-content: center;
  }
  .nav-item {
    white-space: nowrap;
  }
  .nav-item i {
    display: none;
  }
  .sidebar-end {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .profile {
    display: none;
  }
  .workspace {
    padding: 28px 20px;
  }
  .compose-grid,
  .split {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .sidebar {
    grid-template-columns: 1fr;
  }
  .wordmark,
  .sidebar-end {
    display: none;
  }
  .sidebar nav {
    justify-content: start;
  }
  .topbar {
    align-items: start;
  }
  .topbar .primary span {
    display: none;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .table-row {
    grid-template-columns: 1fr 0.7fr;
  }
  .table-row > *:nth-child(3) {
    display: none;
  }
  .login-page {
    padding: 15px;
  }
  .login-card {
    padding: 38px 28px;
  }
}
