/* ====================================================================
   zelosoft code  –  Main Stylesheet
   Dark developer theme
   ==================================================================== */

:root {
    --bg-base:      #0d1117;
    --bg-surface:   #161b22;
    --bg-elevated:  #1c2128;
    --bg-hover:     #21262d;
    --border:       #30363d;
    --border-light: #21262d;
    --accent:       #238636;
    --accent-hover: #2ea043;
    --accent-blue:  #1f6feb;
    --accent-red:   #da3633;
    --text-primary: #e6edf3;
    --text-muted:   #848d97;
    --text-link:    #58a6ff;
    --code-bg:      #161b22;
    --code-border:  #30363d;
    --radius:       6px;
    --radius-lg:    10px;
    --shadow:       0 1px 3px rgba(0,0,0,.5);
}

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 15px;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Navbar ────────────────────────────────────────────────────── */
.navbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: .6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
}
.navbar-brand:hover { color: var(--text-link); text-decoration: none; }
.navbar-brand svg { flex-shrink: 0; }

.navbar-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.navbar-links a { color: var(--text-muted); font-size: .9rem; }
.navbar-links a:hover { color: var(--text-primary); text-decoration: none; }

/* ── Container ─────────────────────────────────────────────────── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.container-wide { max-width: 1200px; }
.container-narrow { max-width: 560px; }
.container-editor {
    max-width: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: #8b949e; text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-blue {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}
.btn-blue:hover { background: #388bfd; border-color: #388bfd; }

.btn-danger {
    background: transparent;
    border-color: var(--accent-red);
    color: var(--accent-red);
}
.btn-danger:hover { background: var(--accent-red); color: #fff; }

.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-lg { padding: .65rem 1.4rem; font-size: 1rem; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    margin-bottom: .35rem;
    font-size: .875rem;
    color: var(--text-muted);
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: .55rem .8rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: .9rem;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, .25);
}
.form-control::placeholder { color: #484f58; }

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.form-actions { display: flex; gap: .7rem; align-items: center; margin-top: 1.4rem; flex-wrap: wrap; }

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23848d97' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .7rem center;
    padding-right: 2rem;
}

/* ── Code editor ─────────────────────────────────────────────── */
.code-editor {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .85rem;
    min-height: 400px;
    tab-size: 4;
    background: var(--code-bg);
    border-color: var(--code-border);
    line-height: 1.5;
    letter-spacing: 0;
}
.code-viewer {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .85rem;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
    counter-reset: line;
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    margin-bottom: 1rem;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.card-title { font-size: 1rem; font-weight: 600; }

/* ── Repo list ────────────────────────────────────────────────── */
.repo-list { list-style: none; }
.repo-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}
.repo-item:last-child { border-bottom: none; }
.repo-name { font-weight: 600; font-size: .95rem; }
.repo-name a { color: var(--text-primary); }
.repo-name a:hover { color: var(--text-link); text-decoration: none; }
.repo-desc { font-size: .85rem; color: var(--text-muted); margin-top: .15rem; }
.repo-meta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .45rem; font-size: .8rem; color: var(--text-muted); }

/* ── File list ────────────────────────────────────────────────── */
.file-table { width: 100%; border-collapse: collapse; }
.file-table th, .file-table td {
    text-align: left;
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--border-light);
    font-size: .875rem;
}
.file-table th { color: var(--text-muted); font-weight: 500; background: var(--bg-elevated); }
.file-table tr:last-child td { border-bottom: none; }
.file-table tr:hover td { background: var(--bg-hover); }
.file-icon { margin-right: .35rem; opacity: .7; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 2rem;
    font-size: .75rem;
    font-weight: 500;
    border: 1px solid var(--border);
}
.badge-private { color: #e3b341; border-color: #e3b34150; background: #e3b34115; }
.badge-public  { color: #3fb950; border-color: #3fb95050; background: #3fb95015; }
.badge-lang    { color: var(--text-muted); background: var(--bg-elevated); }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .875rem;
    border: 1px solid transparent;
}
.alert-error   { background: #3c1f1e; border-color: #da363350; color: #ff7b72; }
.alert-success { background: #1a2e22; border-color: #2ea04350; color: #3fb950; }
.alert-info    { background: #1a2035; border-color: #1f6feb50; color: #58a6ff; }

/* ── Page header ───────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.page-header h1 {
    font-size: 1.35rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.page-header .breadcrumb { font-size: .9rem; color: var(--text-muted); }
.page-header .breadcrumb a { color: var(--text-muted); }
.page-header .breadcrumb a:hover { color: var(--text-primary); }

/* ── Auth pages ─────────────────────────────────────────────────── */
.auth-wrap {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}
.auth-card h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}
.auth-footer { text-align: center; margin-top: 1.2rem; font-size: .85rem; color: var(--text-muted); }

/* ── Dashboard ─────────────────────────────────────────────────── */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.stat-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1.2rem;
    flex: 1;
    min-width: 140px;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); }

/* ── Share page ──────────────────────────────────────────────────── */
.share-list { list-style: none; }
.share-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 0;
    border-bottom: 1px solid var(--border-light);
    gap: .75rem;
}
.share-item:last-child { border-bottom: none; }

