[v-cloak] {
  display: none;
}

:root {
  --app-bg: #f5f0e8;
  --app-surface: rgba(255, 252, 245, 0.92);
  --app-surface-strong: #fffaf0;
  --app-ink: #17231d;
  --app-muted: #68766e;
  --app-line: rgba(81, 69, 50, 0.16);
  --app-accent: #246b55;
  --app-accent-dark: #174f3e;
  --app-accent-soft: #dceee6;
  --app-gold: #b7791f;
  --app-radius: 18px;
  --app-shadow: 0 1.15rem 2.5rem rgba(39, 35, 27, 0.1);
}

html {
  background: var(--app-bg);
}

body {
  min-height: 100vh;
  color: var(--app-ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(36, 107, 85, 0.18), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(183, 121, 31, 0.14), transparent 24rem),
    linear-gradient(135deg, #f7f0e4 0%, #edf4ee 52%, #f9f4ea 100%);
}

.app-shell {
  padding-top: 1.5rem;
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: 1rem;
  align-items: stretch;
  padding: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 252, 245, 0.96), rgba(232, 244, 237, 0.9)),
    linear-gradient(135deg, rgba(36, 107, 85, 0.12), transparent);
  box-shadow: var(--app-shadow);
}

.app-hero .title,
.app-hero .subtitle {
  color: var(--app-ink);
}

.app-eyebrow,
.app-step-label {
  color: var(--app-accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-auth-card {
  align-self: stretch;
  padding: 1rem;
  border: 1px solid var(--app-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.box,
.app-card {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: 0 0.75rem 1.75rem rgba(39, 35, 27, 0.075);
}

.app-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-tabs ul {
  border: 0;
  gap: 0.45rem;
}

.app-tabs a {
  border: 1px solid var(--app-line) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.64);
  color: var(--app-muted);
  font-weight: 700;
}

.app-tabs li.is-active a {
  border-color: var(--app-accent) !important;
  background: var(--app-accent);
  color: #fff;
}

.button {
  border-radius: 999px;
  font-weight: 700;
}

.button.is-primary {
  border-color: var(--app-accent);
  background-color: var(--app-accent);
}

.button.is-primary:hover {
  border-color: var(--app-accent-dark);
  background-color: var(--app-accent-dark);
}

.button.is-link.is-light {
  color: var(--app-accent-dark);
  background-color: var(--app-accent-soft);
}

.input,
.textarea,
.select select {
  border-color: var(--app-line);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.input:focus,
.textarea:focus,
.select select:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 0.12rem rgba(36, 107, 85, 0.14);
}

.label {
  color: var(--app-ink);
  font-size: 0.82rem;
}

.help,
.has-text-grey {
  color: var(--app-muted) !important;
}

.app-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(32rem, calc(100vw - 2rem));
  margin: 0;
  z-index: 30;
  box-shadow: 0 0.5rem 1.25rem rgba(10, 10, 10, 0.18);
}

.telegram-widget-box {
  min-height: 56px;
}

.app-strategy-list {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.app-strategy-card {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--app-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.app-strategy-card:hover {
  border-color: rgba(36, 107, 85, 0.38);
  box-shadow: 0 0.6rem 1.2rem rgba(39, 35, 27, 0.08);
  transform: translateY(-1px);
}

.app-strategy-card.is-selected {
  border-color: var(--app-accent);
  background: linear-gradient(135deg, rgba(220, 238, 230, 0.92), rgba(255, 255, 255, 0.82));
}

.app-strategy-card:focus {
  outline: none;
  box-shadow: 0 0 0 0.16rem rgba(36, 107, 85, 0.18);
}

.app-strategy-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
}

.app-strategy-card-head .button {
  flex: 0 0 auto;
}

.app-card-title {
  display: block;
  flex: 1;
  min-width: 0;
  color: var(--app-ink);
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.app-meta-row {
  display: block;
  color: var(--app-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.app-empty-state {
  padding: 1rem;
  border: 1px dashed rgba(81, 69, 50, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.app-action-panel {
  padding: 1rem;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(249, 245, 235, 0.82));
}

.app-capital-callout {
  display: grid;
  gap: 0.1rem;
  padding: 0.8rem 0.9rem;
  border-left: 4px solid var(--app-accent);
  border-radius: 14px;
  background: var(--app-accent-soft);
}

.app-capital-callout span,
.app-capital-callout small {
  color: var(--app-muted);
  font-size: 0.75rem;
}

.app-capital-callout strong {
  color: var(--app-accent-dark);
  font-size: 1.35rem;
}

.app-button-row {
  gap: 0.45rem;
}

.app-dsl-column {
  display: flex;
  flex-direction: column;
}

.app-dsl-field {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.app-dsl-control {
  display: flex;
  flex: 1;
}

.app-dsl {
  min-height: 30rem;
  height: 100%;
  flex: 1;
  resize: vertical;
  color: #10201a;
  font-size: 0.86rem;
  line-height: 1.5;
  background:
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)),
    repeating-linear-gradient(0deg, transparent, transparent 1.45rem, rgba(36, 107, 85, 0.05) 1.45rem, rgba(36, 107, 85, 0.05) 1.5rem);
}

.app-chart-host {
  min-height: 28rem;
}

.app-result-box {
  padding: 1rem 1.25rem;
}

.app-metric-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.app-metric-grid p {
  line-height: 1.2;
}

.app-metric-grid > div,
.app-metric-grid > p {
  padding: 0.65rem;
  border: 1px solid rgba(81, 69, 50, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.app-pnl-chart-host {
  min-height: 4.5rem;
}

.app-live-chart-host {
  min-height: 24rem;
}

.app-live-trade-history {
  max-height: 28rem;
  overflow: auto;
}

.app-live-trade-history thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--app-surface-strong);
}

.app-json {
  margin: 0;
  max-height: 32rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: #17231d;
  color: #dceee6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.table {
  background: transparent;
}

.table thead th {
  border-color: var(--app-line);
  color: var(--app-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table td,
.table th {
  border-color: rgba(81, 69, 50, 0.12);
}

.notification {
  border-radius: 16px;
}

.tag {
  border-radius: 999px;
  font-weight: 700;
}

@media screen and (max-width: 768px) {
  .app-shell {
    padding: 0.75rem;
  }

  .app-hero {
    grid-template-columns: 1fr;
    padding: 1rem;
    border-radius: 22px;
  }

  .app-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-toast {
    right: 0.75rem;
    bottom: 0.75rem;
    width: calc(100vw - 1.5rem);
  }

  .app-dsl {
    min-height: 22rem;
  }

  .app-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
