:root {
  --bg: #f4efe6;
  --panel: rgba(255, 250, 242, 0.88);
  --panel-strong: #fffaf2;
  --ink: #1c1917;
  --muted: #5c544d;
  --line: rgba(28, 25, 23, 0.12);
  --accent: #b6452c;
  --accent-soft: rgba(182, 69, 44, 0.12);
  --accent-2: #1c6b63;
  --shadow: 0 22px 60px rgba(76, 49, 21, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(28, 107, 99, 0.16), transparent 28%),
    radial-gradient(circle at right, rgba(182, 69, 44, 0.14), transparent 26%),
    linear-gradient(180deg, #f8f3eb 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(28, 25, 23, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 25, 23, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, black 50%, transparent 88%);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.hero-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  justify-content: flex-end;
}

.hero-action-buttons {
  display: flex;
  order: 2;
  justify-content: flex-end;
  gap: 8px;
}

.eyebrow,
.panel-kicker,
.status-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.58rem;
  color: var(--muted);
}

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

h1 {
  font-size: clamp(1.85rem, 3.3vw, 2.75rem);
  line-height: 0.94;
  margin-top: 3px;
}

.hero-copy {
  margin-top: 10px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.hero-card,
.panel,
.subpanel {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 16px;
  border-radius: 20px;
  transform: rotate(1.5deg);
}

.hero-card p {
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.88rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(170px, 0.5fr) minmax(0, 1.84fr) minmax(195px, 0.6fr);
  grid-template-areas:
    "registers editor memory"
    "messages messages messages";
  gap: 16px;
  align-items: stretch;
}

.panel {
  border-radius: 22px;
  padding: 16px;
}

.workbench-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.registers-pane {
  grid-area: registers;
}

.editor-pane {
  grid-area: editor;
}

.memory-pane {
  grid-area: memory;
  align-self: start;
}

.messages-pane {
  grid-area: messages;
}

.pane-titlebar {
  margin: -16px -16px 0;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(28, 25, 23, 0.78), rgba(28, 25, 23, 0.68));
  color: #fff7ef;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-align: center;
}

.pane-titlebar p {
  font-weight: 500;
}

.pane-titlebar-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  padding-top: 8px;
  padding-bottom: 8px;
}

.pane-content {
  padding-top: 12px;
  min-height: 0;
}

.registers-content,
.memory-content {
  flex: 1;
  overflow: hidden;
}

.registers-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 -16px -16px;
  padding: 0 0 16px;
  padding-top: 0;
}

.memory-content {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  margin: 0 -16px -16px;
  padding: 0 0 16px;
  padding-top: 0;
}

.editor-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  margin: 0 -16px;
  padding-top: 0;
}

.editor-content .toolbar,
.editor-content .status-row {
  margin-left: 16px;
  margin-right: 16px;
}

.messages-content {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  margin: 0 -16px -16px;
  padding: 12px 16px 16px;
  background: #1a1715;
  border-radius: 0 0 22px 22px;
  min-height: 300px;
}

.panel-heading,
.subpanel-heading,
.status-row,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sample-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.76rem;
  color: var(--muted);
}

.hero-sample-picker {
  min-width: 240px;
  align-self: end;
  order: 1;
}

select,
textarea,
button {
  font: inherit;
}

select,
textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
}

.workspace-window {
  position: relative;
  flex: 1;
}

.workspace-view {
  display: none;
}

.workspace-view.active {
  display: block;
}

.assembly-editor.workspace-view.active {
  display: grid;
}

