:root {
  color-scheme: dark;
  --bg: #0b1117;
  --panel: #111b24;
  --panel-2: #16232d;
  --line: #263844;
  --text: #edf5f7;
  --muted: #8ea3ad;
  --cyan: #28d7e8;
  --green: #48df91;
  --amber: #ffbf5c;
  --red: #ff6f6f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar,
.panel,
.metrics article,
.hero-panel {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #071015;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.1;
}

.brand p,
.hero-copy p,
label,
.helper-text,
.metrics span,
.accounts span {
  color: var(--muted);
}

.status-strip,
.button-row,
.toggles,
.panel-head,
.metrics,
.lower-grid {
  display: flex;
  gap: 10px;
}

.status-strip {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status,
.pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status.live,
.pill.success,
.tag.filled {
  color: #071015;
  border-color: transparent;
  background: var(--green);
}

.tag.rejected {
  color: #240707;
  border-color: transparent;
  background: var(--red);
}

.tag.waiting {
  color: #251805;
  border-color: transparent;
  background: var(--amber);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  margin-top: 18px;
  border-radius: 8px;
}

.hero-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 17, 23, 0.94), rgba(11, 17, 23, 0.54), rgba(11, 17, 23, 0.1));
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
  padding: 44px;
}

.eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-copy h2 {
  max-width: 640px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 560px;
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.55;
}

.metrics {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics article {
  min-height: 92px;
  border-radius: 8px;
  padding: 18px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.workspace {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 1fr;
  gap: 18px;
  align-items: start;
}

.lower-grid {
  align-items: stretch;
  margin-top: 18px;
}

.lower-grid .panel:first-child {
  flex: 0 0 360px;
}

.lower-grid .queue-panel {
  flex: 1;
}

.panel {
  border-radius: 8px;
  padding: 18px;
}

.panel-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

h3 {
  font-size: 18px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c151c;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(40, 215, 232, 0.12);
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  border-color: var(--cyan);
}

button.primary {
  color: #061014;
  border: 0;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

button.wide {
  width: 100%;
}

.order-ticket {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.order-ticket div,
.accounts article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c151c;
  padding: 14px;
}

.order-ticket span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.order-ticket strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.risk-grid,
.connection-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.switch input {
  width: 18px;
  min-height: 18px;
}

.accounts {
  display: grid;
  gap: 12px;
}

.accounts strong,
.accounts span {
  display: block;
}

.accounts span {
  margin-top: 6px;
}

.helper-text {
  margin: -2px 0 14px;
  font-size: 13px;
  line-height: 1.45;
}

.signal-feed {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.signal-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c151c;
  padding: 12px;
  cursor: pointer;
}

.signal-item strong,
.signal-item span {
  display: block;
}

.signal-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.signal-item pre {
  min-height: 0;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  white-space: pre-wrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.payload-panel {
  margin-top: 18px;
}

.parser-debug {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c151c;
  padding: 12px;
}

.parser-debug span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

pre {
  min-height: 180px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #071016;
  color: #c7f7ff;
  padding: 16px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .workspace,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace .panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .topbar,
  .lower-grid,
  .status-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-copy {
    padding: 28px 20px;
  }

  .hero-copy h2 {
    font-size: 36px;
  }

  .workspace,
  .metrics,
  .risk-grid,
  .connection-form,
  .order-ticket {
    grid-template-columns: 1fr;
  }

  .lower-grid .panel:first-child {
    flex-basis: auto;
  }
}
