/* SYUBEA coding center - Python IDE page */

:root {
  --py-font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --py-mono: "D2Coding", "Cascadia Code", Consolas, "Courier New", "Malgun Gothic", monospace;
  --py-brand: #52E0C8;
  --py-brand-dark: #0E9F8E;
  --py-ink: #0b2b27;
  --py-panel: #0d1b24;
  --py-panel-2: #0a151c;
  --py-line: rgba(255,255,255,.12);
  --py-text: #d7e3ea;
  --py-muted: #7f9bb0;
}

html, body.python-play {
  height: 100%;
  margin: 0;
}

body.python-play {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #071a22;
  color: var(--py-text);
  font-family: var(--py-font);
}

/* ---- top bar ------------------------------------------------------------ */

.py-topbar {
  flex: 0 0 auto;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  background: var(--py-ink);
  color: #fff;
  border-bottom: 1px solid var(--py-line);
  position: relative;
  z-index: 4000;
  box-sizing: border-box;
}

.py-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.py-back {
  color: #8FE8DA;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.py-back:hover { color: #52E0C8; }

.py-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.py-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(82,224,200,.12);
  border: 1px solid rgba(82,224,200,.3);
  color: #52E0C8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}

.py-member {
  font-size: 12px;
  color: rgba(255,255,255,.72);
  white-space: nowrap;
}

.py-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  position: relative;
}

.py-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.py-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.py-btn:disabled { opacity: .45; cursor: default; }
.py-btn-primary { background: #2f9b73; border-color: #2f9b73; }
.py-btn-primary:hover { background: #278a65; border-color: #278a65; }
.py-btn-danger { background: #b23a48; border-color: #b23a48; }
.py-btn-danger:hover { background: #9d303d; border-color: #9d303d; }
.py-btn-ghost { background: transparent; border-color: transparent; color: rgba(255,255,255,.78); }
.py-btn-ghost:hover { background: rgba(255,255,255,.1); }

.py-command-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 10px;
  right: auto;
  z-index: 4100;
  width: min(440px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 8px;
  background: #0b2028;
  color: var(--py-text);
  border: 1px solid rgba(82,224,200,.3);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}

.py-command-menu[hidden] { display: none !important; }

.py-command-group { padding: 4px 0 6px; }
.py-command-group + .py-command-group { border-top: 1px solid rgba(255,255,255,.1); }

.py-command-group-title {
  padding: 2px 8px 5px;
  color: var(--py-brand);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
}

.py-command-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
}

.py-command-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--py-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.py-command-item:hover,
.py-command-item:focus {
  background: rgba(82,224,200,.12);
  border-color: rgba(82,224,200,.3);
  outline: none;
}

.py-command-label {
  flex: 0 0 auto;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

.py-command-code {
  flex: 1 1 auto;
  min-width: 0;
  color: #8FE8DA;
  font-family: var(--py-mono);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- shell / panes ------------------------------------------------------ */

#coding-shell {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

#app {
  height: 100%;
  display: flex;
  align-items: stretch;
  min-height: 0;
}

#py-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--py-panel);
}

#py-editor-pane {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--py-line);
}

.py-tabbar {
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  background: var(--py-panel-2);
  border-bottom: 1px solid var(--py-line);
  font-size: 12px;
  position: relative;
  z-index: 10;
}

.py-tabbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.py-command-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  background: rgba(255,255,255,.06);
  color: var(--py-text);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.py-command-toggle:hover,
.py-command-toggle:focus {
  background: rgba(82,224,200,.12);
  border-color: rgba(82,224,200,.3);
  outline: none;
}

.py-command-toggle:disabled { opacity: .45; cursor: default; }

.py-command-caret {
  color: var(--py-brand);
  font-size: 8px;
  line-height: 1;
}

.py-file-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--py-text);
  font-weight: 700;
  white-space: nowrap;
}

.py-file-tab::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--py-brand);
  box-shadow: 0 0 8px rgba(82,224,200,.55);
}

.py-tab-btn {
  border: 0;
  background: transparent;
  padding: 2px 2px;
  font: inherit;
  font-size: 12px;
  color: var(--py-text);
  cursor: pointer;
}

