#ti84-emu * { box-sizing: border-box; }
#ti84-emu {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #e6e8ec;
  background: #20242b;
  margin: -15px -15px 0;
  padding: 20px;
}
#ti84-emu h2 { margin: 0 0 8px; font-size: 15px; color: #c9cedb; }

#ti84-emu main {
  display: flex; gap: 20px; padding: 0; align-items: flex-start;
  flex-wrap: wrap;
}

/* ---- quick play ---- */
#ti84-emu .quick-play {
  flex: 1 1 100%; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 4px;
}
#ti84-emu .quick-play button {
  background: #3f7d5a; color: #fff; border: none; border-radius: 8px;
  padding: 12px 20px; cursor: pointer; font-size: 15px; font-weight: 600;
}
#ti84-emu .quick-play button:hover { filter: brightness(1.1); }
#ti84-emu .quick-play button:disabled { opacity: .5; cursor: default; }
#ti84-emu .quick-play .hint { font-size: 12px; color: #8b93a3; }

/* ---- calculator ---- */
#ti84-emu .calc-panel { flex: 0 0 auto; }
#ti84-emu .calc-shell {
  background: #2e3340; border-radius: 18px; padding: 18px;
  width: 520px; max-width: 100%; box-shadow: 0 8px 30px rgba(0,0,0,.45);
}
#ti84-emu .lcd-bezel {
  background: #1a1d24; border-radius: 8px; padding: 14px;
  display: flex; justify-content: center;
}
#ti84-emu #lcd {
  width: 480px; height: 320px; max-width: 100%;
  image-rendering: pixelated; image-rendering: crisp-edges;
  background: #c6d3a9; border-radius: 2px;
}
#ti84-emu .status { margin: 10px 2px; font-size: 13px; color: #9aa3b5; min-height: 18px; }
#ti84-emu .status.running { color: #7fd07f; }
#ti84-emu .status.error { color: #ff7a7a; }
#ti84-emu .status.paused { color: #ffd479; }
#ti84-emu .status.done { color: #8fc7ff; }

#ti84-emu .run-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
#ti84-emu .run-controls button, #ti84-emu .speed-label select {
  background: #3a4150; color: #e6e8ec; border: 1px solid #4a5263;
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px;
}
#ti84-emu .run-controls button:disabled { opacity: .4; cursor: default; }
#ti84-emu .run-controls .danger { border-color: #7a4242; color: #ffb3b3; margin-left: auto; }
#ti84-emu .speed-label { font-size: 13px; color: #9aa3b5; }

/* ---- keypad ---- */
#ti84-emu .keypad { display: flex; flex-direction: column; gap: 6px; }
#ti84-emu .kp-row { display: flex; gap: 6px; }
#ti84-emu .kp-key {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; padding: 6px 2px 5px; font-size: 12px; font-weight: 600;
  background: #454c5c; color: #fff; border: 1px solid #555e72;
  border-radius: 6px; cursor: pointer; user-select: none;
}
#ti84-emu .kp-sub {
  color: #7fb0ff; font-size: 9px; font-weight: 700; line-height: 1;
}
#ti84-emu .kp-main { line-height: 1; }
#ti84-emu .kp-key:active { transform: translateY(1px); filter: brightness(1.25); }
#ti84-emu .kp-soft { background: #2f3542; font-size: 11px; }
#ti84-emu .kp-second { background: #3b5b8c; }
#ti84-emu .kp-alpha { background: #3f7d5a; }
#ti84-emu .kp-arrow { background: #5a6275; font-size: 14px; }
#ti84-emu .kp-num { background: #d8dde8; color: #14171c; font-size: 14px; }
#ti84-emu .kp-enter { background: #3b5b8c; }
#ti84-emu .kp-on { background: #6f4040; }
#ti84-emu .kbd-hint { font-size: 11px; color: #767f91; margin: 10px 2px 0; }

/* ---- side panel ---- */
#ti84-emu .side-panel { flex: 1 1 380px; min-width: 340px; display: flex; flex-direction: column; gap: 16px; }
#ti84-emu .card {
  background: #2a2f3a; border: 1px solid #3a4150; border-radius: 12px; padding: 16px;
  font-size: 13px;
}
#ti84-emu .card p { margin: 6px 0; color: #aab2c2; }
#ti84-emu .card .hint { font-size: 12px; color: #8b93a3; }
#ti84-emu .card code { background: #20242b; padding: 1px 5px; border-radius: 4px; }
#ti84-emu #dropzone.hover { border-color: #7fd07f; background: #2d3a2f; }
#ti84-emu #file-input { margin: 8px 0; color: #aab2c2; }
#ti84-emu .notice { font-size: 12px; color: #9fd09f; margin-top: 6px; white-space: pre-wrap; }

#ti84-emu details.advanced { color: #aab2c2; }
#ti84-emu details.advanced summary { cursor: pointer; color: #c9cedb; margin-bottom: 8px; }

#ti84-emu .prog-row { display: flex; gap: 10px; align-items: center; padding: 5px 0; }
#ti84-emu .prog-row button {
  background: #3f7d5a; color: #fff; border: none; border-radius: 6px;
  padding: 5px 12px; cursor: pointer;
}
#ti84-emu .prog-row button.ghost { background: #3a4150; }
#ti84-emu .vars { font-family: ui-monospace, monospace; font-size: 12px; color: #aab2c2; white-space: pre-wrap; }

#ti84-emu #error-box { border-color: #7a4242; }
#ti84-emu .err-title { color: #ff8a8a; font-weight: 700; margin-bottom: 6px; }
#ti84-emu #error-box pre, #ti84-emu #listing pre {
  background: #20242b; padding: 10px; border-radius: 8px; overflow: auto;
  font-size: 12px; line-height: 1.45; max-height: 420px;
}
#ti84-emu #listing-close { border: none; cursor: pointer; }
