@font-face {
  font-family: Inter;
  src: url("/disk/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/disk/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
:root { color-scheme: dark; font-family: Inter, system-ui, sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text-main); background: var(--bg-dark); font-size: .875rem; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 3px; }
svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#app { min-height: 100dvh; isolation: isolate; }
#app > canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
#app { position: relative; }

.topbar { display: grid; grid-template-columns: minmax(11rem, 17rem) minmax(8rem, 37rem) auto; gap: 1rem; align-items: center; min-height: 80px; padding: .75rem max(1.25rem, calc((100vw - 1550px) / 2)); border-bottom: 1px solid var(--line); background: var(--bg-panel); }
.brand { display: inline-flex; align-items: center; justify-self: start; gap: .7rem; text-decoration: none; }
.brand img { object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; font-weight: 620; letter-spacing: .32em; }
.brand small { margin-top: .18rem; font: .68rem var(--font-mono); color: var(--brand-blue); letter-spacing: .35em; }
.search { display: flex; gap: .65rem; align-items: center; padding: 0 .85rem; min-width: 0; height: 42px; color: var(--text-muted); background: var(--glow-blue); border: 1px solid var(--line); border-radius: 9px; }
.search:focus-within { border-color: var(--brand-blue); }
.search input { width: 100%; min-width: 0; padding: .55rem 0; background: transparent; border: 0; outline: 0; }
.search input::placeholder { color: var(--text-muted); }
.account-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: .5rem; }
.button, .primary, .quiet { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 39px; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; white-space: nowrap; }
.primary { color: var(--text-on-accent); background: var(--brand-orange); border-color: transparent; font-weight: 650; }
.primary:hover:not(:disabled) { background: var(--brand-amber); }
.quiet { color: var(--text-secondary); background: var(--bg-panel); }
.quiet:hover:not(:disabled) { background: var(--glow-blue); color: var(--brand-blue-soft); }
.icon-button { padding-inline: .55rem; }

.shell { display: grid; grid-template-columns: minmax(11rem, 17rem) minmax(0, 1fr); max-width: 1590px; margin-inline: auto; min-height: calc(100dvh - 80px); }
aside { display: flex; flex-direction: column; gap: .65rem; padding: 1.6rem 1rem 1.1rem; border-right: 1px solid var(--line); background: var(--bg-panel); }
.sidebar-title { margin: .1rem .65rem .35rem; color: var(--text-muted); font: .75rem var(--font-mono); text-transform: uppercase; letter-spacing: .09em; }
.tree, .tree ul, .breadcrumbs, .folder-grid { list-style: none; margin: 0; padding: 0; }
.tree li { min-width: 0; }
.tree ul { margin-left: .87rem; padding-left: .38rem; border-left: 1px solid var(--line); }
.tree-line { display: flex; align-items: stretch; min-width: 0; min-height: 36px; border-radius: 7px; }
.tree-line:hover { background: var(--glow-blue); }
.tree-line:has([aria-current="location"]) { color: var(--brand-blue-soft); background: var(--glow-blue); box-shadow: inset 2px 0 var(--brand-blue); }
.tree .disclose, .tree .tree-label { border: 0; background: transparent; }
.disclose { color: var(--text-muted); flex: 0 0 23px; padding: 0; }
.disclose svg, .breadcrumbs svg { width: 13px; height: 13px; vertical-align: middle; }
.disclose[aria-expanded="true"] svg { transform: rotate(90deg); }
.tree-label { display: flex; align-items: center; gap: .5rem; min-width: 0; flex: 1; padding: .4rem .35rem; text-align: left; }
.tree-label span, .file-link span, .folder-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-label svg, .folder-card svg { color: var(--brand-blue); }
.storage { margin-top: auto; padding: .95rem .65rem 0; border-top: 1px solid var(--line); color: var(--text-muted); }
.storage-title { display: flex; align-items: center; gap: .5rem; color: var(--text-secondary); }
.storage p { margin: .45rem 0 0; font: .7rem var(--font-mono); }
meter { display: block; width: 100%; height: 12px; margin-top: .4rem; accent-color: var(--brand-orange); }

