/* wltd-files — one stylesheet for both pages. No fonts, no images, nothing
 * fetched from anywhere: the CSP on this vhost allows 'self' and nothing
 * else, because a single third-party script on a page that holds the master
 * key in memory would be the whole game. */

:root {
  color-scheme: dark;
  --bg: #0c0d10;
  --panel: #15171c;
  --panel-2: #1c1f26;
  --line: #282c36;
  --ink: #e8eaf0;
  --muted: #8b93a7;
  --accent: #6ea8fe;
  --good: #63d19e;
  --warn: #f0b357;
  --bad: #f06a6a;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap { max-width: 860px; margin: 0 auto; padding: 40px 20px 80px; }
.wrap.wide { max-width: 1400px; }

header.top {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 18px; margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
header.top h1 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: .02em; }
header.top .sub { color: var(--muted); font-size: 13px; }
header.top .spacer { flex: 1; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

label.field { display: block; margin-bottom: 16px; }
label.field > span {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: 6px;
}

input[type=text], input[type=password], select {
  width: 100%; padding: 10px 12px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit;
}
input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}

button {
  font: inherit; font-weight: 500;
  padding: 10px 18px; border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink);
  cursor: pointer;
}
button:hover:not(:disabled) { background: #232733; }
button.primary { background: var(--accent); border-color: var(--accent); color: #08101f; }
button.primary:hover:not(:disabled) { background: #85b8ff; }
button.danger { color: var(--bad); border-color: #43282c; }
button:disabled { opacity: .45; cursor: default; }
button.small { padding: 5px 10px; font-size: 13px; }

.drop {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 44px 20px; text-align: center; color: var(--muted);
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: #131a26; color: var(--ink); }
.drop strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.drop .or { margin-top: 14px; display: flex; gap: 10px; justify-content: center; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 190px; }

.note {
  font-size: 13px; color: var(--muted);
  border-left: 2px solid var(--line); padding-left: 12px; margin: 14px 0;
}
.note.warn { border-color: var(--warn); color: #d9c39a; }
.note.bad { border-color: var(--bad); color: #e6a4a4; }

.bar { height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.stat { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 8px; }

.linkbox {
  display: flex; gap: 8px; align-items: stretch; margin-top: 6px;
}
.linkbox input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}

/* ── the browser ─────────────────────────────────────────────── */

.split { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

.tree { font-size: 14px; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; }
.tree > ul { padding-left: 0; }
.tree li > .node {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 6px; cursor: pointer; color: var(--muted);
}
.tree li > .node:hover { background: var(--panel-2); color: var(--ink); }
.tree li > .node.sel { background: #1e2735; color: var(--ink); }
.tree .caret { width: 10px; font-size: 10px; color: var(--muted); }
.tree .count { margin-left: auto; font-size: 11px; color: var(--muted); }

.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

.grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.tile {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; cursor: pointer;
}
.tile:hover { border-color: #3a4152; }
.tile .thumb {
  aspect-ratio: 1; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 11px; overflow: hidden;
}
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .meta { padding: 7px 9px; font-size: 12px; }
.tile .meta .n {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left;
}
.tile .meta .s { color: var(--muted); font-size: 11px; }

.lightbox {
  position: fixed; inset: 0; background: rgba(5,6,9,.94);
  display: flex; flex-direction: column; z-index: 50;
}
.lightbox .lb-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.lightbox .lb-bar .spacer { flex: 1; }
.lightbox .lb-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: auto; min-height: 0;
}
.lightbox .lb-body img, .lightbox .lb-body video {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.hidden { display: none !important; }

code.mono, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; word-break: break-all;
}

/* ── utility classes ──────────────────────────────────────────────
 *
 * These exist because the CSP on this origin is `style-src 'self'` with no
 * 'unsafe-inline'. That blocks the style attribute as well as <style> blocks,
 * so a stray style="…" silently does nothing — which is the correct trade:
 * the alternative is allowing inline styles on the two pages in this estate
 * that hold a decryption key in memory. Setting el.style.width from script is
 * CSSOM and stays allowed; assigning a whole style string is not.
 */
.plain { text-transform: none; letter-spacing: 0; }
.check { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 14px; cursor: pointer; }
.check input { margin-top: 3px; }
.small-text { font-size: 13px; }
.dim { color: var(--muted); }
.dim-block { display: block; color: var(--muted); }
.gap-t { margin-top: 12px; }
.gap-t-lg { margin-top: 18px; }
.gap-b { margin-bottom: 10px; }
.flush { margin: 0; }
.flush-t { margin-top: 0; }
.inline-note { margin-left: 10px; font-size: 13px; color: var(--muted); }
.status-dim { color: var(--muted); }
.status-bad { color: var(--bad); }