/* ── Tabs ─────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    gap: .1rem;
}
.tab-btn {
    padding: .55rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: .9rem;
    cursor: pointer;
    margin-bottom: -1px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}
.tab-btn:hover { color: var(--text-primary); text-decoration: none; }
.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: #f78166;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state h3 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--text-primary); }
.empty-state p  { font-size: .9rem; margin-bottom: 1.2rem; }

/* ── Confirm modal ────────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
}
.modal h3 { margin-bottom: .75rem; }
.modal p  { font-size: .9rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: .7rem; justify-content: flex-end; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: .9rem 1.5rem;
    display: flex;
    justify-content: space-between;
    font-size: .78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: .5rem;
    flex-shrink: 0;
}

/* ── Utility ─────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .85rem; }
.text-xs      { font-size: .78rem; }
.text-right   { text-align: right; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.align-center { align-items: center; }
.flex-wrap  { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }

/* ── Full-height viewer layout ────────────────────────────────── */
.viewer-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-top: 0;
}
.viewer-card-header {
    flex-shrink: 0;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Code display: gutter + scrollable code area ────────────── */
.code-display {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;      /* children scroll independently */
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .85rem;
    line-height: 1.6;
}
.ln-gutter {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 0 0 1rem 0;   /* top set by JS to sync with pre.offsetTop + pre.paddingTop */
    border-right: 1px solid var(--code-border);
    background: var(--code-bg);
    overflow: hidden;
    min-width: 3rem;
}
.ln-num {
    display: block;
    padding: 0 .85rem 0 1rem;
    text-align: right;
    color: var(--text-muted);
    opacity: .4;
    cursor: pointer;
    font-size: inherit;      /* must match code font-size so line heights are identical */
    line-height: inherit;
    font-family: inherit;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}
.ln-num:hover { opacity: .85; background: var(--bg-hover); }
.ln-num.hl    { opacity: 1; color: var(--text-link); background: rgba(31,111,235,.12); }

/* Scrollable code wrapper */
.code-scroll {
    flex: 1;
    overflow: auto;
    position: relative;
}
/* Highlight overlay – absolutely positioned, moved by JS */
.hl-overlay {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    background: rgba(31,111,235,.10);
    box-shadow: inset 2px 0 0 #388bfd;
    pointer-events: none;
    z-index: 0;
    display: none;
}
.hl-overlay.active { display: block; }

/* Code pre – natural white-space: pre, no DOM tricks needed */
.code-display pre.code-viewer {
    position: relative;
    z-index: 1;
    flex: 1;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    white-space: pre;      /* normal pre behaviour, newlines are \n chars */
    padding: 1rem 1.4rem;
    overflow: visible;     /* parent .code-scroll handles scrolling */
}
/* Active state for wrap button */
.btn.btn-active {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
    color: var(--text-link);
}

/* ── Full-height editor layout ────────────────────────────────── */
/* Applied to main.container on file_new / file_edit / file_view pages */
/* (merged into main .container-editor rule above) */

/* ── Monaco Editor integration ────────────────────────────────── */
.editor-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .4rem .75rem;
    margin-bottom: 0;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.editor-toolbar-left {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    flex: 1;
}
.editor-toolbar-left .breadcrumb {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.editor-toolbar-right {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Editor workspace: sidebar + editor pane ──────────────────── */
.editor-workspace {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}
.editor-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── File Explorer sidebar ────────────────────────────────────── */
.file-explorer {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width .15s ease, min-width .15s ease, max-width .15s ease, opacity .15s ease;
}
.file-explorer.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    opacity: 0;
    pointer-events: none;
    border-right: none;
}
.fe-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
    user-select: none;
}
.fe-title {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--text-muted);
    text-transform: uppercase;
}
.fe-count {
    font-size: .65rem;
}
.fe-search {
    flex-shrink: 0;
    padding: .4rem .5rem;
    border-bottom: 1px solid var(--border);
}
.fe-search-input {
    width: 100%;
    padding: .3rem .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: .78rem;
    outline: none;
    font-family: inherit;
}
.fe-search-input:focus {
    border-color: var(--accent-blue);
}
.fe-tree {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .25rem 0;
}
.fe-tree::-webkit-scrollbar {
    width: 6px;
}
.fe-tree::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Tree items */
.ft-folder-header {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .5rem .2rem calc(var(--depth, 0) * 1rem + .5rem);
    cursor: pointer;
    user-select: none;
    font-size: .8rem;
    color: var(--text-primary);
    border-radius: 3px;
    white-space: nowrap;
}
.ft-folder-header:hover {
    background: var(--bg-hover);
}
.ft-arrow {
    font-size: .6rem;
    width: 1em;
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform .1s ease;
}
.ft-icon {
    font-size: .75rem;
    flex-shrink: 0;
}
.ft-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ft-children {
    /* depth managed by nesting */
}
.ft-children .ft-folder-header,
.ft-children .ft-file {
    padding-left: calc(.5rem + 1rem);
}
.ft-children .ft-children .ft-folder-header,
.ft-children .ft-children .ft-file {
    padding-left: calc(.5rem + 2rem);
}
.ft-children .ft-children .ft-children .ft-folder-header,
.ft-children .ft-children .ft-children .ft-file {
    padding-left: calc(.5rem + 3rem);
}
.ft-children .ft-children .ft-children .ft-children .ft-folder-header,
.ft-children .ft-children .ft-children .ft-children .ft-file {
    padding-left: calc(.5rem + 4rem);
}
.ft-file {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .5rem;
    font-size: .8rem;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 3px;
}
.ft-file:hover {
    background: var(--bg-hover);
    text-decoration: none;
    color: var(--text-primary);
}
.ft-file.ft-active {
    background: var(--accent-blue);
    color: #fff;
}
.ft-file.ft-active .ft-icon {
    filter: brightness(1.4);
}

