:root {
  color-scheme: dark;
  --bg: #080a08;
  --panel: #0d100d;
  --panel-2: #121612;
  --line: #252b21;
  --line-hi: #3d492f;
  --text: #e8e4d4;
  --muted: #85897d;
  --dim: #565c52;
  --amber: #ffb000;
  --amber-hi: #ffd05a;
  --amber-soft: rgba(255, 176, 0, .11);
  --amber-glow: rgba(255, 176, 0, .25);
  --danger: #ff5c57;
  --green: #81d742;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-family: var(--mono); font-size: 12px; overflow: hidden; }
button, input, select { font: inherit; }
button, select { color: inherit; }
button, select, summary, label[for], input[type="checkbox"], input[type="radio"], input[type="file"], a[href], [role="button"], [data-action], .drop-zone, .file-row { cursor: pointer; }
button:disabled, select:disabled, input:disabled, [aria-disabled="true"] { cursor: not-allowed; opacity: .45; filter: saturate(.4); box-shadow: none !important; transform: none !important; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 1px solid var(--amber); outline-offset: 2px; }
.skip-link { position: fixed; top: -50px; left: 12px; z-index: 100; background: var(--amber); color: #000; padding: 10px; }
.skip-link:focus { top: 12px; }
.scanlines { pointer-events: none; position: fixed; inset: 0; z-index: 99; opacity: .15; background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255,255,255,.025) 4px); }

.topbar { height: 58px; display: grid; grid-template-columns: 260px 1fr auto; align-items: center; border-bottom: 1px solid var(--line); background: rgba(8,10,8,.92); backdrop-filter: blur(12px); padding: 0 18px; position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--amber); color: var(--amber); font-weight: 900; box-shadow: inset 0 0 14px var(--amber-soft), 0 0 10px rgba(255,176,0,.08); }
.brand strong { display: block; letter-spacing: .13em; font-size: 13px; }
.brand small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .18em; margin-top: 2px; }
.runtime { justify-self: center; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1.8s infinite; }
.status-dot.ready { background: var(--green); box-shadow: 0 0 8px var(--green); animation: none; }
.status-dot.error { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: none; }
.divider { color: var(--line-hi); }
.top-actions, .head-actions, .toolbar-actions { display: flex; gap: 8px; align-items: center; }

