:root {
  --bg: #e9e9e6;
  --panel: #bdeff1;
  --panel-2: #b2eaee;
  --line: #96a4aa;
  --line-soft: #b8c6cc;
  --text: #0b2f9a;
  --muted: #5d6a79;
  --addr: #004ad2;
  --bytes: #505c66;
  --insn: #0b2fa8;
  --comment: #1b7f1b;
  --accent: #0056c6;
  --warn: #7b4f10;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #e7e7e4;
  color: var(--text);
  font-family: "Courier New", "Lucida Console", "Consolas", monospace;
  font-weight: 600;
  -webkit-text-size-adjust: 100%;
}

.app {
  width: min(1320px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 4px;
  padding: 4px;
}

.topbar,
.panel {
  border: 1px solid var(--line);
  background: #d8d8d5;
}

.topbar,
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 6px;
  font-size: 11px;
}

.topbar {
  flex-wrap: wrap;
}

.tb-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line-soft);
  background: #efefeb;
  color: var(--muted);
  padding: 1px 5px;
}

.icon-btn,
.small-btn {
  border: 1px solid var(--line);
  background: #ecece8;
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
}

.icon-btn:hover,
.small-btn:hover {
  border-color: #7f8f98;
  background: #f7f7f2;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 4px;
  min-height: 0;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: #deded9;
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.disasm-pane {
  display: flex;
  flex-direction: column;
  min-height: 380px;
}

.disasm-scroll {
  overflow: auto;
  min-height: 0;
}

.disasm-grid {
  display: grid;
  grid-auto-rows: minmax(20px, auto);
  font-size: 11px;
  min-height: 0;
  background: var(--panel);
  min-width: 940px;
}

.row {
  display: grid;
  grid-template-columns: 110px 290px minmax(250px, 1fr) 280px;
  border-bottom: 1px solid rgba(128, 144, 153, 0.3);
}

.row > span {
  padding: 3px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid rgba(140, 152, 163, 0.25);
}

.row.head {
  background: #d4d4cd;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.addr {
  color: var(--addr);
}

.bytes {
  color: var(--bytes);
}

.insn {
  color: var(--insn);
}

.tok-imm {
  color: var(--comment);
  font-weight: 700;
}

.cmt {
  color: var(--comment);
}

.hidden-comments .cmt {
  color: transparent;
}

.hidden-comments .row.head .cmt {
  opacity: 1;
}

.hidden {
  display: none !important;
}

.nudge {
  margin: 4px 6px;
  border: 1px dashed #929ca2;
  color: var(--warn);
  background: #ece9dc;
  padding: 4px 6px;
  font-size: 11px;
}

.hint-box {
  border: 1px solid #adb6be;
  background: #e4e7ea;
  color: #3d4c60;
  font-size: 11px;
  padding: 4px 6px;
}

.hint-box code {
  color: var(--accent);
}

.side-col {
  display: grid;
  gap: 4px;
  grid-template-rows: auto auto 1fr;
}

.side-panel {
  padding-bottom: 4px;
  background: var(--panel);
}

.stack-panel,
.strings-panel {
  background: #ffffff;
  padding-bottom: 0;
}

.kv {
  display: flex;
  justify-content: space-between;
  padding: 2px 6px;
  font-size: 11px;
  border-bottom: 1px solid rgba(147, 156, 167, 0.35);
}

.accent {
  color: var(--accent);
}

.stack {
  margin: 0;
  padding: 4px 6px;
  font-size: 11px;
  color: #3f5568;
  line-height: 1.35;
  white-space: pre;
  background: #ffffff;
}

.strings ul {
  margin: 0;
  padding: 4px 10px;
  list-style: none;
  font-size: 11px;
  background: #ffffff;
}

.strings li {
  color: #506378;
  padding: 1px 0;
}

.search-box {
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
  padding: 4px 6px;
  display: grid;
  gap: 4px;
  font-size: 11px;
  background: #ffffff;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffffd;
  color: var(--text);
  padding: 2px 5px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
}

.probe-msg {
  color: var(--muted);
}

.jump-wrap {
  color: #647487;
}

.jump-label {
  color: var(--accent);
}

.jump-label.dim {
  color: #8290a0;
}

.jump-link {
  color: #0f6f76;
  text-decoration: none;
  border-bottom: 1px dotted #0f6f76;
}

.statusbar {
  display: block;
  padding: 0 2px;
  min-height: 0;
  border: 0;
  background: transparent;
  font-size: 10px;
  line-height: 1.1;
  color: #4e5b67;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: clip;
}

.statusbar span {
  display: inline;
}

.statusbar span + span::before {
  content: " | ";
  color: #7f8b98;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
  }

  .strings {
    grid-column: 1 / -1;
  }
}

@media (max-width: 740px) {
  .app {
    gap: 3px;
    padding: 3px;
  }

  .topbar,
  .statusbar {
    padding: 2px 4px;
    gap: 4px;
    font-size: 10px;
  }

  .tb-left {
    gap: 4px;
  }

  .chip {
    padding: 1px 4px;
  }

  .actions {
    gap: 4px;
  }

  .icon-btn,
  .small-btn {
    min-height: 26px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .panel-head {
    padding: 3px 5px;
  }

  .side-col {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .disasm-pane {
    min-height: 48vh;
  }

  .disasm-grid {
    min-width: 760px;
    font-size: 10px;
  }

  .row {
    grid-template-columns: 86px 170px minmax(180px, 1fr);
  }

  .row .cmt,
  .row.head .cmt {
    display: none;
  }

  .search-box input {
    min-height: 28px;
  }
}

@media (max-width: 480px) {
  .app {
    padding: 2px;
    gap: 2px;
  }

  .topbar {
    align-items: flex-start;
  }

  .tb-right {
    margin-left: auto;
  }

  .disasm-grid {
    min-width: 700px;
  }

  .workspace {
    gap: 3px;
  }
}
