.idea-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 720px) {
  .idea-grid { grid-template-columns: 1fr; }
}

.idea-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: var(--surface2);
  font-size: 0.88rem;
}

.idea-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.ctrl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
}

.ctrl-row input[type="text"],
.ctrl-row select {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.ctrl-row input[type="text"] {
  width: 6rem;
}

.be-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
}

.be-toggles button {
  font-family: var(--mono);
  min-width: 3.2rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.be-toggles button.is-on {
  border-color: var(--ok);
  background: var(--ok-bg);
  font-weight: 700;
}

.mem-rows {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.word-row {
  display: grid;
  grid-template-columns: 3.5rem repeat(4, 1fr) 5.5rem;
  gap: 0.3rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.8rem;
}

@media (max-width: 560px) {
  .word-row {
    grid-template-columns: 2.5rem repeat(4, 1fr);
  }
  .word-row .full { display: none; }
}

.word-row .idx {
  color: var(--muted);
  font-weight: 600;
}

.byte-cell {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.25rem;
  text-align: center;
  background: var(--surface);
}

.byte-cell h3 {
  margin: 0;
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 600;
}

.byte-cell .v {
  margin: 0.1rem 0 0;
  font-weight: 700;
}

.byte-cell.is-en {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.byte-cell.is-hit {
  outline: 2px solid #0369a1;
}

.word-row.is-sel .idx {
  color: var(--text);
  font-weight: 700;
}

.word-row .full {
  font-size: 0.75rem;
  color: var(--muted);
}

.code-box {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0 0 0.55rem;
  padding: 0.75rem 0.85rem;
  background: #1a222c;
  color: #e8eef4;
  border-radius: 8px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

@media (max-width: 560px) {
  .action-grid { grid-template-columns: 1fr; }
}

.action-grid button {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.action-grid button:hover {
  background: var(--surface2);
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: var(--surface2);
}

.status-card h3 {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.status-card .val {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
}

.status-card .note {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.trace-box,
.log-box {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0 0 0.45rem;
  padding: 0.55rem 0.65rem;
  background: #1a222c;
  color: #c8d4e0;
  border-radius: 8px;
  border: 1px solid var(--line);
  max-height: 9rem;
  overflow: auto;
  white-space: pre-wrap;
}

.legend {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.45rem;
}

.warn-box {
  font-size: 0.88rem;
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface2);
}

.warn-box.is-ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.warn-box.is-warn {
  border-color: #b45309;
  background: #fff7ed;
}

.cheat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.cheat-table th,
.cheat-table td {
  border: 1px solid var(--line);
  padding: 0.4rem 0.55rem;
  text-align: left;
}

.cheat-table th {
  background: var(--surface2);
}

.hint-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
}
