:root {
  color-scheme: light dark;
  --canvas: #f5f5f7;
  --surface: #fff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d8d8dc;
  --blue: #002fa7;
  --navy: #071a3d;
  --green: #087a55;
  --amber: #9a6700;
  --red: #b42318;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font:
    14px/1.45 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  background: var(--surface);
  padding: 10px;
  z-index: 9;
}
.skip:focus {
  top: 10px;
}
header {
  height: 72px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand,
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}
.brand h1 {
  line-height: 1;
}
.header-actions a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 650;
}
h1 {
  font-size: 22px;
  margin: 1px 0;
}
.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 10px;
  letter-spacing: 1.2px;
  font-weight: 800;
}
.mode {
  font-size: 11px;
  font-weight: 700;
}
.mode span {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #d97706;
  border-radius: 50%;
  margin-right: 7px;
}
.shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}
aside {
  min-width: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
nav {
  max-width: 100%;
  padding: 16px 10px;
}
nav button {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--muted);
}
nav button.active {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  color: var(--blue);
  font-weight: 700;
}
aside footer {
  padding: 18px;
  border-top: 1px solid var(--line);
}
aside footer label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
select,
input {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
main {
  min-width: 0;
}
.market-strip {
  display: grid;
  grid-template-columns: 1.15fr 1.35fr repeat(3, 1fr);
  background: var(--navy);
  color: white;
  border-bottom: 1px solid #163568;
}
.market-strip > div {
  padding: 14px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.13);
}
.market-strip small,
.result-card small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #94a7c9;
  margin-bottom: 4px;
}
.market-strip strong {
  font-size: 12px;
}
.market-strip .ready {
  color: #66e0b7;
}
.market-strip .warning {
  color: #ffd166;
}
.market-strip .danger {
  color: #ff9b97;
}
.toolbar {
  height: 66px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.toolbar small {
  display: block;
  color: var(--muted);
}
button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 7px;
  cursor: pointer;
}
.view {
  display: none;
  padding: 28px;
  max-width: 1300px;
}
.section-kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 800;
}
.view.active {
  display: block;
}
h2 {
  font-size: 23px;
  margin: 0 0 6px;
}
.lead {
  color: var(--muted);
  max-width: 760px;
  margin: 0 0 24px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 26px;
}
.inspector {
  border-left: 1px solid var(--line);
  padding-left: 22px;
  background: transparent;
}
.inspector h3 {
  margin-top: 0;
}
.inspector dl div {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.inspector dt {
  color: var(--muted);
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 16px;
}
.fields label {
  font-size: 12px;
  color: var(--muted);
}
.fields input,
.fields select {
  margin-top: 5px;
  color: var(--text);
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  margin-top: 18px;
}
.primary:disabled,
button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}
.result-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.result-card[hidden] {
  display: none;
}
.result-card > div {
  padding: 16px;
  border-right: 1px solid var(--line);
}
.result-card > div:last-child {
  border-right: 0;
}
.result-card strong {
  font-size: 20px;
  color: var(--text);
}
.secondary {
  margin-right: 8px;
}
.destructive {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, var(--line));
}
.table-wrap {
  overflow: auto;
  border-top: 1px solid var(--line);
  margin-top: 22px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.notice {
  border-left: 3px solid #d97706;
  padding: 8px 18px;
  max-width: 760px;
  background: var(--surface);
}
.notice p {
  color: var(--muted);
}
.danger {
  color: var(--red);
  font-weight: 700;
}
.timeline {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}
.timeline li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 160px 1fr 180px;
  gap: 12px;
}
.timeline code {
  font-size: 11px;
  color: var(--muted);
}
#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  background: #1d1d1f;
  color: white;
  padding: 12px 15px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
#toast.show {
  opacity: 1;
}
[dir="rtl"] nav button,
[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --muted: #aaa;
    --line: #39393d;
    --blue: #6d91ff;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
@media (max-width: 760px) {
  header {
    padding: 0 14px;
  }
  .mode {
    max-width: 120px;
    text-align: right;
  }
  .header-actions a {
    display: none;
  }
  .market-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .market-strip > div:last-child {
    grid-column: 1 / -1;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .shell > aside {
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  nav {
    display: flex;
    overflow: auto;
    padding: 8px;
  }
  nav button {
    width: auto;
    white-space: nowrap;
  }
  .shell > aside footer {
    display: block;
    padding: 8px 14px 12px;
  }
  .shell > aside footer label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  .view {
    padding: 20px 14px;
  }
  .toolbar {
    padding: 0 14px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .result-card {
    grid-template-columns: repeat(2, 1fr);
  }
  .timeline li {
    grid-template-columns: 1fr;
  }
  .toolbar small {
    display: none;
  }
}
