/* Copyright (c) 2026 Amplithian AI (Applied Intelligence) Studios LLC. All rights reserved.
   APF-Bytebox. Proprietary and confidential; see LICENSE at the repo root.

   Ampbox. Amplithian palette (AF-2026-0318): Blue #2563FF, Violet #7C5CFF,
   Dark Ink #0B1020, Light Core #F4F8FF. Inter, served from this box. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #F6F8FC;
  --surface: #FFFFFF;
  --raised: #F1F4FA;
  --line: #E4E8F1;
  --line-strong: #D3DAE8;
  --text: #0B1020;
  --dim: #4A5368;
  --faint: #7B8398;
  --accent: #2563FF;
  --accent-hover: #1D52E0;
  --accent-ink: #FFFFFF;
  --accent-soft: #EAF0FF;
  --violet: #7C5CFF;
  --danger: #D92D2D;
  --danger-soft: #FDECEC;
  --ok: #16A34A;
  --hover: #F3F6FD;
  --shadow: 0 1px 2px rgba(11, 16, 32, .05), 0 8px 24px rgba(11, 16, 32, .08);
  --radius: 10px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1020;
    --surface: #10162A;
    --raised: #161D33;
    --line: #20283F;
    --line-strong: #2C3550;
    --text: #E9EEFB;
    --dim: #A4AEC6;
    --faint: #6F7A94;
    --accent: #6B9AFF;
    --accent-hover: #86ADFF;
    --accent-ink: #0B1020;
    --accent-soft: #17234A;
    --violet: #A68FFF;
    --danger: #F26B6B;
    --danger-soft: #2A1418;
    --ok: #34D399;
    --hover: #141B30;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.icon { width: 34px; height: 34px; padding: 0; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: 60px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--dim); font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.nav a.on { color: var(--text); background: var(--raised); }
.top .spacer { flex: 1; }
.who { position: relative; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #2563FF, #7C5CFF); color: #fff;
  font-weight: 600; font-size: 13px;
}

/* ---------- menus ---------- */
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu .head { padding: 8px 10px 10px; color: var(--dim); font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 6px; word-break: break-all; }
.menu button {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; border-radius: 6px; background: none; cursor: pointer;
  text-align: left; font-size: 14px;
}
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- page ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 28px 24px 120px; }
h1 { font-size: 24px; line-height: 1.25; letter-spacing: -.02em; font-weight: 650; margin: 0; }
h2 { font-size: 17px; letter-spacing: -.01em; font-weight: 600; margin: 32px 0 8px; scroll-margin-top: 80px; }
h3 { font-size: 15px; font-weight: 600; margin: 22px 0 6px; }
p { margin: 0 0 12px; }
.lede { color: var(--dim); max-width: 64ch; }

/* ---------- files ---------- */
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
main > .bar:first-child { margin-top: 0; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; flex: 1; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.crumbs a, .crumbs span { padding: 2px 6px; border-radius: 6px; color: var(--text); }
.crumbs a { color: var(--dim); }
.crumbs a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.crumbs .sep { color: var(--faint); padding: 0; display: inline-flex; }
.crumbs .sep svg { width: 16px; height: 16px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--faint);
  width: 220px;
}
.search input { border: 0; outline: 0; background: none; width: 100%; color: var(--text); font-size: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); font-size: 14px; cursor: pointer; user-select: none; padding: 0 4px; }
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

.table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) 190px 110px 92px; align-items: center;
  min-height: 52px; padding: 0 8px 0 16px; border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row.head { min-height: 40px; color: var(--faint); font-size: 13px; font-weight: 500; background: var(--raised); }
.row.head button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; display: inline-flex; gap: 4px; align-items: center; }
.row.head button:hover { color: var(--text); }
.row.item:hover { background: var(--hover); }
.row.item.sel { background: var(--accent-soft); }
.row .name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row .name a, .row .name span.t { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.row .name a:hover { text-decoration: none; color: var(--accent); }
.row .meta { color: var(--dim); font-size: 14px; }
.row .acts { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; }
.row.item:hover .acts, .row.item:focus-within .acts, .row.item.sel .acts, .row.deleted .acts { opacity: 1; }
.row.deleted .name a, .row.deleted .name span.t { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.ficon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--raised); color: var(--dim); }
.ficon.dir { background: var(--accent-soft); color: var(--accent); }
.ficon svg { width: 18px; height: 18px; }
.empty { padding: 72px 24px; text-align: center; color: var(--dim); }
.empty svg { width: 36px; height: 36px; color: var(--faint); stroke-width: 1.25; margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

.drop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 3px dashed var(--accent); pointer-events: none;
}
.drop div { background: var(--surface); padding: 18px 26px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; }

