/* Prebuilt Tailwind-based stylesheet for the standalone preview.
   Tailwind source is included in /src/input.css. */

:root {
  --page-bg: #f7f9fd;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --navy-950: #06143f;
  --navy-900: #081d59;
  --blue-700: #103bc4;
  --blue-600: #1648ea;
  --blue-500: #2f67ff;
  --slate-900: #11182b;
  --slate-700: #47536d;
  --slate-500: #7a879e;
  --slate-300: #d9e0eb;
  --slate-200: #e8edf4;
  --success: #16885d;
  --danger: #d64b5d;
  --shadow-input: 0 9px 28px rgba(23, 42, 91, 0.055);
  --shadow-button: 0 18px 42px rgba(12, 45, 137, 0.22);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--slate-900);
  background:
    radial-gradient(circle at 50% -16%, rgba(63, 109, 255, 0.11), transparent 38%),
    linear-gradient(180deg, #fbfcff 0%, #f5f8fd 58%, #f3f6fc 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
input {
  -webkit-tap-highlight-color: transparent;
}

.auth-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 42px 24px 30px;
  overflow: hidden;
  isolation: isolate;
}

.market-background {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.market-background::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.98) 0%, rgba(255,255,255,.78) 28%, rgba(247,249,253,.22) 65%, transparent 100%);
}

.market-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  animation: background-arrival 1.25s cubic-bezier(.22,.8,.2,1) both;
}

.auth-shell {
  width: min(100%, 640px);
  animation: shell-arrival 0.78s cubic-bezier(.22,.8,.2,1) both;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-logo {
  width: 126px;
  height: 126px;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(10, 39, 116, 0.12));
  animation: logo-arrival 0.9s 0.08s cubic-bezier(.22,.8,.2,1) both;
}

.brand-name {
  margin-top: -5px;
  text-align: center;
}

