:root {
  --ink: #142a2d;
  --muted: #576e70;
  --navy: #0b2328;
  --teal: #007c6c;
  --mint: #09d9a5;
  --mint-ink: #05271f;
  --line: #d6e2df;
  --field-line: #bbcdc4;
  --soft: #f1f6f4;
  --paper: #fff;
  --radius: 14px;
  --chosen: #8abda8;
  --chosen-bg: #f3faf6;
}

body {
  background: #eaf0ee;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  color: #005e52;
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #339eee;
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 85px;
  padding: 15px max(28px, calc((100vw - 1140px) / 2));
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 162px;
  height: 42px;
}

.brand-mark {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.top-actions form {
  margin: 0;
}

.nav-text {
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.nav-text:hover {
  color: var(--teal);
  text-decoration: none;
}

.page {
  padding-top: 36px;
  padding-bottom: 72px;
}

.overline,
.launchpad-card > p.overline {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.text-info {
  color: var(--teal) !important;
}

.launchpad-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.launchpad-card > h1,
.launchpad-card > h1.h3,
.launchpad-card > h1.h4,
main > h1,
main > h1.h3 {
  margin-bottom: 16px;
  font-size: 28px;
  letter-spacing: -0.9px;
}

.launchpad-card > p,
.text-muted {
  color: var(--muted) !important;
}

.launchpad-card > .text-muted:first-child {
  margin-bottom: 4px;
  color: var(--teal) !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.launchpad-card .h2 {
  margin: 4px 0 10px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -1px;
}

.stat-row > div {
  display: flex;
}

.stat-card {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.stat-card .h2 {
  margin-bottom: 0;
}

.stat-card a {
  margin-top: auto;
  padding-top: 10px;
}

.launchpad-card h2.h6,
.launchpad-card .h6 {
  margin: 22px 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.launchpad-card .h5,
.launchpad-card h2.h5 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.4px;
}

label {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.form-group {
  margin-bottom: 18px;
}

.form-control,
.form-inline .form-control,
select.form-control,
textarea.form-control {
  height: auto;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--field-line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
}

textarea.form-control {
  min-height: 120px;
}

.form-control::placeholder {
  color: #8b9794;
}

.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
  border-color: var(--teal);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0, 124, 108, 0.14);
}

.form-control-file {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--field-line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
}

.form-text {
  color: var(--muted);
  font-size: 13px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.form-check:has(input:checked) {
  border-color: var(--chosen);
  background: var(--chosen-bg);
}

.form-check:has(input:disabled) {
  background: var(--soft);
}

.form-check .form-check-input {
  position: static;
  float: none;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  appearance: auto;
  accent-color: var(--teal);
  background-color: transparent;
  background-image: none;
  border: 0;
  box-shadow: none;
}

.form-check-input:checked,
.form-check-input:focus,
.form-check-input:active {
  background-color: transparent;
  background-image: none;
  border-color: transparent;
  box-shadow: none;
}

.form-check-label {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: none;
}

.btn:focus,
.btn.focus,
.btn:focus-visible,
.button:focus,
.button:focus-visible {
  outline: 3px solid #339eee;
  outline-offset: 2px;
  box-shadow: none;
}

.btn:disabled,
.btn.disabled {
  opacity: 1;
}

.btn-primary,
.btn-success,
.btn-primary:disabled,
.btn-success:disabled {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--mint-ink);
}

.btn-primary:hover,
.btn-success:hover,
.btn-primary:focus,
.btn-success:focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-success:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
  border-color: #63edc5;
  background: #63edc5;
  color: var(--mint-ink);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.button.dark,
.button.dark:hover,
a.button.dark,
a.button.dark:hover {
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

.button.dark:hover,
a.button.dark:hover {
  background: #22453d;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-primary:disabled,
.btn-outline-secondary:disabled {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:focus,
.btn-outline-secondary:focus,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-secondary:not(:disabled):not(.disabled):active {
  border-color: var(--chosen);
  background: var(--soft);
  color: var(--ink);
}

.btn-outline-danger {
  border-color: #e4c4c7;
  background: var(--paper);
  color: #8d3038;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  border-color: #e4c4c7;
  background: #fdecec;
  color: #8d3038;
}

.btn-warning,
.btn-warning:disabled {
  border-color: #e4d3aa;
  background: #fff8ec;
  color: var(--ink);
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:not(:disabled):not(.disabled):active {
  border-color: #d2b56a;
  background: #fff1d4;
  color: var(--ink);
}

.btn-link,
.btn-link:hover,
.btn-link:focus {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.alert {
  border-radius: 8px;
  font-size: 14px;
}

.alert-danger,
.alert-error {
  border-color: #f0c9ce;
  background: #fdecec;
  color: #7a2430;
}

.alert-warning {
  border-color: #ead9ae;
  background: #fff8ec;
  color: #6b4e12;
}

.alert-success {
  border-color: #b7e6d4;
  background: #e8f8f2;
  color: #0b4d3c;
}

.alert-info {
  border-color: var(--line);
  background: var(--soft);
  color: var(--ink);
}

.step-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-nav .list-group-item {
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.step-nav .list-group-item + .list-group-item {
  border-top-width: 1px;
}

.step-nav .list-group-item-action:hover,
.step-nav .list-group-item-action:focus {
  border-color: var(--chosen);
  background: var(--chosen-bg);
  color: var(--ink);
}

.step-nav .list-group-item.active {
  border-color: var(--chosen);
  background: var(--chosen-bg);
  color: var(--teal);
  font-weight: 600;
}

.table {
  --bs-table-color: var(--ink);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line);
  --bs-table-striped-color: var(--ink);
  --bs-table-striped-bg: var(--soft);
  color: var(--ink);
  font-size: 14px;
}

.table > :not(caption) > * > *,
.table-sm > :not(caption) > * > * {
  padding: 12px 10px;
  vertical-align: middle;
}

.table > thead > tr > th {
  border-bottom-color: #b8cec3;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

dl.row dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

dl.row dd {
  color: var(--ink);
}

code {
  padding: 1px 6px;
  border-radius: 4px;
  background: #e7f3ef;
  color: var(--teal);
  font-size: 0.92em;
}

.code-reveal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.code-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.code-eye:hover,
.code-eye:focus {
  color: var(--teal);
}

.code-eye svg {
  width: 18px;
  height: 18px;
}

.code-eye .eye-off,
.code-eye.is-open .eye-on {
  display: none;
}

.code-eye.is-open .eye-off {
  display: block;
}

pre,
.bg-light {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft) !important;
  color: var(--ink);
}

.text-danger {
  color: #8d3038 !important;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

hr {
  border-top-color: var(--line);
  opacity: 1;
}

.trader-row {
  margin-bottom: 12px;
  padding: 16px 16px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-inline label {
  margin-bottom: 0;
}

.form-inline .form-control {
  width: auto;
  min-width: 220px;
}

#summary-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field-hint-popover {
  --bs-popover-bg: var(--paper);
  --bs-popover-border-color: var(--line);
  --bs-popover-border-width: 1px;
  --bs-popover-border-radius: 10px;
  --bs-popover-body-color: var(--ink);
  --bs-popover-body-padding-x: 14px;
  --bs-popover-body-padding-y: 12px;
  --bs-popover-max-width: min(340px, calc(100vw - 32px));
  --bs-popover-font-size: 14px;
  --bs-popover-box-shadow: 0 10px 28px rgba(11, 35, 40, 0.1);
  z-index: 40;
  box-shadow: 0 10px 28px rgba(11, 35, 40, 0.1);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.field-hint-popover .popover-body {
  color: var(--ink);
}

.field-hint-anchor {
  position: relative;
}

.field-hint-anchor > .form-control,
.field-hint-anchor > .form-control-file {
  padding-right: 32px;
}

.form-check.field-hint-target {
  position: relative;
  padding-right: 36px;
}

.field-hint-toggle {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--teal);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.field-hint-toggle:hover {
  border-color: var(--teal);
  background: var(--soft);
}

.form-check .field-hint-toggle {
  top: 8px;
  right: 8px;
}

@media (max-width: 680px) {
  .topbar {
    min-height: 72px;
    padding: 12px 16px;
  }

  .brand img {
    width: 128px;
    height: auto;
  }

  .brand-mark {
    display: none;
  }

  .page {
    padding-top: 20px;
  }

  .launchpad-card {
    padding: 20px 16px;
  }

  .launchpad-card > h1,
  .launchpad-card > h1.h3,
  .launchpad-card > h1.h4,
  main > h1,
  main > h1.h3 {
    font-size: 24px;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-inline,
  .form-inline .form-control,
  .form-actions .btn {
    width: 100%;
  }
}