/* ---------- side panel ---------- */
.panel {
  position: fixed; top: 60px; right: 0; bottom: 0; z-index: 30; width: 400px; max-width: 100%;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.panel header { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.panel header .t { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; word-break: break-word; }
.panel .body { padding: 16px 20px 32px; overflow: auto; }
.facts { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 14px; margin: 0 0 18px; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; color: var(--text); word-break: break-word; }
.panel .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.vers { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.vers li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.vers li:first-child { border-top: 0; }
.vers .v { flex: 1; min-width: 0; }
.vers .v b { font-weight: 600; }
.vers .v div { color: var(--faint); font-size: 13px; }
.vers .cur { color: var(--ok); font-size: 13px; font-weight: 500; }

/* ---------- uploads tray ---------- */
.tray {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; width: 380px; max-width: calc(100% - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  overflow: hidden;
}
.tray header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); }
.tray header span { flex: 1; }
.tray ul { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.tray li { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.tray li:first-child { border-top: 0; }
.tray .n { display: flex; gap: 8px; align-items: baseline; }
.tray .n b { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray .n small { color: var(--faint); font-size: 12px; white-space: nowrap; }
.tray .ask { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tray .ask .btn { height: 30px; padding: 0 10px; font-size: 13px; }
.prog { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2563FF, #7C5CFF); transition: width .2s; }
.tray li.done .prog i { background: var(--ok); }
.tray li.err small { color: var(--danger); }

/* ---------- dialogs ---------- */
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(11, 16, 32, .45); display: grid; place-items: center; padding: 16px; }
.dialog { width: 440px; max-width: 100%; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; }
.dialog h3 { margin: 0 0 8px; font-size: 17px; }
.dialog p { color: var(--dim); }
.dialog .row2 { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.field { display: block; margin: 14px 0 0; }
.field span { display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; font-weight: 500; }
.field input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); outline: 0;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}
.toast.err { background: var(--danger); color: #fff; }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.signin .card { width: 400px; max-width: 100%; }
.signin .mark { width: 44px; height: 44px; margin-bottom: 22px; }
.signin h1 { font-size: 26px; margin-bottom: 6px; }
.signin .lede { margin-bottom: 22px; }
.signin form .btn { width: 100%; justify-content: center; height: 42px; margin-top: 16px; }
.signin .err { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 21px; }
.signin .foot { margin-top: 28px; color: var(--faint); font-size: 13px; }

/* ---------- lists (activity, computers) ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list .li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); }
.list .li:first-child { border-top: 0; }
.list .li .grow { flex: 1; min-width: 0; }
.list .li .grow b { font-weight: 500; }
.list .li .sub { color: var(--faint); font-size: 13px; }
.day { color: var(--faint); font-size: 13px; font-weight: 500; margin: 26px 0 8px; }
.day:first-child { margin-top: 0; }
.op { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--raised); color: var(--dim); flex: none; }
.op.put { color: var(--accent); background: var(--accent-soft); }
.op.delete { color: var(--danger); background: var(--danger-soft); }
.op svg { width: 16px; height: 16px; }

.keybox {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 10px 12px;
  background: var(--raised); border: 1px solid var(--line); border-radius: 8px;
  font: 13px/1.4 var(--mono); word-break: break-all;
}
.keybox code { flex: 1; }
.warn { color: var(--dim); font-size: 13px; }

/* ---------- help ---------- */
.doc { max-width: 760px; }
.doc p, .doc li { color: var(--dim); }
.doc strong { color: var(--text); font-weight: 600; }
.doc ol, .doc ul { padding-left: 22px; margin: 0 0 14px; }
.doc li { margin: 4px 0; }
.doc pre {
  margin: 8px 0 16px; padding: 12px 14px; overflow: auto;
  background: var(--raised); border: 1px solid var(--line); border-radius: 8px;
  font: 13px/1.55 var(--mono); color: var(--text);
}
.doc code { font: 13px var(--mono); background: var(--raised); padding: 1px 5px; border-radius: 4px; color: var(--text); }
.doc pre code { background: none; padding: 0; }
.doc .toc { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 6px; font-size: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 4px; }
.tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--dim); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .top { gap: 10px; padding: 0 16px; }
  .brand span { display: none; }
  .nav a { padding: 7px 9px; }
  main { padding: 20px 16px 120px; }
  .row { grid-template-columns: minmax(0, 1fr) 84px; }
  .row .m-date, .row .m-size { display: none; }
  .row .acts { opacity: 1; }
  .crumbs { font-size: 18px; flex: 1 1 100%; }
  .search { width: 100%; order: 3; }
  .panel { top: 0; width: 100%; }
}
