:root {
  color-scheme: dark;
  --bg: #0c141b;
  --panel: #111b23;
  --panel-hover: #17232d;
  --border: #26323d;
  --text: #e8eef2;
  --muted: #a8b6c2;
  --control-border: #637783;
  --focus: #c5f66a;
  --warning-bg: #2c281c;
  --warning-text: #ead39a;
  --error-bg: #301e27;
  --error-text: #f5b0ba;
  --control-radius: 8px;
  --lime: #c5f66a;
  --green: #6ed5ad;
  --red: #ec8392;
  --radius: 12px;
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
button,input,select,textarea {
  font: inherit;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
:where(.table-scroll,.demo-bot-table,.demo-portfolio-position-table,#price-chart):focus-visible {
  outline-offset: -3px;
}
h1[tabindex="-1"]:focus,#main-content:focus {
  outline: none;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: .65;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
  border: 0;
  background: transparent;
}
h1,h2,p {
  margin: 0;
}
h1 {
  font-size: 32px;
  letter-spacing: -1.1px;
  line-height: 1.25;
  font-weight: 600;
}
h1>span {
  color: var(--lime);
}
h2 {
  font-size: 15px;
  font-weight: 600;
}
.muted {
  color: var(--muted);
}
.positive {
  color: var(--green)!important;
}
.negative {
  color: var(--red)!important;
}
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.icon-button {
  font-size: 20px;
  color: var(--muted);
  padding: 3px 7px;
}
.icon-button:hover {
  color: var(--lime);
}
.muted-line {
  border-color: #ad9a70;
  border-top-style: dashed;
  margin-left: 12px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.panel-heading h2 small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 7px;
}
.panel-heading>.muted {
  font-size: 12px;
}
.mini-badge {
  font-size: 12px;
  letter-spacing: 1px;
  color: #a3b0a5;
  padding: 4px 6px;
  border: 1px solid #334033;
  border-radius: 4px;
}
label {
  font-size: 12px;
  color: #a3b2bd;
  display: block;
  margin-bottom: 12px;
}
label>span {
  float: right;
  color: var(--muted);
  font-size: 12px;
}
input:not([type=checkbox]),textarea {
  display: block;
  width: 100%;
  min-width: 0;
  background: #0d171f;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  color: #dbe5ec;
  padding: 10px 11px;
  margin-top: 7px;
  font-size: 12px;
  transition: border .2s;
}
input:focus,textarea:focus {
  border-color: var(--focus);
}
input::-webkit-calendar-picker-indicator {
  opacity: .85;
}
input::-webkit-inner-spin-button {
  opacity: .3;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.section-divider {
  border-top: 1px solid var(--border);
  padding-top: 15px;
  margin: 11px 0 12px;
  font-size: 12px;
  letter-spacing: 1.1px;
  color: var(--muted);
}
.input-help {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 10px;
}
details {
  margin-top: 9px;
}
summary {
  cursor: pointer;
  color: #a9b7c0;
  font-size: 12px;
  padding: 10px 0;

}
details[open]>summary {
  margin-bottom: 8px;
}
details .field-row {
  margin-top: 5px;
}
.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.switch-label input {
  accent-color: var(--lime);
}
.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--lime);
  color: #192415;
  border: 1px solid var(--lime);
  font-weight: 650;
  border-radius: var(--control-radius);
  padding: 12px 16px;
  transition: background .2s;
}
.primary:hover {
  background: #d6ff8a;
}
.secondary {
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  padding: 8px 12px;
  color: #b7c6ce;
  font-size: 12px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.secondary:hover {
  background: var(--panel-hover);
  border-color: #748660;
}
.notice {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #334855;
  background: #182833;
  color: #a9c2d0;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.notice .icon-button {
  margin-left: auto;
}
.notice.warning {
  border-color: #574b2d;
  background: var(--warning-bg);
  color: var(--warning-text);
}
.notice.error {
  border-color: #603b45;
  background: var(--error-bg);
  color: var(--error-text);
}
.validation-errors {
  background: var(--error-bg);
  color: var(--error-text);
  padding: 9px;
  border-radius: var(--control-radius);
  font-size: 12px;
  line-height: 1.6;
}
.validation-errors p+p {
  margin-top: 5px;
}
.validation-errors button {
  color: var(--lime);
  text-decoration: underline;
  padding: 7px 0 0;
}
.empty-results {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px;
  margin-top: 20px;
  min-height: 110px;
}
.empty-results h2 {
  font-size: 14px;
  margin-bottom: 8px;
}
.empty-results p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.empty-results .outline-badge {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  border-color: #303d33;
}
.empty-icon {
  display: grid;
  place-items: center;
  border: 1px solid #3a4a38;
  color: var(--lime);
  font-size: 25px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #3e5140;
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {to{
transform:rotate(360deg)}}
.table-scroll {
  overflow: auto;
  max-width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
th {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px;
  border-bottom: 1px solid #1e2d38;
  color: #bccbd5;
}
td strong {
  color: #d2dee5;
  font-weight: 500;
}
td small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clickable {
  cursor: pointer;
}
.clickable:hover,tr.highlighted {
  background: #c5f66a07;
}
.direction {
  font-size: 12px;
  padding: 5px 6px;
  border-radius: 4px;
}
.direction.long {
  color: var(--green);
  background: #6ed5ad10;
}
.direction.short {
  color: var(--red);
  background: #ec839210;
}
.table-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 17px;
  color: var(--muted);
  font-size: 12px;
}
.table-footer>div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.table-footer button {
  color: #a1b58d;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  padding: 4px 8px;
}
.table-scroll input[type=checkbox] {
  accent-color: var(--lime);
  margin: 0;
}
@media(max-width:1200px) {
  h1 {
    font-size: 27px;
  }
  .empty-results .outline-badge {
    display: none;
  }
}
@media(max-width:760px) {
  h1 {
    font-size: 25px;
    letter-spacing: -.7px;
  }
  .empty-results {
    padding: 20px;
    gap: 14px;
  }
  .empty-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
  }
  .empty-results h2 {
    font-size: 12px;
  }
  .empty-results p {
    font-size: 12px;
  }
  td,th {
    padding: 12px;
    font-size: 12px;
  }
  th {
    font-size: 12px;
  }
  .table-footer {
    flex-wrap: wrap;
    font-size: 12px;
  }
  .notice {
    font-size: 12px;
    padding: 11px;
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto!important;
    animation: none!important;
    transition: none!important;
  }
}

/* Общие вспомогательные классы. */
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.settings-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(300px,520px));
  gap: 18px;
  align-items: start;
}
.settings-layout .settings-card {
  display: grid;
  gap: 12px;
}
.settings-layout fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
@media(max-width:760px) {
  .settings-layout {
    grid-template-columns: minmax(0,1fr);
  }
}
/* Выпадающие списки в полях форм выглядят как поля ввода. */
label>select {
  display: block;
  width: 100%;
  min-width: 0;
  background: #0d171f;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  color: #dbe5ec;
  padding: 9px 10px;
  margin-top: 7px;
  font-size: 12px;
}
label>select:focus {
  border-color: var(--focus);
}
/* Скрытые подписи внутри прокручиваемых таблиц не расширяют страницу. */
.table-scroll,.demo-table,.demo-bot-table {
  position: relative;
}

.notice,.validation-errors {
  overflow-wrap: anywhere;
}
.notice a,.input-help a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
fieldset {
  min-inline-size: 0;
}
.panel-heading {
  flex-wrap: wrap;
}
select {
  max-width: 100%;
}
input[aria-invalid="true"] {
  border-color: var(--red);
}
/* Страница управления биллингом. */
.billing-summary {
  display: grid;
  gap: 10px;
  max-width: 1058px;
  margin-bottom: 18px;
  padding: 18px 18px 15px;
}
.billing-summary .panel-heading {
  margin-bottom: 4px;
}
.billing-summary p {
  margin: 0;
}
.billing-state {
  font-size: 1.1rem;
  font-weight: 600;
}
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.checklist li::before {
  display: inline-block;
  width: 1.4em;
  font-weight: 700;
}
.checklist li.done::before {
  content: "✓";
  color: var(--green);
}
.checklist li.todo::before {
  content: "○";
  color: var(--muted);
}
.checklist li.warn::before {
  content: "!";
  color: var(--red);
}
.attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.attention-list li {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.attention-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.attention-list pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.settings-card h3 {
  margin: 6px 0 0;
  font-size: 1rem;
}