.button, .icon-button, select { border: 1px solid var(--line-hi); background: var(--panel-2); min-height: 32px; padding: 0 12px; letter-spacing: .05em; font-size: 10px; transition: border-color .18s, background .18s, color .18s, transform .18s, box-shadow .18s; }
.button:hover, .icon-button:hover, select:hover { border-color: var(--amber); color: var(--amber-hi); background: var(--amber-soft); box-shadow: 0 0 14px rgba(255,176,0,.06); }
.button:active, .icon-button:active { transform: translateY(1px); }
.button.primary { background: var(--amber); color: #0a0904; border-color: var(--amber); font-weight: 800; }
.button.primary:hover { background: var(--amber-hi); color: #000; box-shadow: 0 0 22px var(--amber-glow); }
.icon-button { width: 32px; padding: 0; display: inline-grid; place-items: center; }
.icon-button.active { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.text-button { border: 0; background: none; color: var(--amber); padding: 0; font-size: 9px; letter-spacing: .08em; }
.text-button:hover { color: var(--amber-hi); text-shadow: 0 0 8px var(--amber-glow); }
.text-button.danger { color: var(--danger); }

.app-shell { height: calc(100vh - 58px); display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.sidebar, .inspector { background: var(--panel); min-height: 0; }
.sidebar { grid-column:1; grid-row:1; border-right: 1px solid var(--line); padding: 18px 12px 12px; display: flex; flex-direction: column; }
.eyebrow { color: var(--amber); font-size: 8px; letter-spacing: .17em; margin: 0 0 10px; }
.nav-block { display: grid; gap: 3px; }
.nav-item { height: 36px; width: 100%; border: 1px solid transparent; background: transparent; color: var(--muted); text-align: left; padding: 0 9px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; transition: all .18s; }
.nav-item:hover { color: var(--text); background: var(--panel-2); }
.nav-item.active { color: var(--amber-hi); border-color: var(--line-hi); background: linear-gradient(90deg, var(--amber-soft), transparent); }
kbd { border: 1px solid var(--line); background: #090b09; color: var(--dim); padding: 2px 5px; font: inherit; font-size: 8px; }
.storage-card { margin-top: 26px; border-top: 1px solid var(--line); padding: 18px 8px; }
.section-heading, .storage-values { display: flex; justify-content: space-between; }
.section-heading > span { font-size: 9px; color: var(--muted); }
.meter { height: 4px; background: #20241e; margin: 5px 0 10px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--amber); box-shadow: 0 0 8px var(--amber); transition: width .5s ease; }
.storage-values strong { font-size: 11px; }.storage-values span { color: var(--dim); font-size: 9px; }
.storage-card .text-button { margin-top: 14px; }
.drop-zone { border: 1px dashed var(--line-hi); min-height: 118px; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); transition: all .2s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--amber); background: var(--amber-soft); color: var(--amber-hi); }
.drop-icon { font-size: 25px; color: var(--amber); }.drop-zone small { color: var(--dim); font-size: 8px; }
.sidebar-footer { margin-top: auto; display: flex; justify-content: space-between; color: var(--dim); font-size: 8px; }
.sidebar-footer a { color: var(--muted); text-decoration: none; }

.workspace { grid-column:2; grid-row:1; overflow: auto; min-width: 0; background-image: linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px); background-size: 28px 28px; }
.view { display: none; padding: 26px 24px 40px; min-height: 100%; animation: reveal .25s ease both; }
.view.active { display: block; }
.workspace-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; }
h1 { font: 500 27px var(--sans); margin: 0; letter-spacing: -.03em; }
.pathbar { height: 38px; border: 1px solid var(--line); display: flex; align-items: center; background: rgba(13,16,13,.92); margin-bottom: 8px; }
.path-home { align-self: stretch; width: 38px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--amber); }
.breadcrumbs { display: flex; align-items: center; flex: 1; overflow: auto; scrollbar-width: none; }
.crumb { border: 0; background: none; color: var(--muted); padding: 0 4px; white-space: nowrap; font-size: 10px; }
.crumb:hover { color: var(--amber); }.crumb::after { content: "/"; color: var(--dim); margin-left: 8px; }
.pathbar > .icon-button { border-width: 0 0 0 1px; height: 100%; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.search-box { width: min(370px, 55%); height: 34px; border: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; gap: 9px; padding: 0 9px; transition: border-color .2s; }
.search-box:focus-within { border-color: var(--amber); box-shadow: 0 0 13px rgba(255,176,0,.05); }
.search-box > span { color: var(--amber); font-size: 17px; }.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: none; color: var(--text); font-size: 9px; letter-spacing: .07em; }
select { height: 32px; appearance: none; padding-right: 25px; background-image: linear-gradient(45deg, transparent 50%, var(--amber) 50%),linear-gradient(135deg,var(--amber) 50%,transparent 50%); background-position: calc(100% - 12px) 13px,calc(100% - 8px) 13px;background-size:4px 4px;background-repeat:no-repeat; }
.selection-bar { min-height: 38px; align-items: center; justify-content: space-between; border: 1px solid var(--amber); background: var(--amber-soft); padding: 0 12px; margin-bottom: 8px; color: var(--amber-hi); }
.selection-bar:not([hidden]) { display: flex; }.selection-bar > div { display: flex; gap: 16px; }
.file-surface { border: 1px solid var(--line); background: rgba(10,12,10,.94); min-height: 340px; }
.table-header, .file-row { display: grid; grid-template-columns: 34px minmax(180px,1fr) 100px 90px 135px 78px 36px; align-items: center; }
.table-header { min-height: 32px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 8px; letter-spacing: .1em; }
.table-header button { border: 0; background: none; color: inherit; padding: 0; text-align: left; font: inherit; letter-spacing: inherit; }
.table-header button:hover { color: var(--amber); }
.table-header > :first-child, .file-row > :first-child { justify-self: center; }
input[type="checkbox"] { accent-color: var(--amber); }
.file-row { min-height: 45px; border-bottom: 1px solid #1b1f1a; color: var(--muted); transition: background .16s, color .16s, border-color .16s; position: relative; }
.file-row:hover { background: var(--amber-soft); color: var(--text); border-color: var(--line-hi); }
.file-row.selected { background: rgba(255,176,0,.14); color: var(--text); }
.name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; color: inherit; text-align: left; padding: 0; }
.name-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text); }
.file-icon { width: 25px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line-hi); color: var(--amber); background: var(--panel-2); font-size: 12px; flex: 0 0 auto; }
.file-icon.folder { border-color: #78602c; background: #211b0d; }
.row-kind { text-transform: uppercase; font-size: 9px; }.row-size,.row-date,.row-mode { font-size: 9px; color: var(--dim); }
.more-button { border: 0; background: none; color: var(--muted); font-size: 18px; }
.more-button:hover { color: var(--amber); }
.empty-state { min-height: 330px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state[hidden] { display: none; }.empty-glyph { font-size: 44px; color: var(--line-hi); }
.empty-state h2 { font: 500 17px var(--sans); margin: 8px 0; }.empty-state p { max-width: 390px; line-height: 1.7; color: var(--muted); margin: 0 0 18px; }
.index-footer { display: flex; justify-content: space-between; color: var(--dim); font-size: 8px; letter-spacing: .09em; margin-top: 8px; }

.inspector { position:fixed; z-index:20; top:58px; right:0; bottom:0; width:min(320px,calc(100vw - 20px)); border-left:1px solid var(--line); padding:18px; overflow:auto; transform:translateX(100%); transition:transform .25s ease; box-shadow:-20px 0 50px transparent; }
.inspector.open { transform:none; box-shadow:-20px 0 50px #000; }
.inspector.revealing { animation: inspector-reveal .32s ease both; }
.inspector-empty { height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; gap: 7px; color: var(--dim); }
.inspector-empty > span { font-size: 27px; }.inspector-empty strong { color: var(--muted); font-size: 9px; }.inspector-empty small { font-size: 8px; }
.inspector-head { display: flex; justify-content: space-between; align-items: flex-start; }
.object-preview { height: 135px; border: 1px solid var(--line); background: #090b09; display: grid; place-items: center; overflow: hidden; margin: 7px 0 15px; font-size: 45px; color: var(--amber); }
.object-preview img, .object-preview video { width: 100%; height: 100%; object-fit: contain; }
#object-name { font: 500 16px var(--sans); overflow-wrap: anywhere; margin: 0 0 4px; }
.object-path { color: var(--dim); font-size: 8px; overflow-wrap: anywhere; margin: 0 0 16px; }
.action-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }.action-stack .primary { grid-column: 1/-1; }
.action-stack #inspect-peer { grid-column:1/-1; }
.metadata { margin: 18px 0; border-top: 1px solid var(--line); }
.metadata div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 9px 0; }
.metadata dt { color: var(--dim); font-size: 8px; letter-spacing: .08em; }.metadata dd { margin: 0; color: var(--muted); font-size: 9px; text-align: right; overflow-wrap: anywhere; }
.inspector-actions { display: flex; justify-content: space-between; }

.transfer-stats { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); margin-bottom: 14px; }
.transfer-stats article { padding: 15px; border-right: 1px solid var(--line); }.transfer-stats article:last-child{border:0}.transfer-stats span{display:block;color:var(--dim);font-size:8px;margin-bottom:6px}.transfer-stats strong{font:500 19px var(--sans)}
.panel { border: 1px solid var(--line); background: rgba(10,12,10,.94); }.panel-title{height:35px;padding:0 11px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;font-size:9px}.panel-title small{color:var(--dim)}
.transfer-row { display:grid;grid-template-columns:34px minmax(160px,1fr) 90px 90px 80px;align-items:center;min-height:54px;padding:0 11px;border-bottom:1px solid var(--line);gap:8px}.transfer-row .direction{color:var(--amber);font-size:18px}.transfer-row strong{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.transfer-row small{color:var(--dim);font-size:8px}.transfer-status{font-size:8px;text-transform:uppercase}.transfer-status.complete{color:var(--green)}.transfer-status.error{color:var(--danger)}.transfer-status.active{color:var(--amber)}
.progress { height:3px;background:var(--line);margin-top:6px}.progress i{height:100%;display:block;background:var(--amber);transition:width .2s}
.empty-inline { padding:55px;text-align:center;color:var(--dim);font-size:9px;letter-spacing:.1em}
.notice { border:1px solid #56471f;background:var(--amber-soft);display:flex;gap:12px;padding:12px;margin-bottom:15px;color:var(--muted);line-height:1.6}.notice>span{color:var(--amber);border:1px solid var(--amber);width:20px;height:20px;display:grid;place-items:center;flex:none}.notice p{margin:0}
.remote-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:10px}.remote-card{border:1px solid var(--line);background:var(--panel);padding:15px;transition:all .2s}.remote-card:hover{border-color:var(--line-hi);transform:translateY(-2px)}.remote-card-head{display:flex;justify-content:space-between}.remote-card h2{font:500 15px var(--sans);margin:0}.remote-card .method{font-size:8px;color:var(--amber);border:1px solid #5f4a1b;padding:3px 5px}.remote-url{color:var(--dim);font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:6px 0 15px}.remote-card-actions{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:11px}
.peer-control { display:grid;grid-template-columns:1fr 250px;gap:14px;border:1px solid var(--line);background:var(--panel);padding:15px;margin-bottom:10px}.policy-switch{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.policy-switch button{border:1px solid var(--line-hi);background:#090b09;color:var(--muted);padding:10px;text-align:left;transition:all .18s}.policy-switch button:hover,.policy-switch button.active{border-color:var(--amber);background:var(--amber-soft);color:var(--amber-hi)}.policy-switch button small{display:block;color:var(--dim);font-size:8px;line-height:1.5;margin-top:5px}.identity-card{border-left:1px solid var(--line);padding-left:15px;display:grid;align-content:center;gap:5px}.identity-card span{color:var(--dim);font-size:8px}.identity-card strong{color:var(--amber);letter-spacing:.08em}.identity-card small{color:var(--muted);font-size:8px;line-height:1.5}.peer-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px}.peer-row,.pending-row{min-height:64px;border-bottom:1px solid var(--line);padding:11px;display:grid;grid-template-columns:30px 1fr auto;align-items:center;gap:9px}.peer-signal{width:9px;height:9px;border:1px solid var(--green);border-radius:50%;box-shadow:0 0 7px var(--green)}.peer-row strong,.pending-row strong{display:block;font-size:10px}.peer-row small,.pending-row small{color:var(--dim);font-size:8px}.peer-actions,.pending-actions{display:flex;gap:8px}.pending-row{grid-template-columns:1fr auto}.pending-row.staged{border-left:2px solid var(--amber)}.pending-row.eager{border-left:2px solid var(--danger)}
.empty-state.compact{min-height:260px}

dialog { width:min(520px,calc(100vw - 30px));padding:0;border:1px solid var(--line-hi);background:var(--panel);color:var(--text);box-shadow:0 25px 80px #000,0 0 30px rgba(255,176,0,.08); }
dialog::backdrop { background:rgba(0,0,0,.78);backdrop-filter:blur(3px) }
.modal-head { display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid var(--line);padding:17px }.modal-head h2{font:500 19px var(--sans);margin:0}.modal-head .eyebrow{margin-bottom:5px}
#modal-body { padding:18px;display:grid;gap:13px }.field{display:grid;gap:6px}.field label{font-size:8px;color:var(--muted);letter-spacing:.09em}.field input,.field select{height:38px;border:1px solid var(--line-hi);background:#090b09;color:var(--text);padding:0 10px;outline:none}.field input:focus,.field select:focus{border-color:var(--amber);box-shadow:0 0 12px rgba(255,176,0,.08)}.field small{color:var(--dim);line-height:1.5}
.modal-actions { border-top:1px solid var(--line);padding:12px 18px;display:flex;justify-content:flex-end;gap:8px }
.toast-stack { position:fixed;right:18px;bottom:18px;z-index:110;display:grid;gap:7px }.toast{width:min(350px,calc(100vw - 36px));border:1px solid var(--line-hi);border-left:3px solid var(--amber);background:#121611;padding:11px 13px;box-shadow:0 10px 30px #000;animation:toast-in .25s ease both}.toast.error{border-left-color:var(--danger)}.toast strong{display:block;font-size:9px;margin-bottom:3px}.toast span{color:var(--muted);font-size:9px}

body.phosphor { --amber:#8dfc3b;--amber-hi:#c2ff8e;--amber-soft:rgba(116,255,40,.09);--amber-glow:rgba(116,255,40,.22); }
.file-surface.grid-mode .table-header{display:none}.file-surface.grid-mode #file-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));padding:8px;gap:7px}.file-surface.grid-mode .file-row{display:grid;grid-template-columns:1fr;min-height:135px;padding:12px}.file-surface.grid-mode .file-row>label,.file-surface.grid-mode .file-row>.row-kind,.file-surface.grid-mode .file-row>.row-date,.file-surface.grid-mode .file-row>.row-mode{display:none}.file-surface.grid-mode .name-cell{flex-direction:column;align-items:flex-start}.file-surface.grid-mode .file-icon{width:38px;height:42px;font-size:18px}.file-surface.grid-mode .row-size{position:absolute;bottom:12px;left:12px}.file-surface.grid-mode .more-button{position:absolute;right:8px;top:8px}

@keyframes pulse{50%{opacity:.35;transform:scale(.8)}}@keyframes reveal{from{opacity:0;transform:translateY(4px)}}@keyframes toast-in{from{opacity:0;transform:translateX(15px)}}@keyframes inspector-reveal{0%{background:var(--amber-soft);box-shadow:inset 3px 0 var(--amber)}100%{background:var(--panel);box-shadow:none}}
@media(max-width:1050px){.app-shell{grid-template-columns:190px minmax(0,1fr)}.table-header,.file-row{grid-template-columns:34px minmax(0,1fr) 86px 36px}.table-header>:nth-child(3),.table-header>:nth-child(5),.table-header>:nth-child(6),.file-row>.row-kind,.file-row>.row-date,.file-row>.row-mode{display:none}.peer-control{grid-template-columns:1fr}.identity-card{border-left:0;border-top:1px solid var(--line);padding:12px 0 0}.peer-columns{grid-template-columns:1fr}}
@media(max-width:750px){body{overflow:auto}.topbar{grid-template-columns:1fr auto}.runtime{display:none}.app-shell{height:auto;min-height:calc(100vh - 58px);display:block}.sidebar{display:none}.workspace{overflow:visible}.view{padding:20px 12px}.workspace-head{align-items:flex-start;gap:14px}.head-actions{flex-wrap:wrap;justify-content:flex-end}.table-header,.file-row{grid-template-columns:30px minmax(0,1fr) 75px 34px}.transfer-stats{grid-template-columns:1fr 1fr}.transfer-stats article:nth-child(2){border-right:0}.transfer-stats article:nth-child(-n+2){border-bottom:1px solid var(--line)}.transfer-row{grid-template-columns:25px minmax(0,1fr) 65px}.transfer-row>:nth-child(3),.transfer-row>:nth-child(4){display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