.browser { min-width: 0; padding: clamp(1.2rem, 3vw, 2.75rem); }
.mobile-nav { display: none; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; color: var(--text-muted); font-size: .8rem; }
.breadcrumbs li { display: flex; align-items: center; gap: .45rem; }
.breadcrumbs button { color: var(--brand-blue-soft); background: transparent; border: 0; padding: .2rem 0; text-align: left; }
.folder-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin: .75rem 0 1.3rem; }
h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.2; font-weight: 560; letter-spacing: -.035em; overflow-wrap: anywhere; }
.toolbar { display: flex; gap: .55rem; flex-wrap: wrap; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .65rem; }
.folder-grid:not(:empty) { margin-bottom: 1.3rem; }
.folder-card { display: flex; width: 100%; align-items: center; gap: .7rem; text-align: left; padding: .85rem; min-height: 49px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 9px; }
.folder-card:hover { background: var(--glow-blue); border-color: var(--brand-blue); }
.file-browser { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; table-layout: fixed; }
th, td { padding: .58rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: .75rem; font-weight: 550; color: var(--text-muted); }
th:nth-child(2) { width: 7.2rem; }
th:last-child { width: 6.2rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--glow-blue); }
td:nth-child(2) { font: .74rem var(--font-mono); color: var(--text-muted); white-space: nowrap; }
.sort { border: 0; background: transparent; padding: .1rem; }
.sort span { margin-inline-start: .25rem; color: var(--brand-blue); }
.file-link { display: flex; align-items: center; gap: .6rem; text-decoration: none; min-width: 0; }
.file-link:hover { color: var(--brand-blue-soft); }
.file-link svg { color: var(--brand-blue); }
.file-actions { display: flex; gap: .35rem; align-items: center; justify-content: end; }
.file-actions .quiet { min-height: 31px; min-width: 32px; padding: .25rem; }
.file-actions svg { width: 16px; height: 16px; }
.file-actions details { position: relative; }
.file-actions summary { display: grid; place-items: center; list-style: none; cursor: pointer; }
.file-actions summary::-webkit-details-marker { display: none; }
.action-popover { position: absolute; z-index: 2; right: 0; top: calc(100% + .25rem); min-width: 9rem; padding: .3rem; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-dark); box-shadow: 0 .6rem 1.5rem #0008; }
.action-popover button { display: block; width: 100%; text-align: left; min-height: 32px; background: transparent; border: 0; border-radius: 5px; padding: .4rem .6rem; }
.action-popover button:hover { background: var(--glow-blue); }

.status { margin-block: .85rem; color: var(--text-muted); }
.status:not(:empty):where([data-empty]) { padding: 2.4rem 1rem; text-align: center; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg-panel); }
.more { margin-top: .5rem; }
.welcome { width: min(100% - 2rem, 32rem); margin: min(12vh, 7rem) auto 2rem; padding: clamp(1rem, 5vw, 2rem); border: 1px solid var(--line); border-radius: 12px; background: var(--bg-panel); }
.welcome p { color: var(--text-muted); }
.welcome iframe { display: block; border: 0; width: 100%; height: min(610px, 72vh); }
dialog { width: min(100% - 2rem, 36rem); padding: 1.25rem; color: var(--text-main); background: var(--bg-dark); border: 1px solid var(--line); border-radius: 12px; }
dialog::backdrop { background: #000a; }
.nodes-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.nodes-heading h2 { margin: 0; font-size: 1.3rem; font-weight: 570; }
.nodes-list { list-style: none; padding: 0; margin: .75rem 0 0; }
.nodes-list li { display: flex; gap: .75rem; align-items: center; padding: .85rem 0; border-top: 1px solid var(--line); }
.nodes-list li > svg { color: var(--brand-blue); }
.nodes-list li > strong { overflow-wrap: anywhere; flex: 1; }
#folder-name { display: block; width: 100%; margin-top: .45rem; padding: .6rem; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 8px; }
#nodes-status, .node-state { color: var(--text-muted); }
#mirror-settings label { display: block; }
#mirror-settings select { width: 100%; margin: .35rem 0 .95rem; padding: .6rem; color: var(--text-main); background: var(--bg-dark); border: 1px solid var(--line); border-radius: 8px; }
#mirror-selection { max-height: 34vh; overflow: auto; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 8px; padding: .55rem; }
#mirror-selection ul { list-style: none; padding-left: .85rem; margin: 0; }
#mirror-selection summary { padding: .35rem 0; cursor: pointer; }
#mirror-selection label { padding: .35rem 0; overflow-wrap: anywhere; }
#mirror-selection input { margin-right: .45rem; accent-color: var(--brand-blue); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 700px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: .65rem; padding: .6rem .85rem; min-height: 64px; }
  .brand { gap: .25rem; }
  .brand img { width: 38px; height: 38px; }
  .brand strong { font-size: .77rem; }
  .brand small { font-size: .54rem; }
  .shell { display: block; min-height: calc(100dvh - 64px); }
  aside { display: none; padding: .85rem; border-bottom: 1px solid var(--line); border-right: 0; }
  aside[data-open] { display: flex; }
  .mobile-nav { display: block; margin-bottom: .75rem; }
  th, td { padding: .55rem .45rem; }
  th:nth-child(2) { width: 4.7rem; }
  th:last-child { width: 5.3rem; }
}
@media (max-width: 420px) {
  .brand span { display: none; }
  #show-nodes span { clip-path: inset(50%); position: absolute; width: 1px; height: 1px; overflow: hidden; }
}