.brand-title {
  display: block;
  color: var(--navy-950);
  font-size: clamp(31px, 5vw, 43px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.brand-subtitle {
  display: block;
  margin-top: 12px;
  color: var(--blue-700);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.48em;
  text-indent: 0.48em;
}

.welcome-block {
  margin-top: 60px;
  text-align: center;
}

.welcome-block h1 {
  margin: 0;
  color: var(--slate-900);
  font-size: clamp(32px, 5vw, 43px);
  font-weight: 730;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.welcome-block p {
  margin: 13px 0 0;
  color: var(--slate-500);
  font-size: clamp(15px, 2.5vw, 18px);
  line-height: 1.55;
}

.login-form {
  margin-top: 48px;
}

.form-field + .form-field {
  margin-top: 26px;
}

.form-field label {
  display: inline-block;
  margin: 0 0 10px 2px;
  color: var(--slate-900);
  font-size: 15px;
  font-weight: 680;
}

.input-control {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 20px;
  width: 24px;
  height: 24px;
  z-index: 2;
  color: #465775;
  pointer-events: none;
  transition: color 180ms ease, transform 180ms ease;
}

.lucide {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-control input {
  width: 100%;
  height: 70px;
  padding: 0 64px;
  color: var(--slate-900);
  caret-color: var(--blue-600);
  outline: none;
  border: 1px solid rgba(134, 151, 179, 0.29);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow:
    var(--shadow-input),
    inset 0 1px 0 rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.input-control input::placeholder {
  color: #9aa5b6;
}

.input-control input:hover {
  border-color: rgba(76, 103, 155, 0.37);
  background: rgba(255,255,255,.9);
}

.input-control input:focus {
  border-color: rgba(25, 75, 224, 0.62);
  background: rgba(255,255,255,.96);
  box-shadow:
    0 0 0 4px rgba(36, 88, 245, 0.085),
    0 15px 34px rgba(23, 42, 91, 0.08);
  transform: translateY(-1px);
}

.input-control:focus-within .input-icon {
  color: var(--blue-700);
  transform: scale(1.04);
}

.password-toggle {
  position: absolute;
  right: 13px;
  width: 44px;
  height: 44px;
  padding: 10px;
  display: grid;
  place-items: center;
  z-index: 3;
  color: #425473;
  border: 0;
  border-radius: 12px;
  background: transparent;
  transition:
    color 170ms ease,
    background-color 170ms ease,
    transform 170ms ease;
}

.password-toggle:hover {
  color: var(--blue-700);
  background: rgba(19, 60, 178, 0.065);
}

.password-toggle:active {
  transform: scale(.94);
}

.password-toggle:focus-visible,
.submit-button:focus-visible {
  outline: 3px solid rgba(35, 86, 241, 0.22);
  outline-offset: 3px;
}

.password-toggle .eye-hidden {
  display: none;
}

.password-toggle.is-visible .eye-visible {
  display: none;
}

.password-toggle.is-visible .eye-hidden {
  display: block;
}

.form-message {
  min-height: 23px;
  margin: 13px 2px 6px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

.form-message.is-success {
  color: var(--success);
}

.submit-button {
  position: relative;
  width: 100%;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  background:
    linear-gradient(105deg, var(--navy-950) 0%, var(--navy-900) 48%, #113ed9 100%);
  box-shadow:
    var(--shadow-button),
    inset 0 1px 0 rgba(255,255,255,.18);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition:
    transform 190ms ease,
    box-shadow 190ms ease,
    filter 190ms ease;
}

.submit-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -36%;
  width: 27%;
  height: 100%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.21), transparent);
  transition: left 520ms ease;
}

.submit-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.06) brightness(1.03);
  box-shadow:
    0 23px 50px rgba(12, 45, 137, 0.28),
    inset 0 1px 0 rgba(255,255,255,.22);
}

.submit-button:hover::before {
  left: 112%;
}

.submit-button:active {
  transform: translateY(0) scale(.995);
}

.submit-button:disabled {
  cursor: wait;
}

.button-label,
.button-loader,
.button-check {
  grid-area: 1 / 1;
}

.button-loader,
.button-check {
  opacity: 0;
  transform: scale(.7);
}

.button-loader {
  width: 23px;
  height: 23px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
}

.button-check {
  width: 27px;
  height: 27px;
}

.submit-button.is-loading .button-label {
  opacity: 0;
}

.submit-button.is-loading .button-loader {
  opacity: 1;
  animation: spin .7s linear infinite;
}

.submit-button.is-success .button-label,
.submit-button.is-success .button-loader {
  opacity: 0;
}

.submit-button.is-success .button-check {
  opacity: 1;
  transform: scale(1);
  transition: opacity 170ms ease, transform 280ms cubic-bezier(.2,1.35,.3,1);
}

.page-footer {
  margin-top: 64px;
  color: #79869d;
  text-align: center;
  font-size: 13px;
}

.auth-shell.is-shaking {
  animation: shake 0.36s ease;
}

@keyframes shell-arrival {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logo-arrival {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes background-arrival {
  from {
    opacity: 0;
    transform: scale(1.025);
  }
  to {
    opacity: .9;
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-7px); }
  48% { transform: translateX(6px); }
  72% { transform: translateX(-3px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 680px) {
  .auth-page {
    place-items: start center;
    padding: 32px 18px 24px;
  }

  .auth-shell {
    width: min(100%, 520px);
  }

  .brand-logo {
    width: 105px;
    height: 105px;
  }

  .brand-title {
    font-size: 33px;
  }

  .brand-subtitle {
    margin-top: 10px;
    font-size: 13px;
    letter-spacing: .42em;
    text-indent: .42em;
  }

  .welcome-block {
    margin-top: 45px;
  }

  .welcome-block h1 {
    font-size: 33px;
  }

  .welcome-block p {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  .login-form {
    margin-top: 38px;
  }

  .input-control input {
    height: 64px;
    padding-left: 58px;
    padding-right: 58px;
    border-radius: 14px;
  }

  .input-icon {
    left: 18px;
    width: 22px;
    height: 22px;
  }

  .submit-button {
    height: 66px;
    border-radius: 14px;
  }

  .page-footer {
    margin-top: 48px;
    font-size: 12px;
  }
}

@media (max-height: 760px) and (min-width: 681px) {
  .auth-page {
    padding-top: 26px;
    padding-bottom: 22px;
  }

  .brand-logo {
    width: 94px;
    height: 94px;
  }

  .brand-title {
    font-size: 34px;
  }

  .brand-subtitle {
    font-size: 13px;
  }

  .welcome-block {
    margin-top: 34px;
  }

  .login-form {
    margin-top: 30px;
  }

  .input-control input {
    height: 62px;
  }

  .submit-button {
    height: 64px;
  }

  .page-footer {
    margin-top: 35px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* v10: searchable instrument picker */
.instrument-select {
  position: relative;
}
.instrument-input-wrap {
  position: relative;
}
.selected-instrument-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #1c366d;
  border-radius: 999px;
  background: #eef3ff;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
}
.instrument-input-control {
  padding-left: 52px;
  padding-right: 46px;
}
.instrument-toggle-button {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #7b8799;
  border: 0;
  border-radius: 10px;
  background: transparent;
  transform: translateY(-50%);
  transition: background .18s ease, color .18s ease;
}
.instrument-toggle-button:hover {
  color: #173d86;
  background: #f2f5fb;
}
.instrument-toggle-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.instrument-select.is-open .instrument-toggle-button {
  color: #173d86;
  background: #eef3ff;
}
.instrument-dropdown {
  position: absolute;
  z-index: 35;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  max-height: 316px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(111, 127, 155, .18);
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 48px rgba(23, 39, 72, .16);
  backdrop-filter: blur(14px);
}
.instrument-dropdown[hidden] {
  display: none !important;
}
.instrument-option,
.instrument-create-option {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #293754;
  text-align: left;
  border: 0;
  border-radius: 12px;
  background: transparent;
  transition: background .16s ease, transform .16s ease;
}
.instrument-option:hover,
.instrument-option.is-active,
.instrument-create-option:hover,
.instrument-create-option.is-active {
  background: #f4f7fd;
}
.instrument-option-icon,
.instrument-table-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, #edf2ff, #f8faff);
  box-shadow: inset 0 0 0 1px rgba(33, 73, 190, .06);
  font-size: 16px;
}
.instrument-option-text {
  min-width: 0;
}
.instrument-option-name,
.instrument-option-description {
  display: block;
}
.instrument-option-name {
  color: #202e4b;
  font-size: 14px;
  font-weight: 700;
}
.instrument-option-description {
  margin-top: 2px;
  color: #8b96a8;
  font-size: 12px;
}
.instrument-create-option {
  border-top: 1px solid rgba(111, 127, 155, .12);
  margin-top: 6px;
  padding-top: 12px;
}
.instrument-create-option strong {
  display: block;
  color: #173d86;
  font-size: 13px;
}
.instrument-create-option span {
  display: block;
  margin-top: 2px;
  color: #8b96a8;
  font-size: 12px;
}
.instrument-empty {
  padding: 14px 12px;
  color: #7e8ba0;
  text-align: center;
  font-size: 13px;
}
.instrument-table-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.instrument-table-icon {
  width: 28px;
  height: 28px;
  font-size: 14px;
}
.instrument-table-chip > span:last-child {
  display: flex;
  flex-direction: column;
}


/* v11: refined instrument visuals */
.selected-instrument-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  overflow: visible;
  background: transparent;
}

.instrument-visual {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.instrument-visual--single {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #edf2ff, #f7faff);
  box-shadow: inset 0 0 0 1px rgba(33, 73, 190, .07);
  color: #173d86;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.instrument-visual--pair {
  width: 42px;
  height: 34px;
}

.instrument-flag-badge {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #eef3ff);
  box-shadow: 0 4px 10px rgba(17, 24, 43, .08), inset 0 0 0 1px rgba(33, 73, 190, .08);
  font-size: 14px;
  line-height: 1;
}

.instrument-flag-badge--front {
  position: absolute;
  left: 18px;
  top: 10px;
  z-index: 2;
}

.instrument-flag-badge--back {
  position: absolute;
  left: 2px;
  top: 0;
  z-index: 1;
}

.instrument-option-icon,
.instrument-table-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.instrument-option-icon {
  width: 42px;
  height: 34px;
}

.instrument-table-icon {
  width: 34px;
  height: 28px;
}

.instrument-table-icon .instrument-visual--pair {
  transform: scale(.82);
  transform-origin: left center;
}

.instrument-option-icon .instrument-visual--single,
.instrument-table-icon .instrument-visual--single,
.selected-instrument-icon .instrument-visual--single {
  width: 30px;
  height: 30px;
}

.instrument-option-icon .instrument-visual--single,
.selected-instrument-icon .instrument-visual--single {
  font-size: 12px;
}

.instrument-table-icon .instrument-visual--single {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.instrument-input-control {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* v12: selected instrument field spacing fix only */
.selected-instrument-icon {
  left: 14px;
  width: 40px;
  height: 34px;
}

.selected-instrument-icon .instrument-visual--pair {
  width: 40px;
  height: 32px;
  transform: scale(.78);
  transform-origin: left center;
}

.selected-instrument-icon .instrument-flag-badge {
  width: 23px;
  height: 23px;
  font-size: 13px;
}

.selected-instrument-icon .instrument-flag-badge--back {
  left: 1px;
  top: 1px;
}

.selected-instrument-icon .instrument-flag-badge--front {
  left: 17px;
  top: 9px;
}

.instrument-input-control {
  padding-left: 72px !important;
}

@media (max-width: 620px) {
  .instrument-input-control {
    padding-left: 68px !important;
  }
}


/* v13: linked multi-account executions */
.linked-executions-panel {
  padding: 18px;
  border: 1px solid rgba(36, 87, 223, .13);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(36,87,223,.035), rgba(255,255,255,.82));
}

.linked-executions-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.linked-executions-eyebrow {
  display: block;
  color: #2457df;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.linked-executions-header h4 {
  margin: 5px 0 0;
  color: #172137;
  font-size: 16px;
}

.linked-executions-header p {
  max-width: 650px;
  margin: 6px 0 0;
  color: #8692a5;
  font-size: 10px;
  line-height: 1.55;
}

.add-linked-execution-button {
  flex: 0 0 auto;
}

.add-linked-execution-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.linked-executions-list {
  margin-top: 15px;
  display: grid;
  gap: 12px;
}

.linked-executions-empty {
  margin-top: 14px;
  padding: 13px;
  color: #8793a5;
  border: 1px dashed rgba(107,126,161,.20);
  border-radius: 12px;
  background: rgba(255,255,255,.55);
  font-size: 10px;
  text-align: center;
}

.linked-executions-empty[hidden] {
  display: none !important;
}

.linked-execution-card {
  position: relative;
  padding: 15px 15px 15px 58px;
  overflow: hidden;
  border: 1px solid rgba(107,126,161,.15);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(36,58,98,.055);
}

.linked-execution-card.is-positive {
  border-color: rgba(18,167,121,.20);
}

.linked-execution-card.is-negative {
  border-color: rgba(223,89,103,.20);
}

.linked-execution-number {
  position: absolute;
  left: 14px;
  top: 15px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: #2457df;
  border-radius: 10px;
  background: rgba(36,87,223,.08);
  font-size: 9px;
  font-weight: 800;
}

.linked-execution-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.linked-execution-card-header strong,
.linked-execution-card-header span {
  display: block;
}

.linked-execution-card-header strong {
  color: #26334d;
  font-size: 12px;
}

.linked-execution-card-header span {
  margin-top: 3px;
  color: #929cac;
  font-size: 8px;
}

.linked-execution-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 1.2fr repeat(4, minmax(108px, 1fr));
  gap: 10px;
}

.linked-execution-preview {
  margin-top: 11px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 10px;
  background: #f5f7fb;
}

.linked-execution-preview span {
  color: #8792a4;
  font-size: 8px;
}

.linked-execution-preview strong {
  color: #25324b;
  font-size: 13px;
}

.linked-execution-preview small {
  color: #919baa;
  font-size: 8px;
}

.linked-execution-card.is-positive .linked-execution-preview strong {
  color: #12a779;
}

.linked-execution-card.is-negative .linked-execution-preview strong {
  color: #df5967;
}

.linked-account-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 250px;
}

.linked-account-summary strong,
.linked-account-summary small {
  display: block;
}

.linked-account-summary strong {
  color: #28354d;
  font-size: 9px;
}

.linked-account-summary small {
  max-width: 190px;
  margin-top: 2px;
  overflow: hidden;
  color: #919baa;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-account-avatars {
  display: flex;
  min-width: 34px;
}

.linked-account-avatars i,
.execution-detail-account > i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #2457df;
  border: 2px solid #fff;
  border-radius: 9px;
  background: #edf2ff;
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(35,57,99,.10);
}

.linked-account-avatars i + i {
  margin-left: -8px;
}

.linked-account-avatars img,
.execution-detail-account img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.linked-trade-badge {
  display: inline-flex;
  margin-top: 4px;
  padding: 4px 6px;
  color: #2457df;
  border-radius: 6px;
  background: rgba(36,87,223,.07);
  font-size: 6.5px;
  font-weight: 750;
}

.linked-expand-button svg {
  transition: transform .18s ease;
}

.linked-expand-button.is-expanded svg {
  transform: rotate(180deg);
}

.linked-execution-details-row[hidden] {
  display: none !important;
}

.linked-execution-details-row > td {
  padding: 0 12px 12px !important;
  border-top: 0 !important;
  background: #f8faff;
}

.linked-execution-details {
  padding: 14px;
  border: 1px solid rgba(36,87,223,.11);
  border-radius: 13px;
  background: #fff;
}

.linked-execution-details-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.linked-execution-details-heading strong,
.linked-execution-details-heading span {
  display: block;
}

.linked-execution-details-heading strong {
  color: #25324a;
  font-size: 10px;
}

.linked-execution-details-heading div > span {
  margin-top: 3px;
  color: #929cac;
  font-size: 7px;
}

.linked-execution-details-heading > span {
  padding: 5px 7px;
  color: #2457df;
  border-radius: 7px;
  background: rgba(36,87,223,.07);
  font-size: 7px;
  font-weight: 750;
}

.linked-execution-details-grid {
  margin-top: 11px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 9px;
}

.execution-detail-card {
  padding: 11px;
  border: 1px solid rgba(107,126,161,.13);
  border-radius: 11px;
  background: #fafbfe;
}

.execution-detail-card.is-positive {
  border-color: rgba(18,167,121,.18);
  background: rgba(18,167,121,.025);
}

.execution-detail-card.is-negative {
  border-color: rgba(223,89,103,.18);
  background: rgba(223,89,103,.025);
}

.execution-detail-account {
  display: flex;
  align-items: center;
  gap: 8px;
}

.execution-detail-account strong,
.execution-detail-account span {
  display: block;
}

.execution-detail-account strong {
  color: #28354c;
  font-size: 9px;
}

.execution-detail-account span {
  margin-top: 2px;
  color: #929cac;
  font-size: 7px;
}

.execution-detail-card dl {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.execution-detail-card dl > div {
  padding-top: 7px;
  border-top: 1px solid rgba(107,126,161,.09);
}

.execution-detail-card dt,
.execution-detail-card dd {
  margin: 0;
}

.execution-detail-card dt {
  color: #939dac;
  font-size: 6.5px;
}

.execution-detail-card dd {
  margin-top: 3px;
  color: #26334b;
  font-size: 8px;
  font-weight: 750;
}

.execution-detail-card.is-positive dl > div:nth-child(3) dd {
  color: #12a779;
}

.execution-detail-card.is-negative dl > div:nth-child(3) dd {
  color: #df5967;
}

@media (max-width: 920px) {
  .linked-executions-header {
    flex-direction: column;
  }

  .linked-execution-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .linked-execution-card {
    padding: 58px 12px 12px;
  }

  .linked-execution-number {
    left: 12px;
    top: 12px;
  }

  .linked-execution-grid {
    grid-template-columns: 1fr;
  }

  .linked-execution-preview {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}


/* v14: multi-account limit */
.linked-executions-limit-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.linked-executions-limit-row > span {
  color: #75839a;
  font-size: 9px;
  font-weight: 650;
}

.linked-executions-limit-row > strong {
  min-width: 46px;
  padding: 5px 8px;
  color: #2457df;
  border: 1px solid rgba(36, 87, 223, .12);
  border-radius: 8px;
  background: rgba(36, 87, 223, .06);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.linked-executions-limit-row > strong.is-limit-reached {
  color: #d14d5f;
  border-color: rgba(209, 77, 95, .16);
  background: rgba(209, 77, 95, .07);
}

@media (max-width: 720px) {
  .linked-executions-limit-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}


/* v15: automatic R calculation */
.auto-calculated-control {
  color: #173d86;
  border-color: rgba(36, 87, 223, .14);
  background:
    linear-gradient(90deg, rgba(36, 87, 223, .055), rgba(255,255,255,.92));
  font-weight: 750;
  cursor: default;
}

.auto-calculated-control:focus {
  border-color: rgba(36, 87, 223, .14);
  box-shadow: none;
}

.auto-calculated-control::placeholder {
  color: #9aa6b8;
  font-weight: 500;
}


/* v16: dynamic strategy checklist in trade form */
.inline-settings-link {
  color: #2457df;
  font-weight: 750;
  text-decoration: none;
}

.inline-settings-link:hover {
  text-decoration: underline;
}

.strategy-checklist-card {
  padding: 18px;
  border: 1px solid rgba(36, 87, 223, .13);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(36,87,223,.035), rgba(255,255,255,.9));
}

.strategy-checklist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.strategy-checklist-eyebrow {
  display: block;
  color: #2457df;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.strategy-checklist-header h4 {
  margin: 6px 0 0;
  color: #18243b;
  font-size: 17px;
  letter-spacing: -.02em;
}

.strategy-checklist-header p {
  max-width: 660px;
  margin: 6px 0 0;
  color: #8590a2;
  font-size: 11px;
  line-height: 1.55;
}

.strategy-checklist-score {
  min-width: 76px;
  padding: 9px 11px;
  color: #2457df;
  border: 1px solid rgba(36, 87, 223, .14);
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.strategy-checklist-score strong,
.strategy-checklist-score span {
  display: block;
}

.strategy-checklist-score strong {
  font-size: 13px;
}

.strategy-checklist-score span {
  margin-top: 2px;
  color: #8390a4;
  font-size: 9px;
}

.strategy-rules-checklist {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.strategy-rule-checkbox {
  min-height: 76px;
  padding: 13px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: #58677f;
  border: 1px solid rgba(105, 123, 154, .14);
  border-radius: 13px;
  background: rgba(255,255,255,.84);
  cursor: pointer;
  transition:
    transform .16s ease,
    border-color .16s ease,
    background .16s ease,
    box-shadow .16s ease;
}

.strategy-rule-checkbox:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 87, 223, .25);
  box-shadow: 0 10px 22px rgba(29, 53, 105, .07);
}

.strategy-rule-checkbox.is-checked {
  border-color: rgba(18, 167, 121, .25);
  background: rgba(18, 167, 121, .045);
}

.strategy-rule-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.strategy-rule-checkmark {
  width: 23px;
  height: 23px;
  padding: 5px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: transparent;
  border: 1px solid #cfd6e2;
  border-radius: 7px;
  background: #fff;
}

.strategy-rule-checkbox.is-checked .strategy-rule-checkmark {
  color: #fff;
  border-color: #18a779;
  background: #18a779;
}

.strategy-rule-checkmark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.strategy-rule-copy strong,
.strategy-rule-copy span {
  display: block;
}

.strategy-rule-copy strong {
  color: #8a96a8;
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.strategy-rule-copy span {
  margin-top: 5px;
  color: #4e5d74;
  font-size: 11px;
  line-height: 1.45;
}

.strategy-rules-empty {
  margin-top: 14px;
  padding: 16px;
  color: #7d899b;
  border: 1px dashed #d5dbe5;
  border-radius: 12px;
  text-align: center;
}

.strategy-rules-empty strong,
.strategy-rules-empty span {
  display: block;
}

.strategy-rules-empty strong {
  color: #526178;
  font-size: 11px;
}

.strategy-rules-empty span {
  margin-top: 4px;
  font-size: 9px;
}

@media (max-width: 760px) {
  .strategy-rules-checklist {
    grid-template-columns: 1fr;
  }

  .strategy-checklist-header {
    flex-direction: column;
  }
}


/* v17: trade detail analysis */
.single-execution-details {
  margin-top: 11px;
  max-width: 470px;
}

.trade-analysis-details {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid rgba(107,126,161,.10);
}

.trade-analysis-details-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trade-analysis-details-heading strong,
.trade-analysis-details-heading span {
  display: block;
}

.trade-analysis-details-heading strong {
  color: #25324a;
  font-size: 10px;
}

.trade-analysis-details-heading span {
  margin-top: 3px;
  color: #929cac;
  font-size: 7px;
}

.trade-analysis-details-grid {
  margin-top: 11px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.trade-analysis-detail-card {
  padding: 11px;
  min-width: 0;
  border: 1px solid rgba(107,126,161,.13);
  border-radius: 12px;
  background: #fafbfe;
}

.trade-analysis-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.trade-analysis-detail-header > span {
  padding: 5px 7px;
  color: #2457df;
  border-radius: 7px;
  background: rgba(36,87,223,.07);
  font-size: 8px;
  font-weight: 800;
}

.trade-analysis-detail-header small {
  color: #909bab;
  font-size: 7px;
}

.trade-detail-screenshot {
  width: 100%;
  height: 165px;
  margin-top: 9px;
  padding: 0;
  position: relative;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(107,126,161,.12);
  border-radius: 10px;
  background: #edf1f6;
  cursor: zoom-in;
}

.trade-detail-screenshot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .2s ease;
}

.trade-detail-screenshot:hover img {
  transform: scale(1.035);
}

.trade-detail-screenshot > span {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  border-radius: 9px;
  background: rgba(8,20,49,.78);
  backdrop-filter: blur(8px);
  font-size: 8px;
  font-weight: 750;
  opacity: 0;
  transform: translate(-50%, -43%);
  transition: opacity .17s ease, transform .17s ease;
  white-space: nowrap;
}

.trade-detail-screenshot:hover > span,
.trade-detail-screenshot:focus-visible > span {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.trade-detail-screenshot svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trade-analysis-detail-card p {
  margin: 9px 0 0;
  color: #66748a;
  font-size: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.trade-analysis-detail-card p.is-empty {
  color: #a0a9b7;
}

.trade-analysis-detail-card audio {
  width: 100%;
  height: 32px;
  margin-top: 9px;
}

.trade-detail-no-screenshot {
  height: 82px;
  margin-top: 9px;
  display: grid;
  place-items: center;
  color: #a0a9b7;
  border: 1px dashed rgba(107,126,161,.16);
  border-radius: 10px;
  font-size: 8px;
}

.trade-detail-note,
.trade-detail-audio {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid rgba(107,126,161,.11);
  border-radius: 11px;
  background: #fafbfe;
}

.trade-detail-note > span {
  color: #8f9aab;
  font-size: 7px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.trade-detail-note p {
  margin: 6px 0 0;
  color: #5d6b81;
  font-size: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.trade-detail-audio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trade-detail-audio strong,
.trade-detail-audio span {
  display: block;
}

.trade-detail-audio strong {
  color: #3e4d66;
  font-size: 8px;
}

.trade-detail-audio span {
  margin-top: 3px;
  color: #929cab;
  font-size: 7px;
}

.trade-detail-audio audio {
  width: min(340px, 100%);
  height: 32px;
}

.trade-details-empty {
  margin-top: 12px;
  padding: 14px;
  color: #929cab;
  border: 1px dashed rgba(107,126,161,.17);
  border-radius: 11px;
  text-align: center;
  font-size: 8px;
}

/* v17: fullscreen screenshot lightbox */
body.is-lightbox-open {
  overflow: hidden;
}

.screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 18px;
}

.screenshot-lightbox[hidden] {
  display: none !important;
}

.screenshot-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 9, 22, .88);
  backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.screenshot-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100vw - 36px));
  height: min(920px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: #0b1325;
  box-shadow: 0 35px 90px rgba(0,0,0,.45);
}

.screenshot-lightbox-header {
  min-height: 67px;
  padding: 12px 14px 12px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(10,19,38,.97);
}

.screenshot-lightbox-header span,
.screenshot-lightbox-header strong,
.screenshot-lightbox-header small {
  display: block;
}

.screenshot-lightbox-header span {
  color: #8298c6;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.screenshot-lightbox-header strong {
  margin-top: 4px;
  font-size: 13px;
}

.screenshot-lightbox-header small {
  margin-top: 3px;
  color: #9ba8c2;
  font-size: 8px;
}

.screenshot-lightbox-close {
  width: 39px;
  height: 39px;
  padding: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  background: rgba(255,255,255,.06);
}

.screenshot-lightbox-close:hover {
  background: rgba(255,255,255,.12);
}

.screenshot-lightbox-close svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.screenshot-lightbox-stage {
  min-height: 0;
  padding: 16px;
  display: grid;
  place-items: center;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 50%, rgba(41,66,119,.25), transparent 55%),
    #070d19;
}

.screenshot-lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 5px;
  box-shadow: 0 18px 55px rgba(0,0,0,.38);
}

@media (max-width: 720px) {
  .trade-analysis-details-grid {
    grid-template-columns: 1fr;
  }

  .trade-detail-audio {
    align-items: flex-start;
    flex-direction: column;
  }

  .screenshot-lightbox {
    padding: 8px;
  }

  .screenshot-lightbox-dialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    border-radius: 13px;
  }

  .screenshot-lightbox-header {
    min-height: 61px;
  }

  .screenshot-lightbox-stage {
    padding: 8px;
  }
}


/* v19: compact logo + account name for single-account trades */
.single-account-summary .linked-account-avatars {
  min-width: 26px;
}

.single-account-summary strong {
  color: #8b96a7;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.single-account-summary small {
  max-width: 205px;
  margin-top: 3px;
  color: #2e3b53;
  font-size: 8.5px;
  font-weight: 700;
}

.instrument-table-chip > .table-primary {
  align-self: center;
}


/* v20: double-click trade opening */
.trade-idea-row[data-open-trade] {
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}

.trade-idea-row[data-open-trade]:hover {
  background: rgba(36, 87, 223, .018);
  box-shadow: inset 3px 0 0 rgba(36, 87, 223, .22);
}

.trade-idea-row[data-open-trade] td:last-child,
.trade-idea-row[data-open-trade] button,
.trade-idea-row[data-open-trade] a {
  cursor: default;
}

/* v20: preserve original pixels in fullscreen view */
.screenshot-lightbox-stage {
  align-items: start;
  justify-items: center;
}

.screenshot-lightbox-stage img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  min-width: 0;
  image-rendering: auto;
}

@media (max-width: 900px) {
  .screenshot-lightbox-stage img {
    max-width: 100%;
    height: auto;
  }
}
