:root {
  color-scheme: dark;
  --bg: #050506;
  --panel: rgba(20, 21, 24, 0.92);
  --panel-2: #1b1d21;
  --border: #34373d;
  --text: #f4f5f7;
  --muted: #aeb5be;
  --red: #ed1c24;
  --red-bright: #ff4555;
  --cyan: #00c2de;
  --gold: #f4bd43;
  --green: #56d890;
  --warning: #ffb454;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, #291018 0%, transparent 42%),
    linear-gradient(145deg, #050506 0%, #090a0d 65%, #050506 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 9px 12px;
  border-radius: 7px;
  background: white;
  color: #090a0d;
  font-size: 12px;
  font-weight: 800;
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}

.ambient-one {
  width: 30vw;
  height: 30vw;
  top: 5vh;
  right: -12vw;
  background: var(--red);
}

.ambient-two {
  width: 25vw;
  height: 25vw;
  bottom: -10vw;
  left: 30vw;
  background: var(--cyan);
  opacity: 0.08;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 5, 6, 0.82);
  backdrop-filter: blur(18px);
}

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

.eyebrow,
.section-label {
  color: var(--red-bright);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 1px 0 0;
  font-size: 24px;
  line-height: 1;
}

.top-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #70747b;
  box-shadow: 0 0 0 5px rgba(112, 116, 123, 0.1);
}

.status-dot.ready {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(86, 216, 144, 0.11);
}

.status-dot.error {
  background: var(--red);
}

.mi300x-badge {
  margin-left: 12px;
  padding: 7px 11px;
  border: 1px solid rgba(0, 194, 222, 0.45);
  border-radius: 999px;
  color: #b8f5ff;
  background: rgba(0, 194, 222, 0.08);
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(520px, 1.8fr) minmax(290px, 1fr);
  gap: 14px;
  padding: 14px 18px;
  min-height: calc(100vh - 118px);
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.compose-panel,
.intelligence-panel {
  padding: 17px;
}

.timeline-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 15px;
}

.timeline-heading {
  padding: 17px 18px 0;
}

.step {
  display: grid;
  place-items: center;
  min-width: 31px;
  height: 31px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.panel-heading h2 {
  margin: 0;
  font-size: 17px;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.suggestions {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.suggestion {
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: 1px solid #33363c;
  border-radius: 10px;
  background: #181a1e;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.suggestion:hover,
.suggestion.selected {
  transform: translateY(-1px);
  border-color: var(--red);
  background: rgba(225, 0, 26, 0.08);
}

.suggestion:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.suggestion-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed #3a3d44;
  border-radius: 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.suggestion-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  color: var(--red-bright);
  background: rgba(225, 0, 26, 0.12);
  font-size: 17px;
}

.suggestion strong,
.suggestion small {
  display: block;
}

.suggestion strong {
  font-size: 11px;
}

.suggestion small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.prompt-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

textarea {
  width: 100%;
  height: 118px;
  resize: vertical;
  border: 1px solid #3a3d44;
  border-radius: 11px;
  outline: none;
  padding: 12px;
  background: #0e0f12;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 0, 26, 0.12);
}

textarea[readonly] {
  cursor: not-allowed;
  opacity: 0.72;
}

.prompt-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 16px;
  margin-top: 5px;
  color: #777d86;
  font-size: 8px;
  line-height: 1.4;
}

.prompt-meta > :last-child {
  text-align: right;
}

.form-message.error {
  color: #ff7c86;
}

.form-message.warning,
#char-count.warning {
  color: var(--warning);
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 9px;
}

button {
  border: 0;
  font: inherit;
}

.primary,
.secondary {
  height: 41px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.primary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  background: var(--red);
  color: white;
}

.primary:hover {
  background: #ff2036;
}

.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary {
  padding: 0 13px;
  background: #272a30;
  color: var(--muted);
}

.secondary:hover:not(:disabled) {
  background: #343840;
  color: var(--text);
}

.primary:focus-visible,
.secondary:focus-visible,
.suggestion:focus-visible,
.artifact:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid #8ae8f5;
  outline-offset: 2px;
}