.py-tab-btn:not(.is-active):not(:disabled) {
  opacity: .62;
}

.py-tab-btn:hover:not(:disabled),
.py-tab-btn:focus-visible {
  color: var(--py-brand);
  opacity: 1;
  outline: none;
}

.py-tab-btn:disabled {
  opacity: .45;
  cursor: default;
}

.py-lang-badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(82,224,200,.28);
  background: rgba(82,224,200,.08);
  color: var(--py-brand);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

#py-editor {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--py-panel);
}

#py-editor .CodeMirror {
  height: 100%;
}

/* ---- error bar ---------------------------------------------------------- */

.py-error-bar {
  flex: 0 0 auto;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: #2a1418;
  border-top: 1px solid rgba(255,138,138,.35);
  border-bottom: 1px solid rgba(255,138,138,.25);
  color: #ffb3b3;
  font-size: 11.5px;
}
.py-error-bar[hidden] { display: none; }

.py-error-message {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.py-error-goto {
  flex: 0 0 auto;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,138,138,.5);
  background: rgba(255,138,138,.12);
  color: #ffd0d0;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

/* ---- status bar --------------------------------------------------------- */

.py-statusbar {
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  background: var(--py-panel-2);
  border-top: 1px solid var(--py-line);
  color: var(--py-muted);
  font-size: 11px;
  white-space: nowrap;
}

.py-statusbar .ok { color: var(--py-brand); }
.py-statusbar .bad { color: #ff8a8a; }

/* ---- console ------------------------------------------------------------ */

#py-console-pane {
  flex: 0 0 32%;
  min-height: 150px;
  max-height: 45%;
  display: flex;
  flex-direction: column;
  background: #0c0c0c;
  border-top: 1px solid var(--py-line);
}

.py-console-head {
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  background: #1f1f1f;
  border-bottom: 1px solid #333;
  color: #ccc;
  font-size: 11px;
}

.py-console-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.py-console-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #61afef;
}

.py-console-clear {
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid #444;
  background: #262626;
  color: #ccc;
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}
.py-console-clear:hover { background: #333; color: #fff; }

#py-console {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 12px;
  background: #0c0c0c;
  color: #ccc;
  font-family: var(--py-mono);
  font-size: 12px;
  line-height: 1.55;
  scrollbar-color: #444 #0c0c0c;
}

#py-console::-webkit-scrollbar { width: 10px; }
#py-console::-webkit-scrollbar-track { background: #0c0c0c; }
#py-console::-webkit-scrollbar-thumb { background: #333; border-radius: 5px; }
#py-console::-webkit-scrollbar-thumb:hover { background: #444; }

