html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(51, 118, 255, 0.2), transparent 24%),
    radial-gradient(circle at 85% 18%, rgba(39, 198, 151, 0.12), transparent 18%),
    linear-gradient(180deg, #07111f 0%, #030813 100%);
  color: #e6edf7;
}

a { color: #9bc0ff; text-decoration: none; }
label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; color: #98a8c2; }
input, select, textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid #24334c;
  background: #10192a;
  color: #eaf0ff;
}
button { cursor: pointer; }

.app-frame {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
}

.shell-guest .app-frame {
  grid-template-columns: 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #0a1322 0%, #0b1020 100%);
  border-right: 1px solid #1d2940;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
  overflow: hidden;
}

.brand { display: flex; gap: 0.9rem; align-items: center; }
.brand-mark {
  width: 14px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3ea6ff 0%, #42e695 100%);
}
.shell-admin .brand-mark { background: linear-gradient(180deg, #ff8e63 0%, #ff4f7a 100%); }
.brand h1 { margin: 0; font-size: 1rem; }
.brand p { margin: 0.15rem 0 0; color: #8092b4; font-size: 0.82rem; }

.nav-links { display: flex; flex-direction: column; gap: 0.45rem; }
.nav-links a {
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  color: #b4c0d8;
  background: transparent;
}
.nav-links a:hover { background: #121d31; color: #ffffff; }

.sidebar-footer { margin-top: auto; display: grid; gap: 0.8rem; }
.pill-link { display: inline-flex; width: fit-content; }
.logout-form { margin: 0; }

.content {
  padding: 2rem;
  background: radial-gradient(circle at top, rgba(49,91,181,0.12), transparent 32%), transparent;
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}
.content-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 100vh;
  overflow-y: auto;
}

.shell-guest .content {
  padding: 0;
}

.login-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030712;
}

.login-shell {
  width: min(100%, 24rem);
  padding: 2rem 1rem;
}

.login-brand {
  margin-bottom: 2rem;
  text-align: center;
}

.login-brand h1 {
  margin: 0;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
}

.login-brand p {
  margin: 0.25rem 0 0;
  color: #9ca3af;
  font-size: 0.875rem;
}

.login-card {
  padding: 1rem;
  border: 1px solid #1f2937;
  border-radius: 0.75rem;
  background: #111827;
}

.login-card h2 {
  margin: 0 0 1.5rem;
  color: #f3f4f6;
  font-size: 1.125rem;
  font-weight: 600;
}

.login-meta {
  margin: -0.75rem 0 1rem;
  color: #9ca3af;
  font-size: 0.875rem;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form-spaced {
  margin-top: 1.25rem;
}

.login-info {
  padding: 1rem;
  border: 1px solid rgba(6, 78, 59, 0.65);
  border-radius: 1rem;
  background: rgba(6, 78, 59, 0.25);
  color: #d1fae5;
  font-size: 0.875rem;
  line-height: 1.5;
}

.login-field label {
  display: block;
  margin-bottom: 0.25rem;
  color: #9ca3af;
  font-size: 0.75rem;
}

.login-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  background: #1f2937;
  color: #f3f4f6;
  font-size: 0.875rem;
}

.login-field input:focus {
  outline: none;
  border-color: #2563eb;
}

.login-field input::placeholder {
  color: #9ca3af;
}

.login-button {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 160ms ease;
}

.login-button:hover {
  background: #1d4ed8;
}

.login-button-secondary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  color: #e5e7eb;
  text-decoration: none;
}

.login-button-secondary:hover {
  background: #374151;
}

.login-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-card__error {
  margin: 0;
  color: #f87171;
  font-size: 0.875rem;
}

.login-qr-wrap {
  display: flex;
  justify-content: center;
}

.login-qr {
  display: block;
  width: 176px;
  height: 176px;
  padding: 8px;
  border-radius: 0.75rem;
  background: #ffffff;
  box-sizing: border-box;
}

.login-secret-box {
  padding: 1rem;
  border: 1px solid #374151;
  border-radius: 0.75rem;
  background: #0f172a;
  text-align: center;
}

.login-secret-box span {
  display: block;
  color: #9ca3af;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-secret-box strong {
  display: block;
  margin-top: 0.4rem;
  color: #f3f4f6;
  font-size: 1rem;
  letter-spacing: 0.14em;
  word-break: break-all;
}

.login-help {
  margin: 0;
  color: #9ca3af;
  font-size: 0.875rem;
  text-align: center;
}

.auth-card, .card, .table-card {
  background: rgba(12, 20, 35, 0.92);
  border: 1px solid #1c2a44;
  border-radius: 1.25rem;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
}

.auth-card {
  width: min(440px, 100%);
  padding: 2rem;
  backdrop-filter: blur(18px);
}
.auth-card-admin { border-color: #5c2735; }
.auth-card-centered {
  width: min(520px, calc(100vw - 2rem));
}
.auth-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}
.auth-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 440px);
  gap: 2rem;
  align-items: center;
  margin: 0 auto;
}
.auth-layout-admin {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
}
.auth-hero {
  padding: 1rem 1rem 1rem 0;
}
.auth-kicker {
  display: inline-block;
  margin-bottom: 1.1rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(115, 150, 214, 0.25);
  border-radius: 999px;
  background: rgba(10, 19, 34, 0.55);
  color: #b7c9eb;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.auth-hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.6rem, 4vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}
.auth-copy {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #a7bbde;
}
.auth-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.auth-highlight {
  padding: 1.15rem;
  border: 1px solid rgba(92, 117, 168, 0.2);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(12, 20, 35, 0.78), rgba(6, 11, 22, 0.55));
}
.auth-highlight strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.auth-highlight span {
  color: #98aecd;
  line-height: 1.55;
  font-size: 0.92rem;
}
.auth-card-header {
  margin-bottom: 1.4rem;
}
.auth-card-header-centered {
  text-align: center;
}
.auth-card-header h2 {
  margin: 0.5rem 0 0.45rem;
  font-size: 2rem;
  letter-spacing: -0.03em;
}
.auth-card-header h1 {
  margin: 0.8rem 0 0.45rem;
  font-size: clamp(2.2rem, 6vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.auth-badge {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(37, 113, 255, 0.16);
  color: #9fc0ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-badge-admin {
  background: rgba(181, 61, 94, 0.16);
  color: #ffb2c1;
}
.auth-footer-note {
  margin-top: 1rem;
  text-align: center;
}
.auth-subcopy {
  margin: 0.7rem 0 0;
}
.auth-flow-note {
  margin-bottom: 1rem;
}
.auth-qr-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}
.auth-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  min-height: 220px;
  max-width: 100%;
  border-radius: 1rem;
  border: 1px solid #ffffff;
  background: #ffffff;
  padding: 0.9rem;
  box-sizing: border-box;
}
.auth-qr svg {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  margin: 0 auto;
}
.auth-qr svg path {
  fill: #000000;
}
.auth-secret-box {
  padding: 0.95rem 1rem;
  border: 1px solid #22324b;
  border-radius: 0.9rem;
  background: rgba(8, 14, 25, 0.72);
}
.auth-secret-box strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1rem;
  letter-spacing: 0.12em;
  word-break: break-all;
}