.pool,
.distribution,
.route-detail {
  margin-top: 17px;
}

.model-row,
.distribution-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 9px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.model-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.model-row strong,
.distribution-row strong {
  display: block;
  font-size: 10px;
}

.model-row small,
.distribution-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

.model-price,
.distribution-count {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.model-identity {
  min-width: 0;
}

.model-identity .model-role {
  max-width: 190px;
  color: #858c96;
}

.model-price {
  max-width: 104px;
  text-align: right;
}

.model-price strong {
  color: #dce0e5;
  font-size: 8px;
  line-height: 1.35;
}

.model-price small {
  font-size: 7px;
}

.pool-note {
  margin: 9px 0 0;
  color: #858c96;
  font-size: 8px;
  line-height: 1.45;
}

.run-meta {
  margin-left: auto;
  text-align: right;
}

.run-state {
  display: block;
  margin-bottom: 3px;
  color: #858c96;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.run-state.working {
  color: #b8f5ff;
}

.run-state.success {
  color: var(--green);
}

.run-state.warning {
  color: var(--warning);
}

.run-state.error {
  color: #ff7c86;
}

.run-clock {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.agent-visibility {
  padding: 8px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.agent-map {
  display: grid;
  grid-template-columns: minmax(95px, 1fr) 24px repeat(3, minmax(92px, 1fr));
  gap: 7px;
  align-items: center;
}

.agent-node {
  position: relative;
  min-width: 0;
  min-height: 82px;
  padding: 9px 10px 8px;
  border: 1px solid #34373d;
  border-radius: 9px;
  background: #17191d;
  opacity: 0.48;
  transition: 180ms ease;
}

.agent-node.seen {
  opacity: 0.82;
}

.agent-node.active {
  opacity: 1;
  border-color: var(--red);
  box-shadow: 0 0 22px rgba(225, 0, 26, 0.14);
}

.agent-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.agent-node-top > span,
.agent-node > strong,
.agent-activity,
.agent-model {
  display: block;
}

.agent-node-top > span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.agent-node > strong {
  margin-top: 4px;
  font-size: 10px;
}

.agent-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #555b64;
}

.agent-node.seen .agent-live-dot {
  background: #8d949e;
}

.agent-node.active .agent-live-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(86, 216, 144, 0.1);
}

.agent-activity {
  min-height: 19px;
  margin-top: 4px;
  overflow: hidden;
  color: #969da6;
  font-size: 8px;
  line-height: 1.2;
}

.agent-model {
  margin-top: 5px;
  overflow: hidden;
  color: #cfd3d8;
  font-size: 7px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-model i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
}

.agent-model.waiting {
  color: #656b74;
  font-weight: 500;
}

.agent-connector {
  display: flex;
  align-items: center;
  color: #656b74;
  font-size: 13px;
}

.agent-connector::before,
.agent-connector::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--red), #51565f);
}

.agent-connector::after {
  display: none;
}

.agent-summary {
  margin: 8px 1px 0;
  color: #858c96;
  font-size: 8px;
  line-height: 1.4;
}

.timeline {
  flex: 1;
  min-height: 370px;
  max-height: calc(100vh - 365px);
  overflow-y: auto;
  padding: 4px 18px 20px;
  scrollbar-color: #454a52 #17191d;
}

.timeline.empty {
  display: grid;
  place-items: center;
}

.empty-state {
  max-width: 420px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  margin: 12px 0 7px;
  color: var(--text);
}

.empty-state p {
  font-size: 12px;
  line-height: 1.5;
}