.py-line {
  white-space: pre-wrap;
  word-break: break-word;
}
.py-banner { color: #abb2bf; }
.py-hint { color: #e5c07b; }
.py-out { color: #d4d4d4; }
.py-log { color: #abb2bf; }
.py-send { color: #61afef; }
.py-recv { color: #98c379; }
.py-sim { color: #7f9bb0; }
.py-wait { color: #e5c07b; }
.py-info { color: #52e0c8; }
.py-stop { color: #ffb86b; }
.py-error { color: #e06c75; }
.py-err { color: #ff8a8a; }

.py-prompt {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ccc;
}
.py-prompt-path { color: #52e0c8; }
.py-prompt-cmd { color: #fff; }
.py-caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  background: #ccc;
  vertical-align: text-bottom;
  animation: py-caret-blink 1s steps(2, start) infinite;
}

@keyframes py-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---- 3D simulator ------------------------------------------------------- */

#sim-panel {
  flex: 0 0 42%;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0b1d2a;
  color: #fff;
  border-left: 1px solid var(--py-line);
  position: relative;
  z-index: 2;
}

#sim-panel.collapsed { display: none; }

.sim-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--py-line);
  font-size: 13px;
  font-weight: 800;
}

.sim-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(82,224,200,.12);
  border: 1px solid rgba(82,224,200,.3);
  color: #52E0C8;
  font-size: 10px;
  font-weight: 800;
}

.sim-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #071a22;
  overflow: hidden;
}

#sim3d-canvas,
#sim2d-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
#sim3d-canvas[hidden],
#sim2d-canvas[hidden] { display: none; }

.sim-hud {
  position: absolute;
  inset: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.sim-hud-top {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.sim-stat {
  min-width: 58px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(4,20,30,.72);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.65);
  font-size: 10px;
  line-height: 1.3;
}
.sim-stat span { display: block; font-size: 10px; }
.sim-stat strong {
  display: block;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.sim-stat small {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,.65);
  margin-left: 2px;
}

.sim-hud-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.sim-status {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(4,20,30,.72);
  color: #52E0C8;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.sim-block {
  max-width: 60%;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(4,20,30,.72);
  color: rgba(255,255,255,.82);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-crosshair {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  pointer-events: none;
}
#sim-panel[data-camera="fpv"] .sim-crosshair { display: block; }

.sim-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.sim-flash.on { opacity: .75; }

.sim-rec {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: #b00020;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.sim-rec.on { display: block; }

.sim-emergency {
  position: absolute;
  inset: 0;
  display: none;
  border: 3px solid #ff5252;
  box-shadow: inset 0 0 40px rgba(255,82,82,.45);
  pointer-events: none;
}
.sim-emergency.on { display: block; }

.sim-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4,20,30,.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.sim-loading.hide { display: none; }

.sim-controls {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--py-line);
  background: #0b1d2a;
}
.sim-controls button {
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.sim-controls button:hover { background: rgba(255,255,255,.15); }
.sim-controls button.primary { background: #2f9b73; border-color: #2f9b73; }
.sim-controls button.primary:hover { background: #278a65; }
.sim-controls button:disabled { opacity: .45; cursor: default; }

/* ---- toast -------------------------------------------------------------- */

#top-menu-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 6000;
  transform: translateX(-50%) translateY(10px);
  padding: 8px 14px;
  border-radius: 999px;
  background: #0b2b27;
  border: 1px solid rgba(82,224,200,.35);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  max-width: 90vw;
  text-align: center;
}
#top-menu-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- modals ------------------------------------------------------------- */

.py-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4,18,32,.65);
}
.py-modal.show { display: flex; }
.py-modal[hidden] { display: none !important; }

.py-modal-card {
  width: min(92vw, 760px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #0b2740;
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  overflow: hidden;
}

.py-modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  font-size: 15px;
  font-weight: 800;
}

.py-modal-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.py-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
  color: var(--py-text);
  font-size: 12.5px;
  line-height: 1.7;
}
.py-modal-body h3 {
  margin: 16px 0 6px;
  color: var(--py-brand);
  font-size: 14px;
}
.py-modal-body h3:first-child { margin-top: 0; }
.py-modal-body p { margin: 6px 0; }
.py-modal-body ul { margin: 6px 0; padding-left: 20px; }
.py-modal-body li { margin: 3px 0; }
.py-modal-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  font-family: var(--py-mono);
  font-size: 11.5px;
}
.py-modal-body pre {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: #071a22;
  overflow: auto;
  font-family: var(--py-mono);
  font-size: 11.5px;
  line-height: 1.55;
}

.py-modal-foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.py-api-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 11.5px;
}
.py-api-table th,
.py-api-table td {
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.py-api-table th { color: var(--py-brand); font-weight: 700; }
.py-api-table code { white-space: nowrap; }

.py-examples-list {
  display: grid;
  gap: 8px;
}
.py-example-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.py-example-item:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--py-brand);
}
.py-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.py-example-name { font-size: 13px; font-weight: 800; }
.py-example-tag {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(82,224,200,.3);
  background: rgba(82,224,200,.12);
  color: var(--py-brand);
  font-size: 10px;
  font-weight: 800;
}
.py-example-desc { font-size: 11.5px; color: rgba(255,255,255,.65); }

/* ---- CodeMirror theme --------------------------------------------------- */

.cm-s-syubea.CodeMirror {
  height: 100%;
  background: var(--py-panel);
  color: var(--py-text);
  font-family: var(--py-mono);
  font-size: 13px;
  line-height: 1.55;
}

.cm-s-syubea .CodeMirror-gutters {
  background: var(--py-panel-2);
  border-right: 1px solid #17313d;
}
.cm-s-syubea .CodeMirror-linenumber { color: #5c7a8a; }
.cm-s-syubea .CodeMirror-cursor { border-left: 2px solid var(--py-brand); }
.cm-s-syubea .CodeMirror-selected { background: #1f4a5a; }
.cm-s-syubea .CodeMirror-activeline-background { background: #122a36; }
.cm-s-syubea .CodeMirror-matchingbracket {
  color: var(--py-brand);
  border-bottom: 1px solid var(--py-brand);
}
.cm-s-syubea .CodeMirror-nonmatchingbracket { color: #ff8a8a; }

.cm-s-syubea .cm-keyword { color: #7fd7ff; }
.cm-s-syubea .cm-def { color: var(--py-brand); }
.cm-s-syubea .cm-variable { color: var(--py-text); }
.cm-s-syubea .cm-variable-2 { color: #c7d6e0; }
.cm-s-syubea .cm-string { color: #a8e6a1; }
.cm-s-syubea .cm-number { color: #ffd166; }
.cm-s-syubea .cm-comment { color: #6b8a99; font-style: italic; }
.cm-s-syubea .cm-operator { color: #c7d6e0; }
.cm-s-syubea .cm-builtin { color: #ffb86b; }
.cm-s-syubea .cm-property { color: #8fd3ff; }
.cm-s-syubea .cm-punctuation { color: #b8c7d1; }
.cm-s-syubea .cm-error { color: #ff8a8a; }

.CodeMirror-lint-mark-error {
  border-bottom: 2px wavy #ff8a8a;
}
.CodeMirror-lint-tooltip {
  background: #0b2740;
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  font-family: var(--py-font);
  font-size: 11.5px;
}
.CodeMirror-hints {
  background: #0b2740;
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  font-family: var(--py-mono);
  font-size: 12px;
}
.CodeMirror-hint-active {
  background: #2f9b73;
  color: #fff;
}

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 1200px) {
  #sim-panel { flex-basis: 40%; }
}

@media (max-width: 1024px) {
  .py-topbar {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    padding: 6px 10px;
  }
  .py-topbar-left { flex: 1 1 100%; }
  .py-topbar-actions { flex: 1 1 100%; justify-content: flex-start; }

  #sim-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(92vw, 360px);
    flex-basis: auto;
    transform: translateX(100%);
    transition: transform .2s ease;
    box-shadow: -10px 0 30px rgba(0,0,0,.35);
  }
  #sim-panel.collapsed { display: flex; }
  #sim-panel.open { transform: none; }

  #py-console-pane { min-height: 130px; flex-basis: 30%; }
}

@media (max-width: 820px) {
  .py-title { font-size: 12px; }
  .py-member { display: none; }
  .py-btn { height: 28px; padding: 0 8px; font-size: 11px; }
  .py-statusbar { font-size: 10px; }
  #py-console { font-size: 11.5px; }
}

@media (max-width: 640px) {
  .py-topbar-actions { gap: 5px; }
  .py-btn { padding: 0 7px; }
  .py-badge { display: none; }
  #py-console-pane { min-height: 120px; }
  #py-console { padding: 6px 8px; font-size: 11px; }
  .py-console-head { padding: 0 8px; }
  .py-modal { padding: 10px; }
  .py-modal-card { width: 100%; max-height: 90vh; }
  .py-command-menu { width: calc(100vw - 20px); max-height: 65vh; }
  .py-command-code { font-size: 10.5px; }
}

@media (max-width: 480px) {
  .py-back { font-size: 12px; }
  .py-title { font-size: 11px; }
  .py-topbar-actions .py-btn { font-size: 10.5px; }
  .py-tabbar { font-size: 11px; }
  .py-lang-badge { display: none; }
  .py-command-label { font-size: 11px; }
  .py-command-code { font-size: 10px; }
}

.py-member,
.py-topbar-actions a[href$="/account/login"] { display: none; }