.card, .table-card { padding: 1.35rem; margin-bottom: 1.4rem; }
.table-card { overflow: auto; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.3rem;
}
.page-header h2, .card h3 { margin: 0 0 0.35rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.stat-card span {
  color: #8ea0bf;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-card strong {
  display: block;
  font-size: 1.9rem;
  margin-top: 0.55rem;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.strategy-panel {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid #1d2940;
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(10, 19, 34, 0.7), rgba(8, 14, 25, 0.92));
}
.strategy-panel h4 {
  margin: 0;
  font-size: 1rem;
}
.strategy-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.signal-mtm-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.strategy-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.checkbox-input {
  width: auto;
}
.leg-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #24334c;
  border-radius: 1rem;
  background: rgba(7, 14, 25, 0.82);
}
.leg-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.leg-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.leg-delete-flag {
  display: none;
}
.tb-panel {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid #232f46;
  border-radius: 1.15rem;
  background: linear-gradient(180deg, rgba(16, 24, 39, 0.94), rgba(12, 18, 30, 0.96));
}
.tb-section-title p {
  margin: 0;
  color: #8ea0bf;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tb-section-title span {
  display: block;
  margin-top: 0.35rem;
  color: #7f93b8;
  font-size: 0.83rem;
}
.tb-grid {
  display: grid;
  gap: 0.85rem;
}
.tb-strategy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tb-setup-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tb-entry-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tb-two-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tb-overall-grid {
  grid-template-columns: 1.2fr 1fr;
}
.tb-signal-shell {
  border: 1px solid #1f2b40;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(11, 17, 30, 0.98), rgba(8, 13, 24, 0.98));
  overflow: hidden;
}
.tb-signal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid #1c273a;
  cursor: pointer;
}
.tb-signal-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.tb-signal-title h4 {
  margin: 0;
  font-size: 0.96rem;
}
.tb-signal-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #4fe18b;
}
.tb-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(28, 96, 58, 0.35);
  color: #8bf0b6;
  font-size: 0.74rem;
  font-weight: 700;
}
.tb-signal-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.tb-switch {
  position: relative;
  width: 2.8rem;
  height: 1.45rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #2d3a52;
}
.tb-switch.is-on {
  background: #2458d6;
}
.tb-switch span {
  position: absolute;
  top: 0.15rem;
  left: 0.18rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #ffffff;
  transform: translateX(1.3rem);
}
.tb-chevron {
  padding: 0;
  border: 0;
  background: transparent;
  color: #8ca0c5;
  font-size: 1.2rem;
}
.tb-signal-body {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}
.tb-signal-body.is-collapsed {
  display: none;
}
.tb-legs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.tb-leg-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #263348;
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(9, 15, 26, 0.92), rgba(12, 18, 31, 0.96));
}
.tb-leg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.tb-leg-number {
  color: #94a8cb;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tb-remove-button {
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(181, 61, 94, 0.25);
  border-radius: 0.8rem;
  background: rgba(181, 61, 94, 0.08);
  color: #f4b9c7;
}
.tb-leg-stack {
  display: grid;
  gap: 1rem;
}
.tb-leg-top-grid {
  grid-template-columns: 1.35fr 0.8fr 0.85fr 1fr;
}
.tb-inline-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 0.6rem;
}
.tb-three-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tb-toggle-block {
  display: grid;
  gap: 0.65rem;
}
.tb-offset-guide {
  padding: 0.7rem 0.9rem;
  border: 1px solid #243146;
  border-radius: 0.9rem;
  background: rgba(6, 12, 22, 0.6);
  color: #7f93b8;
  font-size: 0.76rem;
}
.tb-offset-guide span {
  color: #d6e2fa;
}
.tb-selection-field {
  display: none;
}
.tb-value-group {
  display: grid;
}
.tb-product-field {
  display: block;
}
.tb-days-grid ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tb-days-grid label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}
.tb-days-grid input {
  width: auto;
}
.full-row { grid-column: 1 / -1; }
.stack { display: grid; gap: 1rem; }
.inline-toolbar, .inline-form { display: grid; gap: 0.8rem; }
.inline-form p { margin: 0.5rem 0; }
.actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-header-top { align-items: flex-start; gap: 1rem; }
.card-header-top .pill { margin-top: 0.1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
}
.btn-block { width: 100%; }
.btn-primary { background: #1d68f2; color: white; }
.btn-secondary { background: #22324f; color: #dbe7ff; }
.btn-warning { background: #7f5e12; color: #fff8de; }
.btn-danger { background: #b53d5e; color: #fff2f5; }

.muted { color: #8ba0c4; }
.small { font-size: 0.8rem; }
.field-error { color: #ff9da8; font-size: 0.84rem; margin-top: 0.25rem; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.pill-success { background: rgba(45, 156, 104, 0.18); color: #7ceeb5; }
.pill-warning { background: rgba(190, 144, 28, 0.2); color: #ffd36b; }
.pill-danger { background: rgba(194, 50, 83, 0.2); color: #ffa2b3; }

.messages { display: grid; gap: 0.6rem; margin-bottom: 1rem; }
.message {
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid #1f2b44;
  background: #111a2b;
}
.message-success { border-color: #27563e; }
.message-error { border-color: #5c2735; }

.auth-card .errorlist {
  margin: 0 0 0.2rem;
  padding: 0;
  list-style: none;
  color: #ff9da8;
  font-size: 0.86rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.95rem 0.7rem; text-align: left; border-bottom: 1px solid #182438; vertical-align: top; }
th { color: #90a1c0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.strategies-page,
.strategy-form-page {
  display: grid;
  gap: 1.5rem;
}

.strategies-toolbar,
.strategy-form-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.strategies-title,
.strategy-form-toolbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.strategy-card-list {
  display: grid;
  gap: 0.85rem;
}

.tb-form-shell {
  padding: 0.5rem 0 1rem;
}

.tb-form-wrap {
  width: min(48rem, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

.tb-topbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.tb-topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.tb-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #94a3b8;
}

.tb-page-stack {
  display: grid;
  gap: 1.25rem;
}

.tb-source-card {
  padding: 1rem;
  border: 1px solid #1f2937;
  border-radius: 0.95rem;
  background: #111827;
}

.tb-source-card-inner {
  border-radius: 1rem;
  background: linear-gradient(180deg, #111827 0%, rgba(17, 24, 39, 0.78) 100%);
}

.tb-source-card h2 {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #d1d5db;
}

.tb-source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1f2937;
}

.tb-source-header h2 {
  margin: 0;
}

.tb-source-header-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.tb-source-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #fbbf24;
}

.tb-source-chevron {
  color: #6b7280;
  font-size: 0.95rem;
}

.tb-subheading p {
  margin: 0;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tb-subheading span {
  display: block;
  margin-top: 0.25rem;
  color: #9ca3af;
  font-size: 0.78rem;
}

.tb-source-grid {
  display: grid;
  gap: 0.9rem;
}

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

.tb-source-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tb-controls-grid {
  grid-template-columns: 1.15fr 0.9fr 1fr;
}

.tb-label {
  display: block;
  margin-bottom: 0.35rem;
  color: #9ca3af;
  font-size: 0.74rem;
}

.tb-source-card input,
.tb-source-card select,
.tb-source-card textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.65rem;
  border: 1px solid #374151;
  background: #1f2937;
  color: #f3f4f6;
  font-size: 0.9rem;
}

.tb-source-card input[type="checkbox"] {
  width: auto;
  min-height: auto;
  padding: 0;
}

.tb-legs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tb-source-leg {
  padding: 1rem;
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 1rem;
  background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #111827 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.tb-source-leg-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tb-leg-remove {
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: #6b7280;
  font-size: 0.78rem;
}

.tb-leg-remove:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
}

.tb-leg-grid {
  grid-template-columns: 2fr 1fr 1fr 1fr;
}

.tb-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: #d1d5db;
  font-size: 0.9rem;
}

.tb-source-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.tb-days-grid ul {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tb-days-grid label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border: 1px solid #1f2937;
  border-radius: 0.85rem;
  background: rgba(3, 7, 18, 0.4);
  color: #9ca3af;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.tb-days-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tb-days-grid label:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.6);
  background: rgba(37, 99, 235, 0.15);
  color: #ffffff;
}

.strategy-editor {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1.4rem;
}

.strategy-editor__header h1 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
}

.strategy-editor__header p {
  margin: 0.45rem 0 0;
  max-width: 44rem;
  color: #8ea0bf;
}

.strategy-editor__back {
  display: inline-flex;
  align-items: center;
  color: #9fc0ff;
  font-size: 0.9rem;
}

.strategy-editor__form {
  display: grid;
  gap: 1.25rem;
}

.strategy-section {
  padding: 1.25rem;
  border: 1px solid #1c2a44;
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(14, 22, 37, 0.96), rgba(9, 15, 28, 0.98)),
    radial-gradient(circle at top right, rgba(46, 141, 255, 0.08), transparent 28%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

.strategy-section__title h2 {
  margin: 0;
  font-size: 1rem;
}

.strategy-section__title p {
  margin: 0.35rem 0 0;
  color: #8092b4;
  font-size: 0.84rem;
}

.strategy-section__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.strategy-grid {
  display: grid;
  gap: 0.9rem;
}

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

.strategy-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strategy-grid--leg-top {
  grid-template-columns: 1.35fr 1fr 0.9fr 1fr;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  color: #9fb0cd;
  font-size: 0.78rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.72rem 0.82rem;
  box-sizing: border-box;
  border: 1px solid #2b3955;
  border-radius: 0.9rem;
  background: #121b2c;
  color: #edf4ff;
  font-size: 0.92rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #4f8cff;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.14);
}

.weekday-picker ul {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.weekday-picker label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border: 1px solid #263551;
  border-radius: 0.95rem;
  background: #0f1728;
  color: #9aaed0;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.weekday-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-picker label:has(input:checked) {
  border-color: rgba(62, 166, 255, 0.55);
  background: rgba(29, 104, 242, 0.18);
  color: #ffffff;
}

.strategy-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(62, 166, 255, 0.28);
  border-radius: 0.9rem;
  padding: 0.72rem 1rem;
  background: rgba(29, 104, 242, 0.12);
  color: #9bc0ff;
  font-weight: 600;
}

.strategy-leg-list {
  display: grid;
  gap: 1rem;
}

.strategy-leg {
  padding: 1rem;
  border: 1px solid #25334c;
  border-radius: 1.05rem;
  background: linear-gradient(180deg, rgba(8, 14, 25, 0.95), rgba(12, 18, 31, 0.98));
  display: grid;
  gap: 0.95rem;
}

.strategy-leg__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.strategy-leg__eyebrow {
  color: #8ba0c4;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.strategy-leg__remove {
  border: 1px solid rgba(181, 61, 94, 0.22);
  border-radius: 0.75rem;
  padding: 0.45rem 0.7rem;
  background: rgba(181, 61, 94, 0.08);
  color: #f3b2c0;
}

.strategy-selection-field {
  display: none;
}

.strategy-selection-field label {
  display: block;
  margin-bottom: 0.35rem;
  color: #9fb0cd;
  font-size: 0.78rem;
  font-weight: 600;
}

.strategy-offset-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #233149;
  border-radius: 0.9rem;
  background: rgba(7, 12, 22, 0.68);
  color: #8397bb;
  font-size: 0.77rem;
}

.strategy-offset-guide span {
  color: #d9e5fa;
}

.strategy-inline-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 0.6rem;
}

.strategy-inline-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.strategy-toggle-block {
  display: grid;
  gap: 0.65rem;
}

.strategy-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #dbe7ff;
}

.strategy-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.strategy-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.strategy-studio {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.strategy-studio__hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid rgba(31, 42, 68, 0.95);
  border-radius: 1.1rem;
  background:
    radial-gradient(circle at top right, rgba(73, 145, 255, 0.16), transparent 26%),
    radial-gradient(circle at bottom left, rgba(73, 217, 172, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(14, 21, 36, 0.98), rgba(8, 13, 25, 0.99));
}

.strategy-studio__hero-copy h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.strategy-studio__hero-copy p {
  max-width: 44rem;
  margin: 0.45rem 0 0;
  color: #9ab0d4;
  font-size: 0.84rem;
  line-height: 1.45;
}

.strategy-studio__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #9cc0ff;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.strategy-studio__hero-badge {
  min-width: 135px;
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(53, 72, 113, 0.8);
  border-radius: 0.85rem;
  background: rgba(11, 17, 31, 0.72);
  text-align: right;
}

.strategy-studio__hero-badge span {
  display: block;
  color: #7f95bb;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.strategy-studio__hero-badge strong {
  display: block;
  margin-top: 0.25rem;
  color: #f1f6ff;
  font-size: 0.94rem;
}

.strategy-studio__form {
  display: grid;
  gap: 0.9rem;
}

.studio-card {
  padding: 1rem;
  border: 1px solid #1c2942;
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(12, 20, 35, 0.96), rgba(9, 15, 28, 0.98)),
    radial-gradient(circle at top right, rgba(63, 106, 194, 0.08), transparent 28%);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.16);
}

.studio-card__heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.studio-card__kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.55rem;
  background: linear-gradient(180deg, rgba(49, 104, 212, 0.35), rgba(31, 61, 120, 0.2));
  color: #dfeaff;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.studio-card__heading h2 {
  margin: 0;
  font-size: 0.9rem;
}

.studio-card__heading p {
  margin: 0.22rem 0 0;
  color: #8195b8;
  font-size: 0.74rem;
  line-height: 1.4;
}

.studio-card__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.studio-stack {
  display: grid;
  gap: 0.8rem;
}

.studio-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #22314b;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(10, 17, 30, 0.88), rgba(8, 13, 24, 0.92));
}

.studio-section-title h3 {
  margin: 0;
  color: #dce8fb;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.studio-grid {
  display: grid;
  gap: 0.7rem;
}

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

.studio-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.studio-grid--leg {
  grid-template-columns: 1.35fr 1.05fr 0.9fr 1fr;
}

.studio-field {
  min-width: 0;
}

.studio-field--full {
  grid-column: 1 / -1;
}

.studio-field--span-2 {
  grid-column: span 2;
}

.studio-static-field {
  min-height: 2.65rem;
  height: 2.65rem;
  display: flex;
  align-items: center;
  padding: 0.55rem 0.72rem;
  border: 1px solid #2a3a58;
  border-radius: 0.72rem;
  background: rgba(12, 19, 31, 0.72);
  color: #c9d8f2;
  font-size: 0.78rem;
}

.studio-static-field--inputlike {
  background: linear-gradient(180deg, #111b2d 0%, #0e1625 100%);
  color: #eef4ff;
}

.studio-static-field--compact {
  justify-content: center;
  min-width: 4.6rem;
  font-weight: 700;
}

.studio-field label,
.studio-selection-field label {
  display: block;
  margin-bottom: 0.28rem;
  color: #9fb0cd;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.studio-field input,
.studio-field select,
.studio-field textarea,
.studio-selection-field input,
.studio-selection-field select,
.studio-selection-field textarea {
  width: 100%;
  min-height: 2.65rem;
  height: 2.65rem;
  padding: 0.55rem 0.72rem;
  box-sizing: border-box;
  border: 1px solid #2a3a58;
  border-radius: 0.72rem;
  background: linear-gradient(180deg, #111b2d 0%, #0e1625 100%);
  color: #eef4ff;
  font-size: 0.8rem;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.studio-field select,
.studio-selection-field select {
  appearance: none;
  background-image:
    linear-gradient(180deg, rgba(17, 27, 45, 0.98), rgba(14, 22, 37, 0.98)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.5 5.25L7 8.75L10.5 5.25' stroke='%239fb0cd' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: center, right 0.85rem center;
  background-size: auto, 0.8rem;
  padding-right: 2.1rem;
}

.studio-field input:focus,
.studio-field select:focus,
.studio-field textarea:focus,
.studio-selection-field input:focus,
.studio-selection-field select:focus,
.studio-selection-field textarea:focus {
  outline: none;
  border-color: #4f8cff;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.14);
  background: #13203a;
}

.studio-field input[type="checkbox"],
.studio-check input[type="checkbox"] {
  appearance: none;
  width: 0.95rem;
  height: 0.95rem;
  min-height: auto;
  padding: 0;
  border: 1px solid #35507f;
  border-radius: 0.35rem;
  background: linear-gradient(180deg, #0d1626, #0a121f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.studio-field input[type="checkbox"]:checked,
.studio-check input[type="checkbox"]:checked {
  border-color: #4f8cff;
  background:
    linear-gradient(180deg, #3a86ff, #2262da);
  box-shadow:
    inset 0 0 0 2px #f7fbff,
    0 8px 18px rgba(34, 98, 218, 0.28);
}

.studio-weekdays ul,
.studio-weekdays .checkbox-group {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.studio-weekdays .checkbox-group > div {
  min-width: 0;
}

.studio-weekdays label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  border: 1px solid #243651;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #0e1728, #0b1422);
  color: #9db1d4;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.studio-weekdays input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.studio-weekdays label::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.studio-weekdays label:has(input:checked) {
  border-color: rgba(62, 166, 255, 0.55);
  background: linear-gradient(180deg, rgba(34, 97, 212, 0.32), rgba(27, 64, 136, 0.25));
  color: #ffffff;
  transform: translateY(-1px);
}

.studio-add-leg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(61, 152, 255, 0.28);
  border-radius: 0.78rem;
  padding: 0.62rem 0.88rem;
  background: linear-gradient(180deg, rgba(47, 109, 231, 0.3), rgba(29, 74, 164, 0.16));
  color: #cfe1ff;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 26px rgba(10, 18, 33, 0.28);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.studio-add-leg:hover {
  background: linear-gradient(180deg, rgba(47, 109, 231, 0.28), rgba(29, 74, 164, 0.18));
  border-color: rgba(91, 171, 255, 0.42);
  transform: translateY(-1px);
}

.studio-legs {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.studio-leg {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #25344e;
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at top right, rgba(81, 121, 219, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(8, 14, 25, 0.96), rgba(11, 18, 31, 0.98));
}

.studio-leg__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.studio-leg__tag {
  display: inline-flex;
  align-items: center;
  color: #8da4ca;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.studio-leg__remove {
  border: 1px solid rgba(181, 61, 94, 0.22);
  border-radius: 0.68rem;
  padding: 0.42rem 0.68rem;
  background: linear-gradient(180deg, rgba(181, 61, 94, 0.12), rgba(115, 32, 56, 0.08));
  color: #f0b8c5;
  font-weight: 600;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.studio-leg__remove:hover {
  background: linear-gradient(180deg, rgba(181, 61, 94, 0.18), rgba(115, 32, 56, 0.12));
  border-color: rgba(225, 116, 146, 0.34);
  transform: translateY(-1px);
}

.studio-selection-field {
  display: none;
}

.studio-selection-field--default {
  display: block;
}

.studio-offset-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem 0.68rem;
  border: 1px solid #22324b;
  border-radius: 0.75rem;
  background: rgba(7, 13, 23, 0.72);
  color: #8497ba;
  font-size: 0.68rem;
}

.studio-offset-guide span {
  color: #dce8fb;
}

.studio-inline {
  display: grid;
  gap: 0.45rem;
  align-items: start;
}

.studio-inline--2 {
  grid-template-columns: 1.25fr 0.9fr;
}

.studio-inline--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.studio-switch {
  display: grid;
  gap: 0.5rem;
}

.studio-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.studio-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.65rem;
  padding: 0.65rem 0.78rem;
  border: 1px solid #233754;
  border-radius: 0.78rem;
  background: linear-gradient(180deg, rgba(11, 18, 31, 0.94), rgba(8, 14, 24, 0.98));
  color: #d9e6fb;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.studio-check:hover {
  border-color: #365685;
  transform: translateY(-1px);
}

.studio-check:has(input:checked) {
  border-color: rgba(79, 140, 255, 0.46);
  background:
    radial-gradient(circle at top right, rgba(79, 140, 255, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(18, 31, 57, 0.98), rgba(9, 17, 31, 0.98));
  box-shadow: 0 14px 28px rgba(5, 10, 20, 0.22);
}

.strategy-studio__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.strategy-studio__actions .btn {
  min-width: 9.5rem;
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: 0.78rem;
  padding: 0.62rem 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 28px rgba(5, 10, 20, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.strategy-studio__actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(5, 10, 20, 0.24);
}

.strategy-studio__actions .btn-primary {
  background: linear-gradient(180deg, #3d8bff, #1d68f2);
  border-color: rgba(124, 180, 255, 0.32);
  color: #ffffff;
}

.strategy-studio__actions .btn-secondary {
  background: linear-gradient(180deg, rgba(29, 43, 69, 0.98), rgba(21, 31, 49, 0.98));
  border-color: #2b3f61;
  color: #dbe7ff;
}

.tb-back-link {
  width: 1.75rem;
  height: 1.75rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 1.1rem;
}

.tb-source-card {
  border-radius: 0.75rem;
}

.tb-source-card-inner {
  border: 1px solid #1f2937;
  background: linear-gradient(180deg, rgba(17, 24, 39, 1) 0%, rgba(17, 24, 39, 0.72) 100%);
}

.tb-source-card h2 {
  font-size: 0.92rem;
}

.tb-subheading p {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.tb-subheading span {
  color: #6b7280;
  font-size: 0.74rem;
}

.tb-label {
  font-size: 0.75rem;
}

.tb-source-card input,
.tb-source-card select,
.tb-source-card textarea {
  padding: 0.62rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.tb-add-leg-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 0.75rem;
  background: rgba(37, 99, 235, 0.1);
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: 600;
}

.tb-add-leg-button:hover {
  background: rgba(37, 99, 235, 0.18);
}

.tb-source-leg-top {
  font-size: 0.7rem;
}

.tb-leg-remove {
  font-size: 0.78rem;
}

.tb-offset-guide {
  padding: 0.65rem 0.8rem;
  border: 1px solid #1f2937;
  border-radius: 0.75rem;
  background: rgba(3, 7, 18, 0.5);
  color: #6b7280;
  font-size: 0.72rem;
}

.tb-check {
  font-size: 0.82rem;
}

.tb-days-grid label {
  border-radius: 0.75rem;
  font-size: 0.84rem;
}

.tb-broker-wrap {
  position: relative;
}

.tb-broker-wrap input {
  padding-right: 2.4rem;
}

.tb-select-chevron {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
  font-size: 0.75rem;
}

.tb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.strategy-list-card {
  padding: 1.15rem 1.2rem;
  border: 1px solid #1c2a44;
  border-radius: 1.15rem;
  background: rgba(12, 20, 35, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.strategy-list-card:hover {
  border-color: #1d68f2;
}

.strategy-list-card.is-muted {
  opacity: 0.6;
}

.strategy-list-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.strategy-card-link {
  min-width: 0;
  flex: 1;
  color: inherit;
}

.strategy-card-link h3 {
  margin: 0;
  color: #f3f7ff;
  font-size: 1rem;
}

.strategy-card-link p {
  margin: 0.35rem 0 0;
  color: #8fa3c8;
  font-size: 0.8rem;
}

.strategy-card-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.strategy-card-actions--stacked {
  flex-direction: column;
  align-items: stretch;
  min-width: 9rem;
}

.strategies-title.strategies-title--simple {
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: 0;
  color: #e6edf7;
}

.strategy-card-list--simple {
  gap: 0.85rem;
}

.strategy-list-card--simple {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(12, 20, 35, 0.92);
  border: 1px solid #1c2a44;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.14);
}

.strategy-list-row--simple {
  align-items: center;
}

.strategy-card-link--simple h3 {
  margin: 0;
  color: #f3f7ff;
  font-size: 1rem;
}

.strategy-card-link--simple p {
  margin: 0.25rem 0 0;
  color: #8fa3c8;
  font-size: 0.8rem;
}

.strategy-card-actions--simple {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.strategy-icon-link,
.strategy-icon-button {
  padding: 0.45rem 0.7rem;
  border: 1px solid #243552;
  border-radius: 0.7rem;
  background: rgba(18, 28, 46, 0.96);
  color: #dbe8ff;
  font-size: 0.75rem;
  font-weight: 600;
}

.strategy-icon-button {
  appearance: none;
}

.strategy-icon-link:hover,
.strategy-icon-button:hover {
  border-color: #4578d4;
  background: rgba(26, 39, 63, 0.98);
}

.strategy-icon-button--danger:hover {
  border-color: rgba(220, 38, 38, 0.65);
  background: rgba(64, 17, 17, 0.96);
  color: #fecaca;
}

.strategy-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.strategy-summary-grid div {
  min-width: 0;
}

.strategy-summary-grid span {
  display: block;
  color: #8fa3c8;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.strategy-summary-grid strong {
  display: block;
  margin-top: 0.25rem;
  color: #f3f7ff;
  font-size: 0.86rem;
}

.strategy-state {
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.strategy-state.is-active {
  background: rgba(20, 83, 45, 0.7);
  color: #b9f6ca;
}

.strategy-state.is-paused {
  background: rgba(133, 77, 14, 0.45);
  color: #facc15;
}

.strategy-state.is-draft {
  background: rgba(30, 41, 59, 0.7);
  color: #cbd5e1;
}

.strategy-state.is-halted {
  background: rgba(127, 29, 29, 0.45);
  color: #fca5a5;
}

.icon-button {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.7rem;
  background: transparent;
  color: #90a4c8;
  font-size: 0.9rem;
}

.icon-button:hover {
  background: rgba(29, 41, 64, 0.9);
  color: #ffffff;
}

.icon-button.is-danger:hover {
  color: #fca5a5;
}

.strategy-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.strategy-chip {
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(18, 25, 42, 0.95);
  color: #9cabca;
  font-size: 0.74rem;
}

.empty-state-card,
.empty-detail-card {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px solid #1c2a44;
  border-radius: 1.25rem;
  background: rgba(12, 20, 35, 0.92);
}

.empty-state-icon {
  margin-bottom: 0.8rem;
  color: #5f7397;
  font-size: 2rem;
}

.empty-state-card p {
  margin: 0 0 1rem;
  color: #a7b8d7;
}

.strategies-page {
  --strategy-ink: #1d2433;
  --strategy-muted: #67748a;
  --strategy-paper: #fffaf0;
  --strategy-paper-strong: #fff4dd;
  --strategy-line: rgba(99, 85, 58, 0.18);
  --strategy-accent: #d97706;
  --strategy-accent-deep: #b45309;
  --strategy-success: #166534;
  --strategy-danger: #b91c1c;
}

.strategies-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 1.25rem;
  padding: 1.1rem;
  border: 1px solid rgba(165, 127, 62, 0.22);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.18), transparent 28%),
    linear-gradient(135deg, #fffaf0 0%, #f4e3bf 100%);
  box-shadow: 0 24px 60px rgba(24, 18, 7, 0.18);
}

.strategies-showcase__hero,
.strategies-showcase__panel {
  min-width: 0;
}

.strategies-showcase__hero {
  display: grid;
  align-content: space-between;
  gap: 1rem;
  color: var(--strategy-ink);
}

.strategies-showcase__eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(180, 83, 9, 0.1);
  color: var(--strategy-accent-deep);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.strategies-title {
  margin: 0;
  color: #151a24;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.strategies-subtitle {
  max-width: 40rem;
  margin: 0;
  color: #4b5565;
  font-size: 0.9rem;
  line-height: 1.55;
}

.strategies-showcase__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.strategies-showcase__hint {
  color: #6f5d3d;
  font-size: 0.8rem;
  font-weight: 600;
}

.strategies-hero__cta {
  padding: 0.72rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #111827, #273449);
  box-shadow: 0 14px 26px rgba(17, 24, 39, 0.18);
  white-space: nowrap;
}

.strategies-showcase__panel {
  display: grid;
  gap: 0.9rem;
}

.strategies-hero__stats,
.strategy-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.strategy-metric-card,
.strategy-overview-card {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--strategy-line);
  border-radius: 0.95rem;
  background: rgba(255, 252, 245, 0.76);
  color: var(--strategy-ink);
  backdrop-filter: blur(10px);
}

.strategy-metric-card--featured {
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.08);
}

.strategy-metric-card span,
.strategy-overview-card span,
.strategy-data-point span,
.strategy-kicker,
.strategy-signal-pill span {
  color: var(--strategy-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strategy-metric-card--featured span,
.strategy-metric-card--featured small {
  color: rgba(241, 245, 249, 0.74);
}

.strategy-metric-card strong,
.strategy-overview-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.strategy-metric-card small,
.strategy-overview-card p {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.76rem;
  line-height: 1.45;
}

.strategy-overview-grid--band {
  padding: 0.3rem 0;
}

.strategy-overview-card {
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.94), rgba(255, 245, 224, 0.92));
}

.strategy-card-list--rich {
  gap: 1.2rem;
}

.strategy-card-list--magazine {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.strategy-list-card--rich {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid rgba(159, 129, 77, 0.22);
  border-radius: 1.1rem;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 22%),
    linear-gradient(180deg, #fffdf8 0%, #f8ecd6 100%);
  box-shadow: 0 18px 42px rgba(37, 28, 12, 0.1);
}

.strategy-list-card:hover {
  border-color: rgba(217, 119, 6, 0.45);
  transform: translateY(-2px);
}

.strategy-list-card.is-muted {
  opacity: 1;
}

.strategy-list-card__accent {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #111827 0%, #d97706 55%, #f59e0b 100%);
}

.strategy-list-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.strategy-list-row--rich {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.15rem;
}

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

.strategy-list-card__headline {
  display: grid;
  gap: 0.4rem;
}

.strategy-symbol-badge {
  display: inline-flex;
  margin-bottom: 0.4rem;
  padding: 0.3rem 0.58rem;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--strategy-accent-deep);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strategy-list-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.strategy-kicker {
  color: #7b6a4e;
}

.strategy-dot {
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 999px;
  background: rgba(180, 83, 9, 0.8);
}

.strategy-card-link--rich h3 {
  margin: 0;
  color: #181c24;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.strategy-summary {
  margin: 0;
  color: #5f6879;
  font-size: 0.82rem;
  line-height: 1.45;
}

.strategy-data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.strategy-data-point {
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(155, 127, 77, 0.15);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.55);
}

.strategy-data-point strong {
  display: block;
  margin-top: 0.28rem;
  color: #1b2230;
  font-size: 0.84rem;
}

.strategy-signal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.strategy-signal-pill {
  min-width: 7.2rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(160, 129, 73, 0.18);
  border-radius: 0.82rem;
  background: rgba(255, 248, 235, 0.94);
}

.strategy-signal-pill strong {
  display: block;
  margin-top: 0.25rem;
  color: #1d2433;
  font-size: 0.9rem;
  letter-spacing: -0.03em;
}

.strategy-signal-pill small {
  display: block;
  margin-top: 0.22rem;
  color: #746750;
  font-size: 0.7rem;
}

.strategy-card-actions--toolbar {
  display: grid;
  gap: 0.55rem;
  min-width: 8.75rem;
}

.strategy-state {
  justify-self: start;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.strategy-state.is-active {
  background: rgba(22, 101, 52, 0.12);
  color: var(--strategy-success);
}

.strategy-state.is-paused {
  background: rgba(217, 119, 6, 0.12);
  color: var(--strategy-accent-deep);
}

.strategy-state.is-draft {
  background: rgba(71, 85, 105, 0.1);
  color: #475569;
}

.strategy-state.is-halted {
  background: rgba(185, 28, 28, 0.1);
  color: var(--strategy-danger);
}

.strategy-action-link,
.strategy-action-button {
  width: 100%;
  box-sizing: border-box;
  padding: 0.62rem 0.8rem;
  border: 1px solid rgba(31, 41, 55, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.strategy-action-button {
  appearance: none;
}

.strategy-action-link:hover,
.strategy-action-button:hover {
  background: #1f2937;
  border-color: #1f2937;
  color: #f8fafc;
}

.strategy-action-button.is-danger {
  background: #fff1f2;
  border-color: rgba(185, 28, 28, 0.15);
  color: var(--strategy-danger);
}

.strategy-action-button.is-danger:hover {
  background: var(--strategy-danger);
  border-color: var(--strategy-danger);
  color: #fff7f7;
}

.strategy-action-form {
  margin: 0;
}

.strategy-chip-row--signal {
  margin-top: 1rem;
}

.strategy-chip--signal {
  border: 1px solid rgba(165, 127, 62, 0.15);
  background: rgba(255, 251, 243, 0.95);
  color: #72664d;
  font-size: 0.68rem;
  padding: 0.32rem 0.55rem;
}

.empty-state-card--strategy {
  padding: 4rem 1.8rem;
  border: 1px solid rgba(165, 127, 62, 0.22);
  background:
    radial-gradient(circle at top, rgba(217, 119, 6, 0.14), transparent 25%),
    linear-gradient(180deg, #fffaf0 0%, #f3e0b8 100%);
  color: var(--strategy-ink);
}

.empty-state-card--strategy h2 {
  margin: 0 0 0.7rem;
  color: #161b24;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.05em;
}

.empty-state-card--strategy p {
  max-width: 34rem;
  margin: 0 auto 1.2rem;
  color: #5d6778;
  line-height: 1.7;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(16, 25, 42, 0.92);
  color: #b6c7e6;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.strategy-form-toolbar-copy {
  flex: 1;
  min-width: 0;
}

.strategy-form-toolbar-copy p {
  margin: 0.25rem 0 0;
  color: #8fa3c8;
  font-size: 0.8rem;
}

.schedule-card {
  padding: 1rem;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 1rem;
  background: rgba(245, 158, 11, 0.08);
  color: #fde7ba;
}

.schedule-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.schedule-pill {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 700;
}

.schedule-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.schedule-card-grid p {
  margin: 0;
  color: rgba(253, 230, 138, 0.72);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.schedule-card-grid strong {
  display: block;
  margin-top: 0.35rem;
  color: #fff6db;
  font-size: 1rem;
}

.schedule-card-note {
  margin-top: 1rem;
  color: rgba(253, 230, 138, 0.85);
  font-size: 0.78rem;
}

.detail-list, .timeline { margin: 0; padding-left: 1.1rem; color: #d8e2f6; }
.timeline li, .detail-list li { margin-bottom: 0.55rem; }

@media (max-width: 960px) {
  .app-frame {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .sidebar {
    position: static;
    top: auto;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #1d2940;
  }
  .stats-grid, .two-column, .grid-form, .signal-mtm-grid, .leg-grid, .tb-strategy-grid, .tb-setup-grid, .tb-entry-grid, .tb-two-grid, .tb-overall-grid, .tb-leg-top-grid, .tb-inline-grid, .tb-three-grid, .schedule-card-grid, .tb-source-grid-2, .tb-source-grid-4, .tb-controls-grid, .tb-leg-grid, .strategy-grid--2, .strategy-grid--4, .strategy-grid--leg-top, .studio-grid--2, .studio-grid--4, .studio-grid--leg, .studio-inline--2, .studio-inline--3, .strategies-hero__stats, .strategy-overview-grid, .strategy-data-grid, .strategy-card-list--magazine { grid-template-columns: 1fr; }
  .content {
    padding: 1rem;
    height: auto;
    overflow: visible;
  }
  .page-header { flex-direction: column; align-items: stretch; }
  .strategy-panel-header, .strategy-check-row { align-items: stretch; }
  .tb-signal-header, .tb-legs-header, .tb-leg-header, .strategies-toolbar, .strategy-form-toolbar, .strategy-list-row, .tb-source-header, .tb-legs-bar, .tb-source-leg-top, .tb-actions, .strategy-section__bar, .strategy-leg__header, .strategy-editor__actions, .strategy-studio__hero, .studio-card__bar, .studio-leg__header, .strategy-studio__actions { flex-direction: column; align-items: stretch; }
  .strategy-card-actions { justify-content: flex-start; }
  .tb-form-wrap { width: 100%; }
  .strategy-studio__hero-badge { text-align: left; min-width: 0; }
  .strategies-showcase {
    grid-template-columns: 1fr;
    padding: 1.1rem;
  }
  .strategy-list-card__topline {
    flex-direction: column;
    align-items: flex-start;
  }
  .strategy-list-row--rich {
    grid-template-columns: 1fr;
  }
  .strategy-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .strategy-card-actions--toolbar {
    min-width: 0;
  }
  .content-auth {
    padding: 0;
    min-height: 100vh;
  }
  .auth-layout, .auth-layout-admin, .auth-highlights { grid-template-columns: 1fr; }
  .auth-hero { padding: 0; }
  .auth-hero h1 { max-width: none; font-size: clamp(2.2rem, 12vw, 3.3rem); }
  .auth-shell { padding: 1rem; }
  .auth-card-centered { width: min(100%, 34rem); }
}