.pulse-logo {
  display: inline-grid;
  place-items: center;
  width: 55px;
  height: 55px;
  border: 1px solid rgba(225, 0, 26, 0.55);
  border-radius: 15px;
  background: rgba(225, 0, 26, 0.1);
  font-size: 24px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 12px rgba(225, 0, 26, 0);
  }
}

.event {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  margin: 10px 0;
}

.event-meta {
  padding-top: 7px;
  color: var(--muted);
  font-size: 8px;
  text-align: right;
}

.event-card {
  border: 1px solid #34373d;
  border-left: 4px solid #656b74;
  border-radius: 10px;
  padding: 10px 12px;
  background: #15171a;
}

.event-card.route {
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.035), transparent),
    #15171a;
}

.event-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 14px;
  margin-bottom: 5px;
}

.event-badges:empty {
  display: none;
}

.event-agent,
.effort-badge {
  display: inline-flex;
  align-items: center;
  min-height: 15px;
  padding: 2px 6px;
  border: 1px solid #3d4148;
  border-radius: 999px;
  color: #9fa6af;
  background: #202329;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.event-agent.subagent {
  border-color: rgba(0, 194, 222, 0.32);
  color: #a9edf6;
  background: rgba(0, 194, 222, 0.07);
}

.effort-badge {
  border-color: rgba(244, 189, 67, 0.3);
  color: #f7d98e;
  background: rgba(244, 189, 67, 0.065);
}

.effort-badge.effort-off {
  border-color: #41454c;
  color: #9fa6af;
  background: #202329;
}

.event-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
}

.event-copy {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.event-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 7px;
  color: #d7dbe0;
  font-size: 8px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.event-stats span:last-child {
  color: #b8f5ff;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.chip {
  padding: 3px 6px;
  border: 1px solid #41454c;
  border-radius: 999px;
  color: #c9cdd2;
  background: #21242a;
  font-size: 8px;
}

.result {
  margin: 0 18px 18px;
  border: 1px solid rgba(86, 216, 144, 0.35);
  border-radius: 12px;
  background: rgba(86, 216, 144, 0.055);
  overflow: hidden;
}

.result.failure {
  border-color: rgba(237, 28, 36, 0.38);
  background: rgba(237, 28, 36, 0.055);
}

.hidden {
  display: none !important;
}

.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(86, 216, 144, 0.18);
}

.result-heading h3 {
  margin: 3px 0 0;
  font-size: 14px;
}

.result-status {
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.result.failure .result-heading {
  border-bottom-color: rgba(237, 28, 36, 0.18);
}

.result.failure .result-status {
  color: #ff7c86;
}

.result-body {
  max-height: 230px;
  overflow-y: auto;
  padding: 14px 15px;
  color: #e6e8eb;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.artifact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 15px 14px;
}

.artifact {
  padding: 6px 9px;
  border: 1px solid #3d7f5a;
  border-radius: 7px;
  color: #aff4ca;
  font-size: 9px;
  text-decoration: none;
}

.artifact:hover {
  border-color: var(--green);
  background: rgba(86, 216, 144, 0.08);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.metric {
  padding: 11px;
  border: 1px solid #34373d;
  border-radius: 10px;
  background: #17191d;
}

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

.metric span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.metric strong {
  margin-top: 5px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.metric.premium strong {
  color: var(--gold);
}

.metric.savings strong {
  color: var(--green);
}

.metric.savings strong.negative {
  color: #ff7c86;
}

.token-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #34373d;
  border-radius: 9px;
  background: #34373d;
}

.token-strip > span {
  padding: 8px 9px;
  background: #15171a;
}

.token-strip small,
.token-strip strong {
  display: block;
}

.token-strip small {
  color: #7e858e;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.token-strip strong {
  margin-top: 3px;
  color: #dce0e5;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.cost-bar-wrap {
  margin-top: 14px;
  padding: 11px;
  border: 1px solid #34373d;
  border-radius: 10px;
  background: #121417;
}

.cost-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
}

.cost-bar {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #342b12, #4a241c);
}

.cost-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--red));
  transition: width 300ms ease;
}

