:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#071016;color:#e8f0f6;color-scheme:dark;--panel:#101c25;--panel2:#13232e;--border:#243743;--muted:#8da0ae;--blue:#35a4ff;--green:#29c779;--red:#e14c61}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(circle at 50% -20%,#122735 0,#071016 42%);color:#e8f0f6}header{height:60px;display:grid;grid-template-columns:44px 1fr 44px;align-items:center;padding:0 18px;border-bottom:1px solid #20313c;position:sticky;top:0;background:#071016f2;backdrop-filter:blur(14px);z-index:20}header strong{font-size:17px}.ghost{border:0;background:transparent;color:#dce8f0;font-size:30px;padding:0}.hidden{visibility:hidden}.hidden-display{display:none!important}main{max-width:1180px;margin:auto;padding:24px}.card,.panel{background:linear-gradient(180deg,#111e27,#0f1a22);border:1px solid var(--border);border-radius:14px;padding:16px;box-shadow:0 12px 34px #0000001c;margin-bottom:14px}.project{cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:.15s ease}.project:hover{border-color:#3d5b6d;transform:translateY(-1px)}.project h3{margin:0 0 6px}.muted{color:var(--muted);font-size:13px}.page-heading,.source-topbar{display:flex;justify-content:space-between;align-items:center;margin:4px 0 18px}.page-heading h2,.source-topbar h2{margin:0;font-size:22px}.page-heading p,.source-topbar p{margin:5px 0 0;color:var(--muted);font-size:13px}.tabs{display:flex;background:#0e1a22;border:1px solid #1e303b;border-radius:11px;margin-bottom:20px;overflow:hidden;padding:3px}.tabs button{flex:1;padding:11px;border:0;background:transparent;color:#a9b8c3;border-radius:8px}.tabs .active{color:#fff;background:#172a36;box-shadow:inset 0 -2px var(--blue)}button{background:#1689f8;color:white;border:0;border-radius:8px;padding:9px 13px;cursor:pointer;font-weight:600;transition:.15s ease}button:hover:not(:disabled){filter:brightness(1.08)}button:disabled{opacity:.5;cursor:not-allowed}button.secondary{background:#263945;color:#e4edf3}.ship{background:var(--green);font-size:14px;padding:11px 16px;box-shadow:0 8px 20px #29c77920}.ship b{background:#ffffff25;border-radius:99px;padding:2px 7px;margin-left:5px}.source-action-button{width:104px;height:48px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center}.sourcegrid{display:grid;grid-template-columns:330px minmax(0,1fr);gap:14px;align-items:stretch}.file-panel,.editor-panel{margin:0;min-height:600px}.panel-title{display:flex;align-items:center;justify-content:space-between;padding-bottom:11px;border-bottom:1px solid #20313b}.icon-button{background:#20323e;color:#dce8f0;padding:7px 10px;font-size:12px}.tree{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;max-height:550px;overflow:auto;padding:9px 0}.tree-dir-row,.tree-file{width:100%;display:flex;align-items:center;gap:8px;background:transparent;color:#dfeaf0;border:0;border-radius:7px;padding:7px 8px;text-align:left;font-family:inherit;font-size:inherit;white-space:nowrap}.tree-dir-row{padding-left:calc(8px + var(--depth)*14px);font-weight:650}.tree-file{padding-left:calc(30px + var(--depth)*14px);font-weight:450}.tree-dir-row:hover,.tree-file:hover,.tree-dir-row.selected,.tree-file.selected{background:#19303e}.tree-dir-row.selected,.tree-file.selected{outline:1px solid #3b6b85}.tree-children{margin:0}.tree-children.collapsed{display:none}.tree-arrow{width:11px;color:#7f96a4}.folder-icon{color:#68b7e8;font-size:10px}.file-icon{color:#8196a3}.empty-editor{height:565px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#78909e}.empty-editor h3{color:#c9d7df;margin:12px 0 4px}.empty-editor p{margin:0;max-width:320px}.empty-icon{width:54px;height:54px;border:1px solid #2a414f;border-radius:14px;display:grid;place-items:center;font-size:24px;background:#0b161d}.editor-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.editor-head strong{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}.badge{color:#f3cf70;font-size:11px;margin-left:10px;text-transform:uppercase}textarea,input,select{width:100%;background:#071016;color:#e8f0f6;border:1px solid #314451;border-radius:8px;padding:11px;outline:none}textarea:focus,input:focus{border-color:#3f82a7;box-shadow:0 0 0 3px #3f82a718}textarea{min-height:470px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;resize:vertical}.sql{min-height:160px}.toolbar,.directory-buttons{display:flex;gap:8px;flex-wrap:wrap;margin:11px 0}.status{color:#49d18b}.danger{background:#d9364e}.danger-soft{background:#71313d}.directory-card{display:flex;gap:16px;align-items:center;padding:20px;border:1px solid #29404d;background:#0b171e;border-radius:12px;margin-bottom:14px}.directory-icon{font-size:32px;color:#68b7e8}.directory-card h3{margin:3px 0 4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.directory-card p{margin:0;color:var(--muted);font-size:13px}.eyebrow{text-transform:uppercase;letter-spacing:.09em;color:#718997;font-size:10px;font-weight:700}.directory-help{line-height:1.55}.results{overflow:auto}table{width:100%;border-collapse:collapse;font-size:12px}th,td{padding:8px;border-bottom:1px solid #263743;text-align:left;white-space:nowrap}.row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}.loading-screen{min-height:520px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;color:#dbe8ef}.loading-screen span{font-size:12px;color:var(--muted)}.spinner{width:34px;height:34px;border:3px solid #1d3442;border-top-color:var(--blue);border-radius:50%;animation:spin .75s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.toast-stack{position:fixed;top:76px;right:20px;z-index:100;display:flex;flex-direction:column;gap:9px}.toast{min-width:260px;display:flex;gap:10px;align-items:center;padding:13px 15px;background:#10291f;border:1px solid #276b4a;border-radius:10px;box-shadow:0 14px 40px #0008;transform:translateX(120%);opacity:0;transition:.2s ease}.toast.show{transform:translateX(0);opacity:1}.toast span{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--green);color:#07150e}.toast strong{font-size:13px}.toast.error{background:#30171c;border-color:#7d3440}.toast.error span{background:var(--red)}.ship-status{margin-top:14px;border:1px solid #315063;border-radius:11px;background:#0b171e;overflow:hidden}.ship-status.complete{border-color:#286b4a}.ship-status.failed{border-color:#803744}.ship-status button{width:100%;background:transparent;display:flex;justify-content:space-between;align-items:center;padding:12px 14px;color:#dce8ef}.ship-status button span{display:flex;align-items:center;gap:9px}.status-dot{width:9px;height:9px;border-radius:50%;background:#f1c64d;box-shadow:0 0 0 4px #f1c64d1a}.complete .status-dot{background:var(--green)}.failed .status-dot{background:var(--red)}.ship-terminal{max-height:240px;overflow:auto;background:#050b0f;border-top:1px solid #1c2d37;padding:12px 14px;color:#a9d5b9;font:12px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace}.ship-terminal.collapsed{display:none}@media(max-width:759px){main{padding:14px}.sourcegrid{grid-template-columns:1fr}.file-panel,.editor-panel{min-height:auto}.tree{max-height:360px}.empty-editor{height:320px}.source-topbar{align-items:flex-start}.ship{position:sticky;top:72px;z-index:4}.toast-stack{left:14px;right:14px}.toast{min-width:0}.directory-buttons button{width:100%}}@media(min-width:760px){main{padding:24px}}
.view-loading{min-height:500px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;color:#dbe8ef}.view-loading span{font-size:12px;color:var(--muted)}.source-actions{display:flex;gap:9px;align-items:center}.source-warning{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;margin:-6px 0 14px;padding:11px 13px;border:1px solid #705d28;border-radius:9px;background:#2a2513;color:#f3d778}.source-warning span{font-size:12px;color:#cdbf8c}

/* Prevent selected source files from widening the mobile document. */
.sourcegrid,
.file-panel,
.editor-panel,
.editor-head,
.editor-body,
.editor-actions,
.filetree,
textarea {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.file-panel,
.editor-panel {
  overflow: hidden;
}

textarea {
  display: block;
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  white-space: pre;
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .sourcegrid {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .ship {
    position: static;
    top: auto;
  }
}

/* Branching and history controls */
.branchbar{display:flex;align-items:end;justify-content:space-between;gap:14px;margin:0 0 16px;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.branch-picker{display:flex;flex-direction:column;gap:6px;min-width:220px}.branch-picker label{font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.05em}.branch-picker select{min-height:42px;border:1px solid var(--line);border-radius:10px;background-color:var(--panel2);color:var(--text);padding:0 42px 0 12px;font:inherit;font-weight:700;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%278%27 viewBox=%270 0 12 8%27%3E%3Cpath d=%27M1 1.5 6 6.5 11 1.5%27 fill=%27none%27 stroke=%27%23dce8f0%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:12px 8px}.branch-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.branch-actions button{min-height:42px}.source-warning.local{border-color:#d4a72c66}.history-panel{margin:0 0 16px;border:1px solid var(--line);border-radius:14px;background:var(--panel);overflow:hidden}.history-head,.commit-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px}.history-head{border-bottom:1px solid var(--line)}.history-head>div,.commit-row>div{display:flex;flex-direction:column;gap:4px;min-width:0}.history-head span,.commit-row span{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.commit-row+.commit-row{border-top:1px solid var(--line)}.commit-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.view-loading.compact{min-height:120px}
@media(max-width:720px){.branchbar{align-items:stretch;flex-direction:column}.branch-picker{min-width:0;width:100%}.branch-actions{display:grid;grid-template-columns:1fr 1fr}.branch-actions button{width:100%}.history-head,.commit-row{align-items:stretch;flex-direction:column}.commit-row button{width:100%}}

/* Branch merge dialog */
.merge-modal-backdrop{
  position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.62);
  display:flex;align-items:center;justify-content:center;padding:20px;
}
.merge-modal{
  width:min(520px,100%);background:#10212b;border:1px solid #294553;
  border-radius:18px;padding:22px;box-shadow:0 24px 70px rgba(0,0,0,.45);
}
.merge-modal-head h3{margin:0 0 6px;font-size:22px}
.merge-modal-head p{margin:0 0 18px;color:#93a9b8;line-height:1.4}
.merge-search{
  width:100%;box-sizing:border-box;margin:0 0 12px;padding:12px 14px;
  border:1px solid #355564;border-radius:10px;background:#0a1820;color:#edf5f9;
  font:inherit;outline:none;
}
.merge-search:focus{border-color:#39aef2;box-shadow:0 0 0 2px rgba(57,174,242,.15)}
.merge-results{display:grid;gap:8px}
.merge-branch-option{
  width:100%;min-height:48px;display:flex;align-items:center;justify-content:space-between;
  gap:14px;text-align:left;padding:11px 14px;border:1px solid #294553;border-radius:10px;
  background:#162b37;color:#edf5f9;font:inherit;font-weight:700;
}
.merge-branch-option:hover:not(:disabled){border-color:#4a7082;background:#1b3442}
.merge-branch-option.selected{border-color:#39aef2;box-shadow:0 0 0 1px #39aef2 inset}
.merge-branch-option:disabled{opacity:.48;cursor:not-allowed}
.branch-option-meta{font-size:12px;color:#91a8b6;font-weight:600}
.merge-empty{padding:18px 10px;text-align:center;color:#91a8b6}
.merge-modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
.merge-modal-actions button{min-width:100px}
@media(max-width:720px){
  .merge-modal-backdrop{align-items:flex-end;padding:12px}
  .merge-modal{border-radius:18px;padding:18px}
  .merge-modal-actions{display:grid;grid-template-columns:1fr 1fr}
  .merge-modal-actions button{width:100%}
}


/* Mobile IDE authentication */
.auth-screen{min-height:calc(100vh - 48px);display:grid;place-items:center;padding:28px 16px}.auth-card{width:min(430px,100%);background:linear-gradient(180deg,#111e27,#0f1a22);border:1px solid var(--border);border-radius:18px;padding:28px;box-shadow:0 24px 70px #0007}.auth-brand{color:#6fc4ff;font-weight:800;letter-spacing:.04em;margin-bottom:18px}.auth-card h1{margin:0 0 8px;font-size:28px}.auth-card>p{margin:0 0 22px;color:var(--muted);line-height:1.5}.auth-form{display:grid;gap:15px}.auth-form label{display:grid;gap:7px;color:#cbd8df;font-size:13px;font-weight:700}.auth-form input{min-height:46px;font-size:16px}.auth-form>button[type=submit]{min-height:46px;margin-top:2px}.auth-link{background:transparent;color:#8fcfff;padding:8px}.logout-button{background:#263945;color:#e4edf3;white-space:nowrap;padding:8px 12px}header:has(.logout-button){grid-template-columns:44px 1fr auto}@media(max-width:720px){.auth-card{padding:22px}.page-heading{align-items:flex-start;gap:16px}.page-heading #home-logout{flex:0 0 auto}}
.password-requirements{font-size:12px;line-height:1.45;color:var(--muted);background:#0a151c;border:1px solid var(--border);border-radius:10px;padding:10px 12px}.password-meter{height:8px;background:#071117;border:1px solid var(--border);border-radius:999px;overflow:hidden}.password-meter>div{height:100%;width:0;background:#4fc77b;transition:width .18s ease}.password-progress{min-height:18px;font-size:12px;color:var(--muted);margin-top:-8px}.password-progress.valid{color:#5ee18c}

.password-input-wrap{position:relative}.password-input-wrap input{padding-right:118px}.password-toggle{position:absolute;right:7px;top:50%;transform:translateY(-50%);background:transparent;color:#8fcfff;padding:7px 8px;font-size:12px;white-space:nowrap}.password-toggle:hover:not(:disabled){background:#142630;filter:none}
