.code-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 30px;
}
.code-open-button {
  min-height: 82px;
  padding: 16px 18px;
  color: #202124;
  background: #fff;
  border: 1px solid #cfd5dc;
  border-radius: 2px;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.code-open-button:hover,
.code-open-button:focus-visible {
  border-color: #202124;
  box-shadow: 0 8px 22px rgba(28,39,51,.09);
  transform: translateY(-2px);
}
.code-open-button strong,
.code-open-button span { display: block; }
.code-open-button strong { font-size: 1.04rem; }
.code-open-button span { margin-top: 4px; color: #68717b; font-size: .88rem; }

.floating-code-modal { position: fixed; inset: 0; z-index: 300; display: none; }
.floating-code-modal.is-open { display: block; }
.floating-code-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.76); }
.floating-code-window {
  position: absolute;
  inset: 4vh 4vw;
  display: grid;
  grid-template-rows: 46px 42px minmax(0,1fr);
  overflow: hidden;
  color: #d4d4d4;
  background: #1e1e1e;
  border: 1px solid #4b4b4b;
  border-radius: 9px;
  box-shadow: 0 26px 90px rgba(0,0,0,.56);
  animation: floatingCodeIn .2s ease-out;
}
.floating-code-titlebar {
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #181818;
  border-bottom: 1px solid #303030;
}
.floating-code-titlebar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floating-code-close {
  width: 34px;
  height: 34px;
  color: #ddd;
  background: transparent;
  border: 0;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}
.floating-code-toolbar {
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #aeb4ba;
  background: #202020;
  border-bottom: 1px solid #313131;
  font-size: .84rem;
}
.floating-code-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floating-code-actions { display: flex; gap: 7px; }
.floating-code-actions button,
.floating-code-actions a {
  padding: 5px 10px;
  color: #ddd;
  background: #2b2b2b;
  border: 1px solid #4b4b4b;
  text-decoration: none;
  cursor: pointer;
}
.floating-editor-shell {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: 58px minmax(0,1fr) 118px;
  overflow: hidden;
  background: #1e1e1e;
}
.floating-code-lines,
.floating-code-scroll {
  margin: 0;
  padding-top: 17px;
  padding-bottom: 17px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 14px;
  line-height: 1.65;
}
.floating-code-lines {
  padding-right: 13px;
  overflow: hidden;
  color: #858585;
  text-align: right;
  user-select: none;
}
.floating-code-scroll {
  min-width: 0;
  padding-left: 18px;
  overflow: auto;
  color: #d4d4d4;
  white-space: pre;
  outline: none;
  scrollbar-color: #858585 #1e1e1e;
}
.floating-code-scroll code { color: inherit; background: transparent; }
.floating-code-minimap {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
  border-left: 1px solid #2c2c2c;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
.floating-minimap-lines { position: absolute; inset: 10px 8px; overflow: hidden; }
.floating-mini-line {
  position: absolute;
  left: 0;
  height: 1px;
  background: #7b858f;
  opacity: .56;
  pointer-events: none;
}
.floating-mini-line.comment { background: #6a9955; opacity: .76; }
.floating-mini-line.command { background: #4ec9b0; opacity: .74; }
.floating-minimap-viewport {
  position: absolute;
  left: 2px;
  right: 2px;
  min-height: 28px;
  border: 1px solid rgba(185,195,205,.72);
  background: rgba(130,145,160,.16);
  cursor: grab;
}
.floating-minimap-viewport:active { cursor: grabbing; }
.code-loading { color: #9da5ad; }
.tok-comment { color: #6a9955; }
.tok-string { color: #ce9178; }
.tok-number { color: #b5cea8; }
.tok-keyword { color: #c586c0; }
.tok-command { color: #4ec9b0; }
.tok-variable { color: #9cdcfe; }
.tok-property { color: #dcdcaa; }
body.floating-code-open { overflow: hidden; }
@keyframes floatingCodeIn { from { opacity: 0; transform: translateY(10px) scale(.987); } to { opacity: 1; transform: none; } }
@media (max-width: 850px) {
  .floating-code-window { inset: 0; border-radius: 0; }
  .floating-editor-shell { grid-template-columns: 48px minmax(0,1fr); }
  .floating-code-minimap { display: none; }
}
@media (max-width: 620px) {
  .code-action-grid { grid-template-columns: 1fr; }
  .floating-code-lines,
  .floating-code-scroll { font-size: 12.5px; }
  .floating-code-toolbar { align-items: flex-start; flex-direction: column; padding-top: 6px; padding-bottom: 6px; }
  .floating-code-window { grid-template-rows: 46px auto minmax(0,1fr); }
}
