:root {
  color-scheme: light;
  --ink: #243044;
  --muted: #69768c;
  --line: #e2e8ef;
  --surface: #fff;
  --background: #f4f7fa;
  --accent: #d84578;
  --accent-soft: #fff0f5;
  --focus: #7d408e;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--background); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
button, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.browser-shell { height: 100dvh; min-height: 500px; display: flex; flex-direction: column; }
.browser-header { min-height: 80px; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 26px; }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .15em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 20px; letter-spacing: .02em; }
h2 { margin-bottom: 0; font-size: 18px; }

.browser-columns { display: grid; grid-template-columns: minmax(230px, 23%) minmax(340px, 35%) minmax(330px, 1fr); gap: 1px; flex: 1; min-height: 0; background: var(--line); }
.browser-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.pane-heading { flex: none; padding: 21px 22px 16px; border-bottom: 1px solid var(--line); }
.pane-status { padding: 10px 22px; color: var(--muted); font-size: 13px; }
.pane-status:empty { display: none; }
.pane-status.error { color: #a82742; }
.tree-content, .file-list, .preview-content { overflow: auto; min-height: 0; }
.tree-content { padding: 10px 12px 24px; }
.tree-node { display: flex; align-items: stretch; min-height: 34px; border-radius: 7px; }
.tree-node.selected { background: var(--accent-soft); color: #9f3159; }
.tree-node:hover, .file-entry:hover { background: #f3f6fa; }
.tree-node.selected:hover { background: var(--accent-soft); }
.tree-toggle, .tree-label { border: 0; background: transparent; color: inherit; }
.tree-toggle { flex: none; width: 28px; padding: 3px; color: var(--muted); }
.tree-toggle:disabled { cursor: default; }
.tree-label { flex: 1; min-width: 0; text-align: left; padding: 6px 8px 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-children { margin-left: 14px; border-left: 1px solid var(--line); padding-left: 7px; }
.tree-message { padding: 7px 7px 7px 30px; color: var(--muted); font-size: 12px; }
.tree-message.error { color: #a82742; }
.more-button { margin: 5px 0 7px 30px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--accent); font-size: 12px; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-height: 24px; margin-top: 10px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.breadcrumbs button { border: 0; padding: 2px 4px; background: transparent; color: var(--accent); }
.breadcrumbs .current { color: var(--muted); }
.root-picker { position: relative; display: inline-flex; }
.root-menu { position: absolute; z-index: 5; top: 100%; left: 0; display: grid; min-width: 145px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 24px #24304426; }
.root-menu[hidden] { display: none; }
.root-menu button { padding: 7px 9px; border-radius: 5px; text-align: left; white-space: nowrap; }
.root-menu button:hover, .root-menu button:focus-visible { background: var(--accent-soft); }
.filter-space { display: flex; align-items: center; justify-content: space-between; flex: none; min-height: 50px; padding: 10px 22px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.filter-note { color: #9aa5b3; }
.filter-space[hidden] { display: none; }
.filter-space { flex-wrap: wrap; justify-content: flex-start; gap: 8px 14px; }
.filter-space select { max-width: 100%; padding: 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); }
.file-list { flex: 1; }
.file-entry { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 7px 22px; border: 0; border-bottom: 1px solid #f0f3f6; background: transparent; color: var(--ink); text-align: left; }
.file-entry.selected { background: var(--accent-soft); color: #9f3159; }
.entry-icon { display: inline-grid; flex: none; place-items: center; width: 28px; height: 28px; margin-right: 10px; border-radius: 6px; background: #edf2f8; color: #708098; font-size: 15px; }
.entry-icon.directory { background: #fff1d9; color: #ad731b; }
.entry-icon.link { background: #f0eafd; color: #7759ad; }
.entry-name { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.entry-kind { margin-left: 12px; color: var(--muted); font-size: 11px; }
.list-tail { padding: 7px 22px; color: var(--muted); font-size: 12px; }
.list-tail:empty { display: none; }
.list-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 54px; padding: 10px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.list-pager:empty { display: none; }
.list-pager button, .retry-button { border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px; background: #fff; color: var(--accent); }
.list-pager button:disabled { color: #aab2bc; cursor: default; }

.preview-name { margin: 10px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.preview-name:empty { display: none; }
.preview-path { margin: 3px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 5px 18px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.preview-meta:empty { display: none; }
.preview-meta div { display: flex; gap: 5px; }
.preview-meta dt { color: #8490a1; }
.preview-meta dd { margin: 0; color: var(--ink); }
.preview-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preview-downloads:empty { display: none; }
.preview-downloads a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--accent); text-decoration: none; font-size: 12px; }
.preview-downloads a:hover { background: var(--accent-soft); }
.preview-downloads a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.preview-content { flex: 1; padding: 22px; }
.empty-state { display: grid; place-content: center; min-height: 240px; height: 100%; text-align: center; color: var(--muted); }
.empty-symbol { display: block; margin-bottom: 15px; color: #d4dce6; font-size: 56px; }
.preview-content img { display: block; max-width: 100%; max-height: calc(100dvh - 230px); margin: auto; object-fit: contain; background: repeating-conic-gradient(#e9edf2 0 25%, #fff 0 50%) 50% / 20px 20px; }
.preview-content audio { display: block; width: min(100%, 540px); margin: 24px auto; }
.preview-content pre { margin: 0; padding: 18px; border-radius: 9px; background: #f4f7fa; color: #263344; font: 12px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-message { padding: 20px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); overflow-wrap: anywhere; }
.preview-message.error { color: #a82742; border-color: #f2c8d1; background: #fff5f7; }
.mobile-tabs { display: none; }

@media (max-width: 850px) {
  .browser-shell { min-height: 100dvh; }
  .browser-header { min-height: 72px; padding: 10px 15px; }
  .brand-mark { width: 34px; height: 34px; font-size: 20px; }
  h1 { font-size: 16px; }
  .brand .eyebrow { font-size: 8px; }
  .mobile-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: #fff; }
  .mobile-tabs button { min-height: 44px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); }
  .mobile-tabs button[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 700; }
  .browser-columns { display: block; }
  .browser-pane { height: 100%; }
  .browser-columns[data-active-pane="tree"] .list-pane, .browser-columns[data-active-pane="tree"] .preview-pane,
  .browser-columns[data-active-pane="list"] .tree-pane, .browser-columns[data-active-pane="list"] .preview-pane,
  .browser-columns[data-active-pane="preview"] .tree-pane, .browser-columns[data-active-pane="preview"] .list-pane { display: none; }
  .pane-heading { padding: 15px 18px 12px; }
  .preview-content { padding: 15px; }
  .preview-content img { max-height: calc(100dvh - 240px); }
}
