/* Vaultline — "subterranean": basalt surfaces, one lantern-amber accent. Tokens mirror the Paper design. */
:root {
  --bg: #0B0C0D; --side: #0E0F11; --surface: #131517; --raised: #1C1F22;
  --line: #2B3035; --line-soft: #1F2326; --line-strong: #4A5157;
  --text: #ECEAE4; --muted: #A3A8AD; --faint: #8A9096;
  --accent: #F2A93B; --ok: #5FB589; --danger: #E5584A;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Inter Tight", Inter, ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2 { font-family: var(--display); letter-spacing: -.03em; margin: 0; font-weight: 700; }
h1 { font-size: 40px; line-height: 1.1; }
h2 { font-size: 28px; letter-spacing: -.02em; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12px; }
.label { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

/* App shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 260px; flex-shrink: 0; background: var(--side); border-right: 1px solid var(--line-soft);
  padding: 28px 20px; display: flex; flex-direction: column; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font: 700 20px var(--display); letter-spacing: -.02em; color: var(--text); }
.brand svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 36px; }
.nav a { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 14px; }
.nav a.active { background: var(--raised); color: var(--text); }
.nav a:hover { text-decoration: none; color: var(--text); }
.me { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-top: 1px solid var(--line-soft); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--raised); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.main { flex: 1; min-width: 0; padding: 40px 56px; display: flex; flex-direction: column; gap: 32px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px;
  border-radius: 10px; border: 1px solid transparent; font: 600 14px var(--sans); cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: none; color: var(--muted); border-color: var(--line); }
.btn-danger { background: none; color: var(--danger); border-color: var(--line); height: 32px; padding: 0 12px; font-weight: 500; }
.btn-block { width: 100%; height: 48px; font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 8px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: 15px var(--sans); }
textarea { height: 88px; padding: 12px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.error { color: var(--danger); font-size: 13px; }
.alert { padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.alert-ok { border-color: var(--ok); }
.alert-danger { border-color: var(--danger); }
.linkbox { font-family: var(--mono); font-size: 13px; word-break: break-all; margin: 8px 0; padding: 10px 12px; background: var(--bg); border-radius: 8px; user-select: all; }

/* File table */
.files { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; min-height: 64px; padding: 0 12px; border-bottom: 1px solid var(--line-soft); gap: 12px; }
.row.th { min-height: 36px; border-bottom-color: var(--line); }
.row .name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.row .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .prot { width: 170px; flex-shrink: 0; font-size: 13px; }
.row .size { width: 90px; flex-shrink: 0; font: 13px var(--mono); color: var(--muted); }
.row .when { width: 130px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.row .acts { width: 150px; flex-shrink: 0; display: flex; justify-content: flex-end; gap: 12px; align-items: center; }
.badge { width: 36px; height: 36px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; font: 600 10px var(--mono); color: var(--muted); flex-shrink: 0; }
.lock { color: var(--accent); }

/* Upload form */
.panel { width: 100%; max-width: 680px; padding: 40px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 28px; }
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.choice input { margin-top: 4px; accent-color: var(--accent); }
.choice:has(input:checked) { border: 1.5px solid var(--accent); background: var(--raised); padding: 15.5px; }
.choice strong { display: block; font-weight: 600; }
.pill { margin-left: auto; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--bg); background: var(--accent); padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Mode-dependent fields: pure CSS, so no script is needed (CSP forbids it anyway). */
.opt { display: none; }
form:has(input[value=password]:checked) .opt-password,
form:has(input[value=users]:checked) .opt-users { display: flex; flex-direction: column; gap: 16px; }
.dropzone input[type=file] { width: 100%; padding: 20px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); background: none; }

/* Centered pages (login, unlock) */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.narrow { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 28px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: auto; flex-direction: row; align-items: center; padding: 14px 16px; }
  .nav { flex-direction: row; margin: 0; } .me { display: none; }
  .main { padding: 24px 16px; }
  .row .prot, .row .when { display: none; } .row .acts { width: auto; }
  .panel { padding: 24px; } .form-grid { grid-template-columns: 1fr; }
}

details.confirm { position: relative; }
details.confirm summary { list-style: none; cursor: pointer; }
details.confirm summary::-webkit-details-marker { display: none; }
details.confirm form { position: absolute; right: 0; top: 40px; z-index: 5; background: var(--surface); padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
details.confirm form .btn { white-space: nowrap; background: var(--danger); color: var(--bg); }

/* --- Projects, sharing, security ------------------------------------------------------- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 10px; flex-shrink: 0; }
.nav a { gap: 0; }
.linkbtn { all: unset; cursor: pointer; color: var(--muted); font-size: 13px; }
.linkbtn:hover { color: var(--text); text-decoration: underline; }
.linkbtn.accent { color: var(--accent); }
.alert-warn { border-color: var(--accent); }
.ico { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.crumbs strong { color: var(--text); font-weight: 500; }
.crumbs a { color: var(--muted); }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.fname { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.row .prot.tags { width: 240px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 500; border: 1px solid var(--line); white-space: nowrap; }
.tag-quiet { color: var(--muted); border-color: transparent; padding-left: 0; }
.tag-accent { color: var(--accent); border-color: var(--accent); }
.tag-ok { color: var(--ok); border-color: var(--ok); }
details.pop { position: relative; }
details.pop summary { list-style: none; cursor: pointer; }
details.pop summary::-webkit-details-marker { display: none; }
details.pop form { position: absolute; right: 0; top: 52px; z-index: 5; width: 280px; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.panel.wide { max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 200px; }
.people { display: flex; flex-direction: column; margin-top: 24px; }
.person, .line { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.line.stack { align-items: stretch; gap: 12px; }
.block { display: flex; flex-direction: column; max-width: 760px; }
.block h2 { font-size: 22px; margin-bottom: 8px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px; margin-top: 12px; }
.qr { width: 192px; background: #fff; padding: 8px; border-radius: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.gmark { font: 700 16px var(--display); color: var(--accent); }
[hidden] { display: none !important; }
/* Tabs: pure CSS, radios drive which section shows. */
.tabs > input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.tablist { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 20px; }
.tablist label { flex: 1; text-align: center; padding: 10px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 14px; }
.tab { display: none; }
#t-users:checked ~ .tablist label[for=t-users], #t-link:checked ~ .tablist label[for=t-link] { background: var(--raised); color: var(--text); }
#t-users:checked ~ .tab-users, #t-link:checked ~ .tab-link { display: block; }
#t-users:focus-visible ~ .tablist label[for=t-users], #t-link:focus-visible ~ .tablist label[for=t-link] { outline: 2px solid var(--accent); }
form:has(input[value=password]:checked) .opt-shared, form:has(input[value=users]:checked) .opt-shared { display: flex; flex-direction: column; gap: 16px; }

/* --- Sidebar search --------------------------------------------------------------------- */
.search { position: relative; margin: 20px 0 14px; }
.search .ico { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; stroke: var(--faint); pointer-events: none; }
.search input[type=search] { -webkit-appearance: none; appearance: none; width: 100%; height: 40px; padding: 0 12px 0 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 14px var(--sans); }
.search input[type=search]::placeholder { color: var(--faint); }
.search input[type=search]:focus { outline: none; border-color: var(--accent); }
.search input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
