/* Arrow Uploads — plain, dense, tool-like. */

:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --sunk: #ecece8;
  --line: #deded8;
  --line-strong: #c9c9c1;
  --text: #1c1c1a;
  --muted: #6c6c66;
  --accent: #b3261e;
  --accent-text: #ffffff;
  --accent-soft: #fbeae8;
  --ok: #1f7a3d;
  --ok-soft: #e6f3ea;
  --bad: #b3261e;
  --bad-soft: #fbeae8;
  --focus: #2f5fd0;
  --radius: 6px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --surface: #1b1b1a;
    --sunk: #232321;
    --line: #2d2d2a;
    --line-strong: #3c3c38;
    --text: #ececea;
    --muted: #9b9b94;
    --accent: #e5534b;
    --accent-text: #160404;
    --accent-soft: #3a1917;
    --ok: #57c27a;
    --ok-soft: #16301f;
    --bad: #f07068;
    --bad-soft: #3a1917;
    --focus: #7aa2ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
}
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
h1, h2 { margin: 0; line-height: 1.25; }
p { margin: 0; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.break { word-break: break-all; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- top bar */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-in {
  max-width: 1080px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 24px; height: 52px;
}
.mark { font-weight: 650; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs a {
  display: flex; align-items: center; padding: 0 10px;
  text-decoration: none; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.me { margin-left: auto; display: flex; gap: 14px; align-items: center; color: var(--muted); white-space: nowrap; }
.me span { color: var(--text); }
.me a { text-decoration: none; }
.me a:hover { text-decoration: underline; }

.page { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
.h1 { font-size: 20px; font-weight: 650; margin-bottom: 16px; }
.h2 { font-size: 15px; font-weight: 650; margin-bottom: 10px; }
.count { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  font: inherit; font-weight: 550; color: var(--text); text-decoration: none; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover { background: var(--sunk); }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-main { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-main:hover { background: var(--accent); filter: brightness(1.08); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--text); background: var(--sunk); }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn-danger:hover { background: var(--bad-soft); }
.btn.is-done { color: var(--ok); border-color: var(--ok); }
.js-copy { display: inline-grid; place-items: center; }
.js-copy > span { grid-area: 1 / 1; }
.js-copy .c-done, .js-copy.is-done .c-label { visibility: hidden; }
.js-copy.is-done .c-done { visibility: visible; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* ---------------------------------------------------------------- forms */
input[type="text"], input[type="password"], input[type="email"], input[type="search"], select {
  width: 100%; height: 36px; padding: 0 10px;
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
input:focus, select:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.field { display: grid; gap: 4px; }
.field > span { font-weight: 550; font-size: 13px; }
.field em { font-style: normal; color: var(--muted); font-weight: 400; }
.field small { color: var(--muted); }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.narrow { width: 100%; max-width: 380px; }
.code { letter-spacing: 0.2em; font-size: 18px; height: 44px; text-align: center; }

.note { padding: 9px 12px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.note-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.note-err { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }

.tag {
  display: inline-block; padding: 0 6px; margin-left: 4px;
  font-size: 11px; font-weight: 600; line-height: 18px; vertical-align: 1px;
  border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted);
}
.tag-on { color: var(--ok); border-color: var(--ok); }
.tag-bad { color: var(--bad); border-color: var(--bad); }

/* ---------------------------------------------------------------- sign-in card */
.solo { max-width: 380px; margin: 9vh auto 0; }
.solo-mark { font-weight: 650; margin-bottom: 14px; }
.solo-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.solo-card h1 { font-size: 18px; margin-bottom: 6px; }
.solo-card h1 + .muted { margin-bottom: 18px; }
.solo-card h1 + form, .solo-card h1 + .note { margin-top: 16px; }
.solo-card .btn-main, .solo-card .btn-danger { width: 100%; margin-top: 4px; }
.solo-alt { margin-top: 16px; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- upload */
.drop {
  display: grid; place-items: center; text-align: center; gap: 2px;
  padding: 28px 16px; margin-bottom: 12px;
  background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: 8px;
  cursor: pointer;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-title { font-weight: 600; font-size: 15px; }
.drop-hint { color: var(--muted); font-size: 13px; }

.queue { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.q {
  display: grid; grid-template-columns: minmax(0, 1fr) 160px 80px; gap: 12px; align-items: center;
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13px;
}
.q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-bar { height: 4px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.q-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.q-st { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.q.is-done .q-bar i { background: var(--ok); }
.q.is-done .q-st { color: var(--ok); }
.q.is-err { border-color: var(--bad); }
.q.is-err .q-st { color: var(--bad); }
.q-retry { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; color: var(--bad); }

/* ---------------------------------------------------------------- files */
.files-head { display: flex; align-items: center; gap: 12px; margin: 24px 0 10px; flex-wrap: wrap; }
.files-head h1 { font-size: 16px; font-weight: 650; margin-right: auto; }
.search { width: 240px; }
.search input { height: 32px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button {
  height: 30px; padding: 0 10px; border: 0; background: var(--surface);
  font: inherit; font-size: 13px; color: var(--muted); cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--sunk); color: var(--text); font-weight: 600; }

.flist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.f { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 12px; }
.f + .f { border-top: 1px solid var(--line); }
.f:hover { background: color-mix(in srgb, var(--sunk) 50%, transparent); }
.f.is-new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--ok-soft); } to { background: transparent; } }
.f-thumb {
  width: 44px; height: 44px; border-radius: 4px; overflow: hidden;
  display: grid; place-items: center; background: var(--sunk); text-decoration: none;
}
.f-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.f-ext { font: 600 10px/1 var(--mono); text-transform: uppercase; color: var(--muted); }
.f-main { display: grid; min-width: 0; }
.f-name { font-family: var(--mono); font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-name:hover { text-decoration: underline; }
.f-meta { color: var(--muted); font-size: 12px; }
.f-act { display: flex; gap: 6px; }

/* grid layout */
.flist.is-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px;
  background: none; border: 0;
}
.flist.is-grid .f {
  grid-template-columns: 1fr; gap: 8px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.flist.is-grid .f + .f { border-top: 1px solid var(--line); }
.flist.is-grid .f-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.flist.is-grid .f-thumb img { object-fit: contain; }
.flist.is-grid .f-act { flex-wrap: wrap; }
.flist.is-grid .f-act .btn { flex: 1; padding: 0 6px; }

.empty { color: var(--muted); padding: 32px 0; text-align: center; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; color: var(--muted); }

/* ---------------------------------------------------------------- settings / admin sections */
.sect {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px;
  padding: 20px 0; border-top: 1px solid var(--line);
}
.sect-l h2 { font-size: 14px; font-weight: 650; }
.sect-l p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.sect-r { display: grid; gap: 12px; align-content: start; justify-items: start; }
.keyline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.keyline code {
  padding: 5px 8px; background: var(--sunk); border: 1px solid var(--line); border-radius: 4px;
  max-width: 100%; overflow-wrap: anywhere;
}
.secret:not(.is-shown) { filter: blur(4px); user-select: none; }
.more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 10px 0 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.totp { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.qr { background: #fff; padding: 8px; border-radius: 4px; border: 1px solid var(--line); line-height: 0; }

.callout {
  background: var(--surface); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; display: grid; gap: 8px;
}
.grid-form { display: grid; grid-template-columns: 1fr 1fr 150px; gap: 12px; width: 100%; align-items: end; }
.grid-form-go { grid-column: 1 / -1; }

.block { margin-top: 28px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 12px; vertical-align: top; }
.table tr + tr td { border-top: 1px solid var(--line); }
.table tr.is-off td { opacity: 0.6; }
.t-act { text-align: right; white-space: nowrap; }
.t-act form { display: inline; }

.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 170px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 4px; display: grid; box-shadow: 0 6px 20px rgb(0 0 0 / 0.12);
}
.menu-pop form { display: block; }
.menu-pop button {
  width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none;
  font: inherit; color: var(--text); border-radius: 4px; cursor: pointer;
}
.menu-pop button:hover { background: var(--sunk); }
.menu-pop button.danger { color: var(--bad); }

/* ---------------------------------------------------------------- admin: users */
.tag-accent { color: var(--accent); border-color: var(--accent); }
.ulist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.u { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 14px 16px; }
.u + .u { border-top: 1px solid var(--line); }
.u.is-off .u-who, .u.is-off .u-stats { opacity: 0.55; }
.u-who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.u-av {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 650;
  background: var(--sunk); border: 1px solid var(--line-strong); color: var(--muted);
}
.u-id { min-width: 0; }
.u-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px; }
.u-tags .tag { margin-left: 0; }
.u-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: center; }
.u-stat { display: grid; gap: 2px; min-width: 0; }
.u-num { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.u-lbl { color: var(--muted); font-size: 12px; }
.menu-pop small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 1px; }
.u-menu .menu-pop { min-width: 250px; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: var(--radius);
  font-size: 13px; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.is-err { background: var(--bad); color: #fff; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 720px) {
  .bar-in { gap: 8px; }
  .tabs a { padding: 0 7px; }
  .me span { display: none; }
  .flist.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .flist.is-grid .f-act .btn { font-size: 12px; }
  .sect { grid-template-columns: 1fr; gap: 10px; }
  .grid-form { grid-template-columns: 1fr; }
  .search { width: 100%; order: 3; }
  .f { grid-template-columns: 44px minmax(0, 1fr); }
  .f-act { grid-column: 1 / -1; }
  .flist:not(.is-grid) .f-act .btn { flex: 1; }
  .q { grid-template-columns: minmax(0, 1fr) 60px; }
  .u { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .u-stats { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 48px; }
  .q-bar { grid-column: 1 / -1; grid-row: 2; }
}