.cost-fill.over {
  background: linear-gradient(90deg, var(--warning), var(--red));
}

.cost-bar-wrap p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.cost-scope {
  margin-top: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(244, 189, 67, 0.22);
  border-radius: 9px;
  background: rgba(244, 189, 67, 0.045);
}

.cost-scope strong {
  color: #f7d98e;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cost-scope p {
  margin: 5px 0 0;
  color: #a7adb5;
  font-size: 8px;
  line-height: 1.5;
}

.route-placeholder {
  margin-top: 8px;
  padding: 12px;
  border: 1px dashed #40434a;
  border-radius: 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.route-card {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #3c4047;
  border-radius: 11px;
  background: #121417;
}

.route-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.035), transparent);
}

.route-kicker {
  color: #777d86;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.route-model {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 900;
}

.route-location {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.route-decision {
  max-width: 125px;
  padding: 4px 7px;
  border: 1px solid #454951;
  border-radius: 999px;
  color: #dce0e5;
  background: #22252a;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.route-explanation,
.effort-panel,
.route-signals {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.route-explanation strong {
  color: #dce0e5;
  font-size: 9px;
}

.route-explanation p,
.effort-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.effort-panel {
  background: rgba(244, 189, 67, 0.025);
}

.effort-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.effort-heading span {
  color: #858c96;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.effort-heading strong {
  color: #f7d98e;
  font-size: 10px;
}

.effort-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.effort-meter span {
  height: 5px;
  border-radius: 999px;
  background: #30343a;
}

.effort-meter span.filled {
  background: linear-gradient(90deg, #8f6b25, var(--gold));
}

.effort-meter span.current {
  box-shadow: 0 0 0 2px rgba(244, 189, 67, 0.18);
}

.route-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
  gap: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background: #34373d;
}

.route-facts > span {
  min-width: 0;
  padding: 9px 10px;
  background: #16181c;
}

.route-facts small,
.route-facts strong {
  display: block;
}

.route-facts small {
  color: #777d86;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.route-facts strong {
  margin-top: 3px;
  overflow: hidden;
  color: #dce0e5;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-signals:empty {
  display: none;
}

.signal-group + .signal-group {
  margin-top: 10px;
}

.signal-group > span {
  color: #858c96;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.signal-group .chips {
  margin-top: 5px;
}

.route-ranking {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 8px;
}

.route-ranking summary {
  cursor: pointer;
  color: #aeb5be;
  font-weight: 750;
}

.route-ranking code {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: #8e959e;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 7px;
  line-height: 1.5;
}

footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 13px;
  padding: 0 20px 14px;
  color: #777d86;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-arrow {
  color: var(--red);
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 300px 1fr;
  }

  .intelligence-panel {
    grid-column: 1 / -1;
  }

  .timeline {
    max-height: 620px;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 16px 18px;
  }

  .top-status {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .mi300x-badge {
    margin-left: 0;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .timeline-heading {
    padding-right: 13px;
    padding-left: 13px;
  }

  .agent-map {
    grid-template-columns: 1fr 1fr;
  }

  .agent-connector {
    display: none;
  }

  .agent-visibility {
    padding-right: 13px;
    padding-left: 13px;
  }

  .timeline {
    min-height: 430px;
    max-height: 65vh;
    padding-right: 13px;
    padding-left: 13px;
  }

  .event {
    grid-template-columns: 58px 1fr;
    gap: 7px;
  }

  .result {
    margin-right: 13px;
    margin-left: 13px;
  }

  footer {
    padding-top: 4px;
  }
}

@media (max-width: 430px) {
  .brand {
    gap: 10px;
  }

  .agent-map {
    grid-template-columns: 1fr;
  }

  .prompt-meta {
    display: block;
  }

  .prompt-meta > :last-child {
    display: block;
    margin-top: 3px;
    text-align: left;
  }

  .event {
    display: block;
  }

  .event-meta {
    margin: 8px 0 3px;
    padding: 0;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* AMD corporate visual system */

:root {
  --bg: #030303;
  --panel: #0b0b0c;
  --panel-2: #121213;
  --border: #303030;
  --border-strong: #5e5e5e;
  --text: #f5f5f5;
  --muted: #9d9fa2;
  --red: #ed1c24;
  --red-bright: #ff3038;
  --cyan: #00c2de;
  --gold: #c1a968;
  --green: #00c2de;
  --warning: #f26522;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

body {
  background:
    linear-gradient(115deg, transparent 0 74%, rgba(237, 28, 36, 0.035) 74% 74.15%, transparent 74.15%),
    linear-gradient(25deg, transparent 0 34%, rgba(255, 255, 255, 0.018) 34% 34.08%, transparent 34.08%),
    #030303;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  z-index: -3;
  top: 0;
  left: 0;
  width: 34vw;
  height: 6px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%);
}

.amd-grid {
  position: fixed;
  z-index: -4;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.amd-grid::before,
.amd-grid::after {
  content: "";
  position: absolute;
  opacity: 0.15;
}

.amd-grid::before {
  top: 96px;
  left: 3vw;
  width: min(27vw, 430px);
  height: min(27vw, 430px);
  border-top: min(6vw, 92px) solid #636466;
  border-right: min(6vw, 92px) solid #636466;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent 48%);
  mask-image: linear-gradient(135deg, #000 12%, rgba(0, 0, 0, 0.25) 82%);
}

.amd-grid::after {
  top: min(27vw, 360px);
  left: 3vw;
  width: min(17vw, 270px);
  height: min(17vw, 270px);
  border-bottom: min(4.5vw, 68px) solid #636466;
  border-left: min(4.5vw, 68px) solid #636466;
  mask-image: linear-gradient(315deg, #000 10%, rgba(0, 0, 0, 0.2) 88%);
}

.ambient {
  z-index: -2;
  border-radius: 0;
  filter: none;
  pointer-events: none;
}

.ambient-one {
  width: 52vw;
  height: 2px;
  top: 21vh;
  right: -14vw;
  opacity: 0.42;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  transform: rotate(-23deg);
  transform-origin: center;
}

.ambient-two {
  width: 48vw;
  height: 1px;
  bottom: 16vh;
  left: -12vw;
  opacity: 0.18;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  transform: rotate(-23deg);
  transform-origin: center;
}

.topbar {
  position: relative;
  min-height: 82px;
  padding: 18px 28px 17px;
  border-bottom: 1px solid #3d3d3d;
  background: rgba(3, 3, 3, 0.98);
  backdrop-filter: none;
}

.topbar::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: min(34vw, 430px);
  height: 4px;
  background: var(--red);
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%);
}

.topbar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 48px;
  width: 58px;
  height: 18px;
  border-top: 3px solid var(--red);
  border-right: 3px solid var(--red);
}

.brand {
  gap: 18px;
}

.amd-logo {
  display: block;
  width: 124px;
  height: auto;
  flex: 0 0 auto;
}

.brand-rule {
  width: 1px;
  height: 38px;
  background: #555;
}

.eyebrow,
.section-label {
  color: #c6c6c9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1 {
  margin-top: 4px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.top-status {
  font-size: 12px;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 0;
  transform: rotate(45deg);
  box-shadow: none;
}

.status-dot.ready {
  box-shadow: 0 0 0 3px rgba(104, 197, 138, 0.1);
}

.mi300x-badge {
  position: relative;
  margin-left: 14px;
  padding: 7px 15px 7px 12px;
  border: 1px solid #5a5a5a;
  border-left: 3px solid var(--red);
  border-radius: 0;
  color: #fff;
  background: #111;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.layout {
  gap: 12px;
  padding: 16px 18px 12px;
}

.panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.014), transparent 34%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.panel::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -1px;
  left: -1px;
  width: 78px;
  height: 3px;
  background: var(--red);
}

.panel::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: -1px;
  right: -1px;
  width: 18px;
  height: 18px;
  border-top: 1px solid #6a6a6a;
  border-right: 1px solid #6a6a6a;
  pointer-events: none;
}

.compose-panel,
.intelligence-panel {
  padding: 18px;
}

.panel-heading {
  gap: 11px;
  padding-bottom: 13px;
  border-bottom: 1px solid #272727;
}

.timeline-heading {
  padding: 18px 18px 13px;
}

.step {
  min-width: 34px;
  height: 29px;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  background: var(--red);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.panel-heading h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.panel-heading p {
  color: #929297;
  font-size: 10px;
}

.suggestions {
  gap: 5px;
}

.suggestion {
  position: relative;
  padding: 11px 10px;
  border: 1px solid #303033;
  border-left: 3px solid #303033;
  border-radius: 0;
  background: #101011;
}

.suggestion::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-top: 1px solid #5b5b5d;
  border-right: 1px solid #5b5b5d;
}

.suggestion:hover,
.suggestion.selected {
  transform: translateX(3px);
  border-color: #4a4a4d;
  border-left-color: var(--red);
  background: #171718;
}

.suggestion-icon {
  width: 25px;
  height: 25px;
  border: 1px solid rgba(237, 28, 36, 0.5);
  border-radius: 0;
  color: #fff;
  background: rgba(237, 28, 36, 0.12);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
  font-size: 14px;
}

.suggestion strong {
  font-size: 10px;
  letter-spacing: 0.02em;
}

.suggestion small {
  font-size: 8px;
}

.prompt-label {
  color: #b7b7ba;
  font-size: 9px;
  letter-spacing: 0.12em;
}

textarea {
  border: 1px solid #3d3d40;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(237, 28, 36, 0.06), transparent 22px),
    #070708;
}

textarea:focus {
  border-color: var(--red);
  box-shadow: inset 3px 0 0 var(--red);
}

.primary,
.secondary {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.primary {
  padding-right: 19px;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
  background: var(--red);
}

.primary:hover {
  background: #ff2d35;
}

.secondary {
  border: 1px solid #3e3e41;
  background: #171719;
}

.pool,
.distribution,
.route-detail {
  border-top-color: #303033;
}

.model-row,
.distribution-row {
  border-bottom-color: #29292c;
}

.model-color {
  width: 7px;
  height: 20px;
  border-radius: 0;
}

.model-price strong,
.model-row strong,
.distribution-row strong {
  letter-spacing: 0.02em;
}

.run-state {
  color: #a7a7aa;
  letter-spacing: 0.14em;
}

.agent-visibility {
  background:
    linear-gradient(90deg, rgba(237, 28, 36, 0.035), transparent 32%),
    #080809;
}

.agent-node {
  min-height: 80px;
  border: 1px solid #303033;
  border-radius: 0;
  background: #101011;
}

.agent-node::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-top: 1px solid #555;
  border-right: 1px solid #555;
}

.agent-node.active {
  border-color: #555;
  box-shadow: inset 3px 0 0 var(--red);
}

.agent-live-dot {
  border-radius: 0;
  transform: rotate(45deg);
}

.agent-node.active .agent-live-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

.agent-connector {
  color: var(--red);
}

.agent-connector::before,
.agent-connector::after {
  background: linear-gradient(90deg, var(--red), #4a4a4d);
}

.timeline {
  background:
    linear-gradient(rgba(255, 255, 255, 0.017) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.017) 1px, transparent 1px),
    #080809;
  background-size: 36px 36px;
}

.empty-state {
  max-width: 520px;
}

.amd-empty-state {
  padding: 26px;
  border-left: 1px solid rgba(237, 28, 36, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
}

.amd-hero-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 19px;
  border: 1px solid #4b4b4e;
  background: #0c0c0d;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}

.amd-hero-mark img {
  display: block;
  width: 43px;
  height: auto;
  image-rendering: auto;
}

.empty-kicker {
  margin-bottom: 8px;
  color: var(--red-bright);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.empty-state h3 {
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.event-card {
  border-radius: 0;
  background: #101011;
}

.event-card.route {
  background:
    linear-gradient(90deg, rgba(237, 28, 36, 0.03), transparent 34%),
    #101011;
}

.event-agent,
.effort-badge,
.chip {
  border-radius: 0;
}

.result {
  border-radius: 0;
  background: #0d0d0e;
}

.result-status {
  color: #fff;
  background: var(--red);
  padding: 3px 6px;
}

.artifact {
  border-radius: 0;
  border-left: 3px solid var(--red);
}

.metric {
  border-radius: 0;
  background: #101011;
}

.metric::before {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  margin-bottom: 7px;
  background: #5a5a5e;
}

.metric.premium::before,
.metric.savings::before {
  background: var(--red);
}

.metric.premium strong {
  color: #fff;
}

.token-strip {
  border-radius: 0;
  background: #38383b;
}

.token-strip > span {
  background: #0f0f10;
}

.cost-bar-wrap {
  border-radius: 0;
  background: #0f0f10;
}

.cost-bar {
  border-radius: 0;
  background: #242426;
}

.cost-fill {
  border-radius: 0;
  background: var(--red);
}

.cost-fill.over {
  background: repeating-linear-gradient(
    -45deg,
    var(--red),
    var(--red) 7px,
    #a41218 7px,
    #a41218 14px
  );
}

.cost-scope {
  border: 1px solid #363639;
  border-left: 3px solid var(--red);
  border-radius: 0;
  background: #0e0e0f;
}

.cost-scope strong {
  color: #fff;
}

.route-placeholder {
  border-radius: 0;
}

.route-card {
  border-radius: 0;
  background: #0b0b0c;
}

.route-header {
  background:
    linear-gradient(90deg, rgba(237, 28, 36, 0.05), transparent 55%),
    #101011;
}

.route-decision {
  border-radius: 0;
  border-left: 3px solid var(--red);
  background: #18181a;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
}

.effort-badge {
  border-left: 2px solid var(--red);
  color: #e7e7e8;
  background: #19191b;
}

.effort-panel {
  background: rgba(237, 28, 36, 0.018);
}

.effort-heading strong {
  color: #fff;
}

.effort-meter span {
  border-radius: 0;
}

.effort-meter span.filled {
  background: var(--red);
}

.effort-meter span.current {
  box-shadow: 0 0 0 1px #fff;
}

.route-facts {
  background: #343437;
}

.route-facts > span {
  background: #0f0f10;
}

footer {
  align-items: center;
  min-height: 38px;
  padding: 8px 20px 11px;
  border-top: 1px solid #272729;
  color: #88888d;
  background: #030303;
}

.footer-logo {
  width: 118px;
  height: auto;
  opacity: 0.8;
}

.footer-divider {
  width: 1px;
  height: 15px;
  background: #4b4b4e;
}

.footer-arrow {
  color: var(--red);
}

@media (max-width: 760px) {
  .topbar {
    min-height: auto;
    padding: 16px 18px 14px;
  }

  .amd-logo {
    width: 104px;
  }

  .brand-rule {
    height: 31px;
  }

  h1 {
    font-size: 19px;
  }

  .mi300x-badge {
    margin-left: 0;
  }

  .amd-empty-state {
    border-right: 0;
  }
}

@media (max-width: 430px) {
  .amd-logo {
    width: 90px;
  }

  .brand-rule {
    display: none;
  }

  .eyebrow {
    font-size: 7px;
  }

  h1 {
    font-size: 17px;
  }
}
