:root {
  --bg: #0b1020;
  --panel: #11182a;
  --panel2: #151e33;
  --line: #26324d;
  --text: #e7ecf7;
  --muted: #93a0b8;
  --accent: #76a7ff;
  --danger: #ff7d8b;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, sans-serif; overflow: hidden; }
button, .button, input { font: inherit; }
button, .button, .upload-label {
  border: 1px solid var(--line); background: #1b2742; color: var(--text); border-radius: 7px;
  padding: 7px 11px; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover, .upload-label:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
.hidden { display: none !important; }
.login-view { height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 50% 10%, #1c2b4e, var(--bg) 55%); }
.login-card { width: min(390px, 90vw); background: rgba(17,24,42,.96); border: 1px solid var(--line); padding: 34px; border-radius: 18px; box-shadow: 0 24px 80px #0008; }
.login-card h1 { margin: 14px 0 3px; font-size: 28px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.login-card label, .dialog-card label { display: grid; gap: 7px; margin: 14px 0; color: var(--muted); }
.login-card input, .dialog-card input { width: 100%; border: 1px solid var(--line); background: #0d1424; color: var(--text); padding: 11px; border-radius: 7px; }
.login-card button { width: 100%; margin-top: 10px; padding: 11px; background: #315da8; }
.brand-mark { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 25px; background: linear-gradient(135deg,#7cb0ff,#3654a8); }
.brand-mark.small { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }
.error { min-height: 20px; color: var(--danger); margin-top: 12px; }
.app-view { height: 100%; display: grid; grid-template-rows: 52px 1fr; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 13px; background: #0e1526; border-bottom: 1px solid var(--line); }
.brand, .top-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { color: var(--muted); padding: 0 8px; }
.button.ghost { background: transparent; }
.button.danger { background: #3a1e2a; border-color: #633243; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 310px; grid-template-rows: minmax(260px, 62%) minmax(160px, 38%); }
.editor-pane, .explorer-pane, .terminal-pane { min-width: 0; min-height: 0; background: var(--panel); }
.editor-pane { grid-column: 1; grid-row: 1; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.explorer-pane { grid-column: 2; grid-row: 1 / 3; display: grid; grid-template-rows: 43px auto auto 1fr; }
.terminal-pane { grid-column: 1; grid-row: 2; }
.pane-toolbar { height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.pane-toolbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pane-toolbar button { padding: 5px 9px; }
#editor { height: calc(100% - 43px); }
#terminal { height: calc(100% - 43px); padding: 7px; background: #080c14; }
.breadcrumb { padding: 9px 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 1px solid var(--line); }
.file-actions { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.file-actions button, .upload-label { flex: 1; text-align: center; padding: 6px; }
.file-list { min-height: 0; overflow: auto; padding: 5px; }
.file-list.dragover { outline: 2px dashed var(--accent); outline-offset: -8px; background: #162744; }
.file-row { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 7px; border-radius: 6px; cursor: pointer; }
.file-row:hover { background: #1b2742; }
.file-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .size { color: var(--muted); font-size: 12px; }
.file-context { display: flex; gap: 4px; }
.file-context button { padding: 3px 6px; opacity: 0; }
.file-row:hover .file-context button { opacity: 1; }
dialog { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 14px; padding: 0; width: min(460px, 92vw); }
dialog::backdrop { background: #000a; }
.dialog-card { padding: 24px; }
.dialog-card h2 { margin-top: 0; }
.dialog-card p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: 48% 25% 27%; }
  .editor-pane { grid-column: 1; grid-row: 1; border-right: 0; }
  .explorer-pane { grid-column: 1; grid-row: 2; }
  .terminal-pane { grid-column: 1; grid-row: 3; }
  .top-actions .ghost { display: none; }
}