/* Resize handle */
.editor-resize-handle {
    width: 4px;
    cursor: col-resize;
    background: transparent;
    flex-shrink: 0;
    transition: background .15s;
}
.editor-resize-handle:hover,
.editor-resize-handle:active {
    background: var(--accent-blue);
}
.editor-resize-handle.collapsed {
    display: none;
}

/* Sidebar toggle button active state */
.btn-active {
    background: var(--accent-blue) !important;
    color: #fff !important;
    border-color: var(--accent-blue) !important;
}

/* Monaco editor container */
.editor-monaco-wrap {
    flex: 1;
    min-height: 0;
    border: none;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

/* Loading state */
.editor-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    background: var(--bg-base);
    color: var(--text-muted);
    font-size: .9rem;
    z-index: 10;
}
.editor-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: editor-spin 0.8s linear infinite;
}
@keyframes editor-spin {
    to { transform: rotate(360deg); }
}

/* Status bar (VS Code-like bottom bar) */
.editor-statusbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .25rem .75rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    font-size: .75rem;
    color: var(--text-muted);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    gap: 1rem;
    user-select: none;
    -webkit-user-select: none;
}
.editor-statusbar-left,
.editor-statusbar-right {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.status-sep {
    color: var(--border);
    font-weight: 300;
}
.status-readonly {
    color: #e3b341;
    font-weight: 500;
}
.status-saved {
    color: var(--accent);
    font-weight: 600;
    margin-left: .5rem;
    animation: status-fade-in .2s ease;
}
@keyframes status-fade-in {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Line highlight decoration (for #L42 links) */
.editor-line-highlight {
    background: rgba(31, 111, 235, .12) !important;
}
.editor-line-highlight-glyph {
    background: var(--accent-blue);
    width: 3px !important;
    margin-left: 3px;
}
.editor-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.editor-meta-row {
    flex-shrink: 0;
}
.editor-grow {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}
.editor-grow label { flex-shrink: 0; }
.editor-grow .code-editor {
    flex: 1;
    min-height: 0;
    resize: none;
    height: 100%;        /* fallback */
}
.editor-actions {
    flex-shrink: 0;
    padding: .75rem 0;
    border-top: 1px solid var(--border);
    display: flex;
    gap: .7rem;
    align-items: center;
    background: var(--bg-base);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
    .file-explorer {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        opacity: 0;
        pointer-events: none;
        border-right: none;
    }
    .editor-resize-handle { display: none; }
}
@media (max-width: 640px) {
    .container { padding: 1rem; }
    .navbar { padding: .6rem 1rem; }
    .auth-card { padding: 1.5rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .file-table { font-size: .8rem; }
    .stat-row   { flex-direction: column; }
}