.assembly-editor {
  grid-template-columns: 48px minmax(0, 1fr);
  height: 377px;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--panel-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.editor-lines,
.editor-highlight,
.editor-input {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.45;
  tab-size: 8;
}

.editor-lines {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 12px 8px 12px 6px;
  background: rgba(28, 25, 23, 0.06);
  border-right: 1px solid rgba(28, 25, 23, 0.08);
  color: rgba(28, 25, 23, 0.78);
  text-align: right;
  user-select: none;
  white-space: pre;
  overflow: hidden;
}

.editor-line-list {
  display: block;
  will-change: transform;
}

.editor-line-number {
  display: block;
  padding: 0 3px;
  border-radius: 3px;
}

.editor-line-number.active {
  background: rgba(28, 107, 99, 0.12);
  color: #1c6b63;
  font-weight: 500;
}

.editor-highlight-content {
  display: block;
  will-change: transform;
}

.editor-highlight-line {
  display: block;
  min-height: 1.45em;
  padding: 0 4px;
  margin: 0 -4px;
  border-radius: 3px;
}

.editor-highlight-line.active {
  background: rgba(28, 107, 99, 0.09);
}

.editor-stack {
  position: relative;
  height: 100%;
  min-height: 0;
  background: rgba(255, 250, 242, 0.92);
}

.editor-highlight,
.editor-input {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  padding: 12px 14px;
  white-space: pre;
}

.editor-highlight {
  pointer-events: none;
  overflow: hidden;
  color: #201a16;
}

.editor-input {
  resize: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  caret-color: #16110e;
  outline: none;
  box-shadow: none;
}

.editor-input::selection {
  background: rgba(28, 107, 99, 0.18);
}

.tok-directive {
  color: #1f9a2e;
  font-weight: 500;
}

.tok-label {
  color: #8d4a52;
  font-weight: 500;
}

.tok-opcode {
  color: #2434c4;
}

.tok-register {
  color: #1f9a2e;
  font-weight: 500;
}

.tok-number,
.tok-symbol {
  color: #2d2a27;
}

.tok-string {
  color: #8b4c14;
}

.tok-comment {
  color: #908882;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(28, 107, 99, 0.12);
  border: 1px solid rgba(28, 107, 99, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  width: fit-content;
}

.editor-view-toggle {
  margin-left: auto;
}

.messages-view-toggle {
  margin-left: auto;
  padding: 2px;
  background: rgba(255, 247, 239, 0.12);
  border-color: rgba(255, 247, 239, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.12);
}

.messages-view-toggle .toggle-btn {
  min-width: 82px;
  padding: 4px 10px;
  background: transparent;
  color: rgba(255, 247, 239, 0.74);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.messages-view-toggle .toggle-btn:hover {
  background: rgba(255, 247, 239, 0.12);
  color: #fffaf4;
}

.messages-view-toggle .toggle-btn.active {
  background: #fff7ef;
  color: #1f1a17;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.16),
    inset 0 0 0 1px rgba(28, 25, 23, 0.08);
}

.memory-view-toggle {
  margin-left: auto;
  padding: 1px;
  background: rgba(255, 247, 239, 0.12);
  border-color: rgba(255, 247, 239, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.memory-view-toggle .toggle-btn {
  min-width: 50px;
  padding: 3px 8px;
  background: transparent;
  color: rgba(255, 247, 239, 0.74);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.memory-view-toggle .toggle-btn:hover {
  background: rgba(255, 247, 239, 0.12);
  color: #fffaf4;
}

.memory-view-toggle .toggle-btn.active {
  background: #fff7ef;
  color: #1f1a17;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(28, 25, 23, 0.08);
}

.messages-view-toggle .toggle-btn:focus-visible {
  outline: 2px solid rgba(255, 247, 239, 0.9);
  outline-offset: 2px;
}

.memory-view-toggle .toggle-btn:focus-visible {
  outline: 2px solid rgba(255, 247, 239, 0.9);
  outline-offset: 2px;
}

.toolbar-combined {
  align-items: center;
  justify-content: flex-start;
}

.toggle-btn {
  padding: 7px 11px;
  background: transparent;
  font-size: 0.82rem;
  color: var(--accent-2);
  font-weight: 500;
}

.toggle-btn.active {
  background: var(--accent-2);
  color: #fff8f0;
  box-shadow: 0 8px 18px rgba(28, 107, 99, 0.18);
}

.program-memory-view {
  height: 377px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--panel-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.program-memory-list {
  display: block;
  max-height: 377px;
  overflow: auto;
  background: transparent;
}

.program-memory-header-row,
.program-memory-row,
.program-memory-empty {
  display: grid;
  grid-template-columns: 24px 70px 112px minmax(118px, 0.72fr) minmax(150px, 1.28fr);
  align-items: center;
}

.program-memory-header-row {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 14px 6px;
  background: #f1ded3;
  color: var(--ink);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(28, 25, 23, 0.1);
}

.program-memory-row {
  padding: 4px 14px;
  align-items: stretch;
  border-bottom: 1px solid rgba(28, 25, 23, 0.06);
  background: rgba(255, 250, 242, 0.96);
  font-size: 0.74rem;
}

.program-memory-header-row span:first-child {
  text-align: center;
}

.program-memory-row:nth-child(odd) {
  background: rgba(244, 239, 230, 0.72);
}

.program-memory-row.active {
  background: rgba(28, 107, 99, 0.22);
  box-shadow: inset 4px 0 0 #1c6b63, inset 0 0 0 1px rgba(28, 107, 99, 0.2);
  font-weight: 500;
}

.program-memory-row .addr,
.program-memory-row .machine-code,
.program-memory-row .source,
.program-memory-row .editor-source {
  align-self: center;
  font-family: "IBM Plex Mono", monospace;
}

.program-memory-header-row span:not(:first-child),
.program-memory-row .addr,
.program-memory-row .machine-code,
.program-memory-row .source,
.program-memory-row .editor-source {
  padding-left: 4px;
}

.program-memory-row .source,
.program-memory-row .editor-source,
.program-memory-header-row span:nth-child(4),
.program-memory-header-row span:nth-child(5) {
  padding-left: 2px;
}

.breakpoint-cell {
  display: flex;
  appearance: none;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 1em;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0;
  line-height: 0;
}

.breakpoint-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 1em;
}

.breakpoint-cell::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 0;
  background: center / contain no-repeat url("../assets/icons/breakpoint.svg");
  opacity: 0;
  transform: scale(0.88);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.breakpoint-cell:hover {
  background: rgba(182, 69, 44, 0.08);
  transform: none;
}

.breakpoint-cell:hover::before,
.breakpoint-cell:focus-visible::before {
  opacity: 0.45;
  transform: scale(0.94);
}

.breakpoint-cell.active {
  background: transparent;
}

.breakpoint-cell.active::before {
  opacity: 1;
  transform: scale(1);
}

.program-memory-row .source,
.program-memory-row .editor-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  font-size: 0.72rem;
}

.program-memory-row .source {
  white-space: nowrap;
}

.program-memory-row .editor-source {
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}

.program-memory-row .editor-source-line-number {
  flex: 0 0 auto;
  white-space: pre;
}

.program-memory-row .editor-source-code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
  tab-size: 8;
}

.program-memory-empty {
  display: block;
  padding: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

select {
  min-width: 180px;
  padding: 5px 10px;
  font-size: 0.84rem;
}

.toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(28, 25, 23, 0.08);
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
  font-size: 0.84rem;
}

button:hover {
  transform: translateY(-1px);
  background: rgba(28, 25, 23, 0.14);
}

button.primary {
  background: var(--accent);
  color: white;
}

button.primary:hover {
  background: #9b3924;
}

button.stop {
  background: #6f2d20;
  color: white;
}

button.stop:hover {
  background: #5c241a;
}

button:disabled,
button:disabled:hover {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.utility-btn {
  padding: 6px 11px;
  background: rgba(28, 25, 23, 0.1);
  font-size: 0.76rem;
}

.status-row {
  flex-wrap: wrap;
  padding: 7px 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  gap: 8px;
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.status-row.error {
  background: linear-gradient(180deg, rgba(176, 36, 24, 0.28), rgba(176, 36, 24, 0.22));
  box-shadow:
    inset 0 0 0 1px rgba(176, 36, 24, 0.28),
    0 10px 24px rgba(176, 36, 24, 0.08);
}

.status-row.success {
  background: linear-gradient(180deg, rgba(52, 133, 72, 0.28), rgba(52, 133, 72, 0.22));
  box-shadow:
    inset 0 0 0 1px rgba(52, 133, 72, 0.28),
    0 10px 24px rgba(52, 133, 72, 0.08);
}

.status-row.error .status-label {
  color: rgba(109, 16, 8, 0.82);
}

.status-row.success .status-label {
  color: rgba(25, 82, 39, 0.82);
}

.status-row.error strong {
  color: #6d1008;
}

.status-row.success strong {
  color: #195227;
}

.status-row.error .current-instruction-fields {
  color: #7a251d;
}

.status-row.success .current-instruction-fields {
  color: #2e6a3c;
}

.status-row strong {
  display: block;
  margin-top: 1px;
  font-size: 0.8rem;
}

.current-instruction-fields {
  display: block;
  margin-top: 2px;
  font-family: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  font-size: 0.72rem;
  color: #4f5f70;
  white-space: normal;
}

.register-grid,
.flag-grid,
.memory-grid {
  display: grid;
  gap: 6px;
  margin-top: 0;
}

.register-grid {
  display: block;
  flex: 1;
  margin: 0;
}

.register-flags {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(28, 25, 23, 0.08);
}

.flag-card,
.memory-cell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
}

.register-table {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.memory-grid {
  display: flex;
  flex: 1;
  min-height: 0;
  margin: 0;
}

.memory-table {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.register-table-header,
.register-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
}

.memory-table-header {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(130px, 0.9fr);
  align-items: center;
}

.register-table-header,
.memory-table-header {
  padding: 7px 10px 6px;
  background: rgba(182, 69, 44, 0.1);
  color: var(--ink);
  font-size: 0.7rem;
  border-bottom: 1px solid rgba(28, 25, 23, 0.1);
}

.register-table-header {
  padding-left: 12px;
  padding-right: 12px;
}

.memory-table-header {
  padding-left: 16px;
  padding-right: 16px;
}

.memory-table-header,
.memory-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 14px;
}

.register-table-header span:last-child,
.memory-table-header span:last-child {
  border-left: 1px solid rgba(28, 25, 23, 0.12);
  padding-left: 10px;
}

.register-table-body {
  display: grid;
  overflow: hidden;
}

.memory-table-body {
  display: grid;
  max-height: 463px;
  overflow: auto;
}

.register-row {
  padding: 5px 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.2;
}

.memory-row {
  display: grid;
  align-items: center;
  padding: 5px 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.2;
}

.register-row:nth-child(odd) {
  background: rgba(255, 250, 242, 0.96);
}

.register-row:nth-child(even) {
  background: rgba(244, 239, 230, 0.72);
}

.memory-row:nth-child(odd) {
  background: rgba(255, 250, 242, 0.96);
}

.memory-row:nth-child(even) {
  background: rgba(244, 239, 230, 0.72);
}

.register-row.special {
  background: rgba(28, 107, 99, 0.08);
}

.register-row.modified {
  background: rgba(182, 69, 44, 0.14);
  box-shadow: none;
}

.register-row.modified .register-name,
.register-row.modified .register-value,
.memory-row.modified .memory-address,
.memory-row.modified .memory-word,
.memory-row.modified .memory-ascii {
  color: var(--ink);
  font-weight: inherit;
}

.register-row.highlight {
  background: rgba(182, 69, 44, 0.18);
  box-shadow:
    inset 4px 0 0 rgba(182, 69, 44, 0.86),
    inset 0 0 0 1px rgba(182, 69, 44, 0.26);
}

.register-row.highlight .register-name,
.register-row.highlight .register-value {
  color: #7a2515;
}

.memory-row.modified {
  background: rgba(182, 69, 44, 0.14);
  box-shadow: none;
}

.memory-row-ascii.modified {
  background: inherit;
}

.memory-row.highlight {
  background: rgba(182, 69, 44, 0.18);
  box-shadow:
    inset 4px 0 0 rgba(182, 69, 44, 0.86),
    inset 0 0 0 1px rgba(182, 69, 44, 0.26);
}

.memory-row-ascii.highlight {
  background: inherit;
  box-shadow: none;
}

.memory-row.highlight .memory-address,
.memory-row.highlight .memory-word,
.memory-row.highlight .memory-ascii {
  color: #7a2515;
}

.memory-row-ascii.highlight .memory-address,
.memory-row-ascii.highlight .memory-ascii {
  color: var(--ink);
}

.register-name,
.register-value {
  color: var(--ink);
}

.register-name {
  white-space: nowrap;
}

.register-value {
  text-align: left;
  cursor: default;
}

.memory-address,
.memory-word,
.memory-ascii {
  color: var(--ink);
}

.memory-table-ascii .memory-table-header,
.memory-row-ascii {
  grid-template-columns: 10ch minmax(16ch, 1fr);
  column-gap: 10px;
}

.memory-ascii {
  display: grid;
  grid-template-columns: repeat(16, 1ch);
  width: 16ch;
  max-width: 100%;
  overflow: hidden;
  white-space: pre;
}

.memory-ascii-char.modified {
  color: var(--ink);
  background: rgba(182, 69, 44, 0.18);
  font-weight: inherit;
}

.memory-ascii-char.highlight {
  color: #7a2515;
  background: rgba(182, 69, 44, 0.16);
  font-weight: inherit;
}

.memory-ascii-placeholder {
  color: rgba(28, 25, 23, 0.34);
}

.memory-cell .addr {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.register-value,
.memory-cell .value,
.console {
  font-family: "IBM Plex Mono", monospace;
}

.register-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(28, 25, 23, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(244, 239, 230, 0.98));
  color: var(--ink);
  box-shadow:
    0 18px 40px rgba(76, 49, 21, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  z-index: 30;
}

.register-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.register-tooltip-header {
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.register-tooltip-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 12px;
  align-items: baseline;
}

.register-tooltip-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.register-tooltip-value {
  min-width: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  color: var(--ink);
  word-break: break-word;
}

.flag-grid {
  grid-template-columns: repeat(4, minmax(32px, 1fr));
  gap: 4px;
  margin-left: 0;
  max-width: 100%;
}

.flag-card {
  padding: 8px;
  text-align: center;
}

.flag-card.active {
  border-color: rgba(28, 107, 99, 0.35);
  background: rgba(28, 107, 99, 0.12);
}

.flag-card.active .label {
  text-transform: uppercase;
  font-weight: 700;
}

.flag-card.highlight {
  border-color: rgba(182, 69, 44, 0.35);
  background: rgba(182, 69, 44, 0.12);
  box-shadow: inset 0 0 0 1px rgba(182, 69, 44, 0.08);
}

.flag-card .label {
  display: block;
  font-size: 0.66rem;
  color: var(--muted);
}

.flag-card .value {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  font-weight: 700;
}

.memory-cell {
  padding: 7px 8px;
}

.console {
  margin-top: 0;
  height: 100%;
  overflow: auto;
  padding: 0 2px;
  border-radius: 0;
  background: transparent;
  color: #f7f0e7;
  line-height: 1.35;
  font-size: 0.78rem;
}

.messages-view {
  display: none;
  min-height: 0;
}

.messages-view.active {
  display: flex;
  flex: 1;
  min-height: 0;
}

.footer-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid rgba(28, 25, 23, 0.08);
  font-size: 0.82rem;
  text-align: center;
}

code {
  font-family: "IBM Plex Mono", monospace;
}

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

  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "editor"
      "registers"
      "memory"
      "messages";
  }

  .assembly-editor,
  .editor-stack {
    height: 377px;
    min-height: 0;
  }

  .program-memory-view {
    height: 377px;
    min-height: 0;
  }

  .pane-titlebar-split {
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 18px, 1440px);
    padding-top: 12px;
  }

  .panel,
  .hero-card {
    border-radius: 16px;
  }

  .flag-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 96px;
  }

  .program-memory-header-row,
  .program-memory-row {
    grid-template-columns: 1fr;
  }

  .pane-titlebar-split,
  .panel-heading {
    flex-wrap: wrap;
  }


}
