/*
  Quantex Secure File Share.
  Direction: a quiet, well-lit hall. Warm paper surfaces, a deep navy side rail, brass used sparingly for
  what matters. Serif headings for a document feel; a plain sans for everything you operate.
  No external fonts or images: the page's security policy only allows its own files.
*/

:root {
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --surface-sunk: #efeadd;
  --ink: #17211f;
  --ink-soft: #4d5955;
  --ink-faint: #7d8782;
  --line: #e0d9c9;
  --line-strong: #cfc6b2;
  --navy: #101a30;
  --navy-lift: #1b2a4a;
  --navy-action: #24468f;
  --navy-action-deep: #1a3470;
  --brass: #b48a35;
  --brass-soft: #f1e4c4;
  --danger: #a3341f;
  --danger-soft: #f6e2dc;
  --ok: #2e6b3e;
  --ok-soft: #e1eedd;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(23, 33, 31, .05), 0 8px 24px -12px rgba(23, 33, 31, .18);
  --rail-width: 256px;
  --font-display: "Sitka Heading", "Sitka Display", "Constantia", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;

  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-body-font-family: var(--font-body);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--ink-faint);
  --bs-link-color-rgb: 36, 70, 143;
  --bs-link-hover-color-rgb: 26, 52, 112;
  --bs-font-monospace: var(--font-mono);
  --bs-border-radius: var(--radius-sm);
}

html {
  font-size: 15px;
  min-height: 100%;
}

@media (min-width: 992px) {
  html { font-size: 16px; }
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 78% -8%, rgba(180, 138, 53, .10), transparent 62%),
    var(--paper);
  background-attachment: fixed;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  vertical-align: -0.2em;
}

/* ---------- Side rail (staff) ---------- */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem 1rem;
  color: #dde3ee;
  background:
    repeating-linear-gradient(102deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 44px),
    linear-gradient(178deg, var(--navy-lift), var(--navy) 46%, #0a1122);
  border-right: 1px solid rgba(0, 0, 0, .25);
  z-index: 20;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .25rem .5rem 1.5rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  color: var(--brass);
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.brand-kicker {
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .72;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: .005em;
}

.rail-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }

.rail-heading {
  margin: 1.4rem .75rem .4rem;
  font-size: .66rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(221, 227, 238, .5);
}

.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .58rem .75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: rgba(221, 227, 238, .82);
  font: inherit;
  font-size: .95rem;
  text-align: left;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.rail-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.rail-link.is-active {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.rail-link.is-active::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brass);
}

.rail-link:focus-visible, .topbar-link:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.rail-foot {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.rail-user { display: flex; align-items: center; gap: .65rem; padding: 0 .5rem .6rem; }

.avatar {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--brass);
  color: var(--navy);
  font-weight: 700;
  flex: none;
}

.rail-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.rail-user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user-role { font-size: .75rem; opacity: .65; }
.rail-signout { color: rgba(221, 227, 238, .7); }
.rail-signout span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Top bar (recipients and sign-in) ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 2.5rem);
  color: #dde3ee;
  background:
    repeating-linear-gradient(102deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 44px),
    linear-gradient(90deg, var(--navy), var(--navy-lift));
}

.topbar .rail-brand { padding: 0; }
.topbar-nav { display: flex; align-items: center; gap: .25rem; }
.topbar-nav form { margin: 0; }

.topbar-link {
  padding: .45rem .8rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: rgba(221, 227, 238, .85);
  font: inherit;
  text-decoration: none;
}

.topbar-link:hover { background: rgba(255, 255, 255, .09); color: #fff; }

/* ---------- Page frame ---------- */

.has-rail .stage { margin-left: var(--rail-width); }

.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.75rem) clamp(1rem, 3.5vw, 2.75rem) 4rem;
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}

/* Movement only, never opacity: if a browser pauses animations, the page must still be readable. */
@keyframes rise {
  from { transform: translateY(10px); }
  to { transform: none; }
}

@media (max-width: 991.98px) {
  .rail {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: .75rem 1rem;
    gap: .5rem;
  }
  .rail-brand { padding: 0 .5rem 0 0; }
  .rail-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .rail-heading, .rail-user { display: none; }
  .rail-link { width: auto; }
  .rail-link.is-active::before { display: none; }
  .rail-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .has-rail .stage { margin-left: 0; }
}

/* ---------- Type ---------- */

h1, h2, h3, .h1, .h2, .h3, .h4, .h5 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -.005em;
}

h1, .h1, h1.h3 {
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: .6rem;
}

h2, h2.h5 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2.25rem 0 .9rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}

.text-muted { color: var(--ink-soft) !important; }
.small, small { color: inherit; }
code { color: var(--navy-action-deep); background: var(--surface-sunk); padding: .08em .35em; border-radius: 4px; }
.font-monospace { font-family: var(--font-mono) !important; }

a { text-underline-offset: .18em; text-decoration-thickness: .06em; }

/* ---------- Breadcrumb ---------- */

.breadcrumb {
  --bs-breadcrumb-divider: "/";
  --bs-breadcrumb-divider-color: var(--line-strong);
  --bs-breadcrumb-item-active-color: var(--ink-soft);
  margin-bottom: 1.4rem;
  font-size: .88rem;
}

.breadcrumb-item a { text-decoration: none; color: var(--ink-soft); }
.breadcrumb-item a:hover { color: var(--navy-action); text-decoration: underline; }

/* ---------- Buttons ---------- */

.btn {
  --bs-btn-border-radius: var(--radius-sm);
  --bs-btn-font-weight: 600;
  --bs-btn-padding-x: 1rem;
  --bs-btn-padding-y: .5rem;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .06s ease, box-shadow .15s ease;
}

.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .28rem; --bs-btn-font-size: .84rem; }

.btn-primary {
  --bs-btn-bg: var(--navy-action);
  --bs-btn-border-color: var(--navy-action);
  --bs-btn-hover-bg: var(--navy-action-deep);
  --bs-btn-hover-border-color: var(--navy-action-deep);
  --bs-btn-active-bg: var(--navy);
  --bs-btn-active-border-color: var(--navy);
  --bs-btn-disabled-bg: var(--ink-faint);
  --bs-btn-disabled-border-color: var(--ink-faint);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 14px -8px rgba(36, 70, 143, .7);
}

.btn-outline-primary {
  --bs-btn-color: var(--navy-action);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-bg: var(--surface);
  --bs-btn-hover-bg: var(--navy-action);
  --bs-btn-hover-border-color: var(--navy-action);
  --bs-btn-active-bg: var(--navy-action-deep);
  --bs-btn-active-border-color: var(--navy-action-deep);
}

.btn-outline-secondary {
  --bs-btn-color: var(--ink-soft);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-bg: var(--surface);
  --bs-btn-hover-bg: var(--ink);
  --bs-btn-hover-border-color: var(--ink);
  --bs-btn-active-bg: var(--ink);
  --bs-btn-active-border-color: var(--ink);
}

.btn-outline-danger {
  --bs-btn-color: var(--danger);
  --bs-btn-border-color: transparent;
  --bs-btn-bg: transparent;
  --bs-btn-hover-bg: var(--danger);
  --bs-btn-hover-border-color: var(--danger);
  --bs-btn-active-bg: var(--danger);
  --bs-btn-active-border-color: var(--danger);
}

.btn-link { --bs-btn-color: var(--navy-action); --bs-btn-hover-color: var(--navy-action-deep); }

.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--navy-action);
  box-shadow: 0 0 0 .2rem rgba(36, 70, 143, .2);
  outline: 0;
}

/* ---------- Forms ---------- */

.form-label {
  margin-bottom: .3rem;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink-soft);
}

.form-control, .form-select {
  padding: .55rem .8rem;
  background-color: var(--surface);
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
}

.form-control::placeholder { color: var(--ink-faint); }
.form-control:disabled { background-color: var(--surface-sunk); }
.form-text { color: var(--ink-faint); font-size: .8rem; }
.form-check-input { border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--navy-action); border-color: var(--navy-action); }
.form-control[type="file"]::file-selector-button { background: var(--surface-sunk); color: var(--ink); }

/* The main forms of a page sit on a raised sheet. */
#policy-form, #mail-form, #test-form, #grant-form, #invite-form, .sheet {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#invite-form { margin-left: 0; margin-right: 0; }

/* ---------- Tables ---------- */

.table-responsive {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: rgba(180, 138, 53, .07);
  margin-bottom: 0;
}

.table > :not(caption) > * > * { padding: .8rem 1.1rem; }

.table thead th {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
.table thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
.table tbody tr { transition: background-color .12s ease; }
.table tbody tr:hover > * { background-color: var(--bs-table-hover-bg); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody th[scope="row"] { color: var(--ink-soft); font-weight: 600; }
.table a { font-weight: 600; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table .btn { vertical-align: middle; }
.table form.d-inline + form.d-inline, .table .btn + form.d-inline { margin-left: .15rem; }

.name-cell { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.name-cell .icon { width: 1.35rem; height: 1.35rem; color: var(--ink-faint); }
.name-cell .icon-folder { color: var(--brass); }
.hash { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-faint); word-break: break-all; max-width: 22rem; }

/* ---------- Alerts and tags ---------- */

.alert {
  border-radius: var(--radius);
  border-width: 1px 1px 1px 4px;
  padding: .9rem 1.1rem;
}

.alert-success { background: var(--ok-soft); border-color: var(--ok); color: #1f4a2a; }
.alert-warning { background: var(--brass-soft); border-color: var(--brass); color: #5a4313; }
.alert-danger { background: var(--danger-soft); border-color: var(--danger); color: #6e2315; }
.alert-info { background: #e4e9f4; border-color: var(--navy-action); color: var(--navy); }
.alert ul { margin: 0; padding-left: 1.1rem; }
.text-danger { color: var(--danger) !important; }

.badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .6rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.3;
}

.badge.text-bg-secondary, .tag { background: var(--surface-sunk) !important; color: var(--ink-soft) !important; border: 1px solid var(--line); }
.tag-brass { background: var(--brass-soft) !important; color: #5a4313 !important; border-color: #e2cf9d; }
.tag-navy { background: #e1e7f3 !important; color: var(--navy-action-deep) !important; border-color: #c5d0e6; }
.tag-danger { background: var(--danger-soft) !important; color: var(--danger) !important; border-color: #e9c4ba; }

/* ---------- Page head ---------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-head h1 { margin: 0; }
.page-head .lede { margin: .35rem 0 0; color: var(--ink-soft); max-width: 60ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Workspace cards ---------- */

.ws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: 1.1rem;
}

.ws-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}

.ws-card:nth-child(2) { animation-delay: .04s; }
.ws-card:nth-child(3) { animation-delay: .08s; }
.ws-card:nth-child(4) { animation-delay: .12s; }
.ws-card:nth-child(n+5) { animation-delay: .16s; }

.ws-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--navy-action), var(--brass));
  opacity: 0;
  transition: opacity .18s ease;
}

.ws-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 2px 4px rgba(23, 33, 31, .06), 0 18px 34px -18px rgba(23, 33, 31, .32); }
.ws-card:hover::before { opacity: 1; }

.ws-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* The whole card opens the workspace; the links and buttons inside it stay clickable above that. */
.ws-card-title::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.ws-card-title:hover { color: var(--navy-action); }
.ws-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }

.ws-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin: 0;
  padding: .75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ws-facts div { display: flex; flex-direction: column; }
.ws-facts dt { order: 2; font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.ws-facts dd { order: 1; margin: 0; font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
.ws-facts a { position: relative; z-index: 1; color: inherit; text-decoration: none; }
.ws-facts a:hover { color: var(--navy-action); text-decoration: underline; }
.ws-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--ink-faint); }
.ws-card-foot form { position: relative; z-index: 1; margin: 0; }

.create-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: flex-start;
  padding: 1rem;
  margin-bottom: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.create-bar .grow { flex: 1 1 16rem; }

.empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty .icon { width: 2.6rem; height: 2.6rem; color: var(--brass); margin-bottom: .75rem; }
.empty p { margin: 0 auto; max-width: 46ch; }

/* ---------- Upload ---------- */

.work-bar {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1rem;
  margin-bottom: .75rem;
}

@media (max-width: 767.98px) { .work-bar { grid-template-columns: 1fr; } }

.upload-form {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  transition: border-color .15s ease, background-color .15s ease;
}

.upload-form > div { padding: 0; margin: 0; }
.upload-form .grow { flex: 1 1 14rem; }
.upload-form.is-dragover { border-color: var(--navy-action); background: #e9eef8; }
.upload-form .upload-hint { flex: 1 1 100%; font-size: .8rem; color: var(--ink-faint); }
.upload-form .upload-line { flex: 1 1 100%; display: flex; align-items: center; gap: .75rem; min-height: 1.2rem; }
.upload-status { font-size: .85rem; }
.upload-status.is-error { color: var(--danger) !important; font-weight: 600; }

progress.upload-progress {
  flex: 1;
  height: .45rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-sunk);
  accent-color: var(--navy-action);
}

progress.upload-progress::-webkit-progress-bar { background: var(--surface-sunk); }
progress.upload-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--navy-action), var(--brass)); border-radius: 999px; }
progress.upload-progress::-moz-progress-bar { background: var(--navy-action); }
progress.upload-progress[hidden] { display: none; }

.folder-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.folder-form .grow { flex: 1 1 10rem; }

/* ---------- Stat tiles ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin: 0 0 1.75rem;
}

.stat {
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-value { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.stat-label { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.stat-accent { background: linear-gradient(160deg, var(--navy-lift), var(--navy)); border-color: var(--navy); color: #eef1f7; }
.stat-accent .stat-label { color: rgba(238, 241, 247, .7); }
.stat-accent .stat-value { color: var(--brass-soft); }

/* ---------- Sign-in pages ---------- */

.gate {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  max-width: 60rem;
  margin: clamp(1rem, 6vh, 4rem) auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 4px rgba(23, 33, 31, .05), 0 30px 60px -30px rgba(23, 33, 31, .35);
  overflow: hidden;
}

.gate-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 26rem;
  padding: 2.25rem;
  color: #e6ebf4;
  background:
    repeating-linear-gradient(102deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 38px),
    radial-gradient(420px 320px at 85% 0%, rgba(180, 138, 53, .38), transparent 70%),
    linear-gradient(165deg, var(--navy-lift), var(--navy) 55%, #080e1c);
}

.gate-art .brand-mark { position: absolute; top: 2rem; left: 2.25rem; width: 3rem; height: 3rem; }
.gate-art h2 { margin: 0 0 .6rem; padding: 0; border: 0; color: #fff; font-size: 1.9rem; line-height: 1.15; }
.gate-art p { margin: 0; max-width: 30ch; color: rgba(230, 235, 244, .78); }

.gate-points { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .5rem; font-size: .88rem; color: rgba(230, 235, 244, .82); }
.gate-points li { display: flex; gap: .6rem; align-items: center; }
.gate-points .icon { color: var(--brass); }

.gate-form { padding: clamp(1.5rem, 4vw, 2.75rem); align-self: center; }
.gate-form h1 { font-size: 1.75rem; }
.gate-form .btn-primary { width: 100%; padding-top: .65rem; padding-bottom: .65rem; }
.gate-form .lede { color: var(--ink-soft); margin-bottom: 1.4rem; }
.gate-foot { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-soft); }

.code-input {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: .3em;
  text-align: center;
}

@media (max-width: 767.98px) {
  .gate { grid-template-columns: 1fr; }
  .gate-art { min-height: 0; padding: 4.5rem 1.5rem 1.5rem; }
  .gate-art .brand-mark { top: 1.25rem; left: 1.5rem; width: 2.25rem; height: 2.25rem; }
  .gate-points { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Beside the side menu the content starts next to it instead of floating in the middle of a wide screen. */
.has-rail .page { margin-left: 0; margin-right: auto; }

.sheet.narrow { max-width: 30rem; }


/* ---------- Log ---------- */

.log-table { table-layout: auto; font-size: .9rem; }
.log-table .tag { white-space: nowrap; }
.log-who { font-weight: 600; overflow-wrap: anywhere; }
.log-sub { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-faint); }
.log-file { min-width: 11rem; max-width: 18rem; overflow-wrap: anywhere; }
.log-detail { min-width: 20rem; overflow-wrap: anywhere; color: var(--ink-soft); font-size: .84rem; }

.log-table td:nth-child(3) { min-width: 11rem; }


/* ---------- Roles ---------- */

.role-key { display: grid; gap: .25rem; margin: .75rem 0 0; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .82rem; }
.role-key div { display: flex; gap: .6rem; }
.role-key dt { flex: 0 0 6.5rem; font-weight: 700; color: var(--ink); }
.role-key dd { margin: 0; color: var(--ink-soft); }
.role-form .form-select { width: auto; min-width: 8.5rem; }
.form-select-sm { padding-top: .25rem; padding-bottom: .25rem; font-size: .84rem; }

/* On-screen viewer: pages as pictures, like sheets on a desk. */
.viewer { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 1.5rem 0 3rem; }
.viewer-page { margin: 0; max-width: 100%; }
.viewer-page img { display: block; max-width: 100%; height: auto; background: #fff; border: 1px solid #d9d2c1; box-shadow: 0 10px 30px rgba(16, 26, 48, .16); user-select: none; -webkit-user-drag: none; }
.viewer-page figcaption { text-align: center; font-size: .8rem; color: #6b6557; margin-top: .5rem; }
@media print { .viewer { display: none; } }

/*
  ---------- Enterprise pass ----------
  Direction: a tool people run a business on. Cool neutral greys, white working surfaces, hairline borders,
  one blue for actions, one typeface throughout, and rows dense enough to scan a long list. Nothing decorative:
  no paper tint, no gradients, no drop shadows, no serif. Brass survives only in the brand mark.
*/

:root {
  --paper: #f3f4f6;
  --surface: #ffffff;
  --surface-sunk: #f8f9fb;
  --ink: #101828;
  --ink-soft: #475467;
  --ink-faint: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --navy: #0c1524;
  --navy-lift: #0c1524;
  --navy-action: #1f5ae0;
  --navy-action-deep: #1848b8;
  --brass-soft: #fdf3d7;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --rail-width: 232px;
  --font-display: var(--font-body);
  --bs-link-color-rgb: 31, 90, 224;
  --bs-link-hover-color-rgb: 24, 72, 184;
}

html, html:root { font-size: 14px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-feature-settings: normal;
}

/* Side rail: one flat colour, tighter. */
.rail {
  padding: 1rem .75rem .75rem;
  background: var(--navy);
  border-right: 0;
}
.rail-brand { padding: .25rem .5rem 1.1rem; gap: .6rem; }
.brand-mark { width: 1.75rem; height: 1.75rem; }
.brand-kicker { font-size: .64rem; letter-spacing: .12em; opacity: .6; }
.brand-name { font-size: 1.1rem; font-weight: 600; letter-spacing: 0; }
.rail-heading { margin: 1.25rem .6rem .35rem; font-size: .68rem; letter-spacing: .08em; color: rgba(221, 227, 238, .45); }
.rail-link { padding: .5rem .6rem; gap: .6rem; font-size: .93rem; border-radius: var(--radius-sm); }
.rail-link.is-active { background: rgba(255, 255, 255, .09); color: #fff; }
.rail-link.is-active::before { display: none; }
.rail-foot { border-top: 1px solid rgba(255, 255, 255, .08); }
.avatar { background: #1f5ae0; color: #fff; }

/* Type: one family, clear steps, no flourish. */
h1, h2, h3, .h1, .h2, .h3, .h4, .h5 { font-family: var(--font-body); letter-spacing: -.01em; color: var(--ink); }
h1, .h1, h1.h3 { font-size: 1.5rem; font-weight: 600; }
h2, h2.h5 { font-size: 1.05rem; font-weight: 600; }
.page-head { margin-bottom: .75rem; align-items: center; }
.page-head h1 { margin-bottom: .15rem; }
.page-head .lede { font-size: .93rem; color: var(--ink-soft); max-width: 70ch; }
.breadcrumb { font-size: .86rem; margin-bottom: .9rem; }

/* Controls: compact, square-ish, flat. */
.btn {
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-weight: 500;
  font-size: .93rem;
  padding: .42rem .8rem;
  letter-spacing: 0;
}
.btn-sm { padding: .25rem .55rem; font-size: .86rem; }
.btn-primary { background: var(--navy-action); border-color: var(--navy-action); }
.btn-primary:hover, .btn-primary:focus { background: var(--navy-action-deep); border-color: var(--navy-action-deep); }
.btn-outline-primary, .btn-outline-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-outline-primary:hover, .btn-outline-secondary:hover { background: var(--surface-sunk); border-color: var(--line-strong); color: var(--ink); }
.btn-outline-danger { background: var(--surface); border-color: var(--line-strong); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger-soft); border-color: #fda29b; color: var(--danger); }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line-strong); background: var(--surface); box-shadow: none; padding: .42rem .65rem; font-size: .93rem; }
.form-label { font-size: .86rem; font-weight: 500; color: var(--ink-soft); margin-bottom: .3rem; }
.form-text { font-size: .82rem; color: var(--ink-faint); }

/* Panels: a hairline, not a floating card. */
#policy-form, #mail-form, #test-form, #grant-form, #invite-form, .sheet, .table-responsive, .create-bar, .upload-form, .folder-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}
.alert { border-radius: var(--radius-sm); box-shadow: none; font-size: .93rem; }

/* Tables: dense, quiet, built for long lists. */
.table { margin-bottom: 0; font-size: .93rem; }
.table > :not(caption) > * > * { padding: .5rem .85rem; border-bottom-color: var(--line); background: transparent; }
.table thead th {
  background: var(--surface-sunk);
  color: var(--ink-faint);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: none;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody tr:hover > * { background: #f5f8ff; }
.table a { font-weight: 500; }
.name-cell { gap: .55rem; }
.name-cell .icon { color: var(--ink-faint); }
.name-cell .icon-folder { color: #b7791f; }
/* Row actions stay out of the way until the row is pointed at or tabbed into. */
.table tbody .btn { border-color: transparent; background: transparent; color: var(--ink-soft); }
.table tbody tr:hover .btn, .table tbody tr:focus-within .btn { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.table tbody .btn-outline-danger, .table tbody tr:hover .btn-outline-danger, .table tbody tr:focus-within .btn-outline-danger { color: var(--danger); }
.table tbody .btn-outline-danger:hover { background: var(--danger-soft); }
.hash { font-size: .75rem; color: var(--ink-faint); }
/* The checksum is on each file's own page; the list is for finding files. */
.files-table th:nth-child(3), .files-table td:nth-child(3) { display: none; }

/* Tags: small labels, not pills. */
.badge, .tag { border-radius: 3px; font-size: .72rem; font-weight: 600; letter-spacing: .01em; text-transform: none; padding: .12rem .4rem; }
.badge.text-bg-secondary, .tag { background: #f2f4f7 !important; color: #344054 !important; border-color: #e4e7ec; }
.tag-brass { background: #fef7e6 !important; color: #8a5a00 !important; border-color: #f5dfa8; }
.tag-navy { background: #eef4ff !important; color: #1848b8 !important; border-color: #c7d7fe; }

/* Workspaces: flat tiles in a strict grid. */
.ws-card, .ws-card:nth-child(n) { transform: none; animation: none; box-shadow: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ws-card::before, .ws-card-title::after { display: none; }
.ws-card:hover { border-color: #b2ccff; box-shadow: 0 0 0 3px rgba(31, 90, 224, .08); transform: none; }
.ws-card-title { font-family: var(--font-body); font-size: 1.05rem; font-weight: 600; }
.ws-facts dd { font-family: var(--font-body); font-size: 1.15rem; font-weight: 600; }
.ws-facts dt { font-size: .72rem; letter-spacing: .03em; text-transform: none; color: var(--ink-faint); }

/* The working bar above a file list: one toolbar, not two cards. */
.work-bar { gap: .75rem; margin-bottom: .75rem; }
.upload-form, .folder-form { padding: .6rem .75rem; }
.upload-form .upload-hint { font-size: .8rem; color: var(--ink-faint); }
.form-control[type="file"]::file-selector-button { background: var(--surface-sunk); border-right: 1px solid var(--line-strong); color: var(--ink); font-weight: 500; }

/* Sign-in: plain and centred on the form. */
.gate { box-shadow: none; border: 1px solid var(--line); border-radius: var(--radius); }
.gate-art { background: var(--navy); }
.gate-art h2, .gate-form h1 { font-family: var(--font-body); letter-spacing: -.01em; }

.stat, .stat-accent { box-shadow: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-value { font-family: var(--font-body); font-weight: 600; }
.viewer-page img { border-color: var(--line-strong); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/*
  ---------- Top bar ----------
  The staff menu runs along the top, so lists and tables get the full width of the window.
  Account actions (devices, password, sign out) sit in a menu under the person's name.
*/
:root { --bar-height: 52px; }

.rail {
  inset: 0 0 auto 0;
  width: auto;
  height: var(--bar-height);
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, .3);
}
.rail-brand { padding: 0; flex: none; }
.rail-nav { flex-direction: row; align-items: center; gap: .15rem; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.rail-link { width: auto; white-space: nowrap; padding: .4rem .7rem; }
.rail-nav .rail-link.is-active { background: rgba(255, 255, 255, .12); }
/* "Administration" becomes a thin divider between everyday pages and the administrator's. */
.rail-heading { flex: none; width: 1px; height: 1.25rem; margin: 0 .6rem; padding: 0; overflow: hidden; font-size: 0; background: rgba(255, 255, 255, .18); }
.rail-foot { margin: 0; padding: 0; border: 0; flex: none; position: relative; }

.user-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .55rem; padding: .3rem .5rem; margin: 0; border-radius: var(--radius-sm); }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: rgba(255, 255, 255, .09); }
.user-menu > summary:focus-visible { outline: 2px solid #84adff; outline-offset: 2px; }
.user-menu .avatar { width: 1.9rem; height: 1.9rem; font-size: .86rem; }
.user-menu-caret { width: .95rem; height: .95rem; opacity: .7; }
.user-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  min-width: 13.5rem;
  padding: .3rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 24px -8px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .06);
  z-index: 30;
}
.user-menu-list form { margin: 0; }
.user-menu-list .rail-link { width: 100%; color: var(--ink); padding: .45rem .6rem; }
.user-menu-list .rail-link:hover, .user-menu-list .rail-link.is-active { background: var(--surface-sunk); color: var(--ink); }
.user-menu-list .rail-signout { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: .3rem; padding-top: .55rem; }

.has-rail .stage { margin-left: 0; padding-top: var(--bar-height); }
.has-rail .page { margin: 0 auto; max-width: 1360px; padding-top: 1.5rem; }

@media (max-width: 767.98px) {
  .rail { gap: .75rem; padding: 0 .75rem; }
  .rail .brand-kicker, .rail .rail-user-text { display: none; }
}

/*
  ---------- Soft pass ----------
  Direction: light and calm. A floating white bar with pill navigation, large rounded white cards on a soft
  grey page, near-black for the main action and one warm amber accent taken from the Atrium mark.
  Space and type size carry the hierarchy; colour is used sparingly.
*/
:root {
  --paper: #eef0f3;
  --surface: #ffffff;
  --surface-sunk: #f5f6f8;
  --ink: #14171c;
  --ink-soft: #4a5160;
  --ink-faint: #8a909c;
  --line: #eceef2;
  --line-strong: #dfe2e8;
  --accent: #e08a1e;
  --accent-soft: #fdf1df;
  --navy-action: #14171c;
  --navy-action-deep: #000000;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 23, 28, .04), 0 12px 32px -20px rgba(20, 23, 28, .22);
  --bar-height: 64px;
  --bar-gap: 14px;
  --bs-link-color-rgb: 20, 23, 28;
  --bs-link-hover-color-rgb: 0, 0, 0;
}

html, html:root { font-size: 15px; }
body { background: var(--paper); }

/* The bar floats above the page as a card of its own. */
.rail, .topbar {
  inset: var(--bar-gap) var(--bar-gap) auto var(--bar-gap);
  height: var(--bar-height);
  padding: 0 .75rem 0 1.25rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.topbar { position: sticky; top: var(--bar-gap); margin: var(--bar-gap) var(--bar-gap) 0; }
.rail-brand { color: var(--ink); }
.brand-mark { color: var(--accent); width: 1.9rem; height: 1.9rem; }
.brand-kicker { color: var(--ink-faint); opacity: 1; }
.brand-name { font-size: 1.2rem; font-weight: 650; letter-spacing: -.01em; }

.rail-nav { justify-content: center; gap: .25rem; }
.rail-nav .icon { display: none; }
.rail-link, .topbar-link { color: var(--ink-soft); border-radius: 999px; padding: .5rem 1.05rem; font-size: .97rem; font-weight: 500; }
.rail-link:hover, .topbar-link:hover { background: var(--surface-sunk); color: var(--ink); }
.rail-nav .rail-link.is-active { background: var(--ink); color: #fff; }
.rail-heading { background: var(--line-strong); height: 1.4rem; margin: 0 .5rem; }
.rail-link:focus-visible, .topbar-link:focus-visible, .user-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.user-menu > summary { padding: .3rem .6rem .3rem .3rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.user-menu > summary:hover, .user-menu[open] > summary { background: var(--surface-sunk); }
.user-menu .avatar { width: 2.2rem; height: 2.2rem; background: var(--ink); color: #fff; }
.rail-user-name { color: var(--ink); }
.rail-user-role { color: var(--ink-faint); }
.user-menu-list { border-radius: 16px; padding: .4rem; border-color: var(--line); }
.user-menu-list .rail-link { border-radius: 10px; }
.user-menu-list .rail-signout { border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }

.has-rail .stage { padding-top: calc(var(--bar-height) + var(--bar-gap) * 2); }
.has-rail .page, .page { max-width: 1400px; padding: 1.25rem clamp(1rem, 2.2vw, 1.75rem) 4rem; }

/* Type. */
h1, .h1, h1.h3 { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; }
h2, h2.h5 { font-size: 1.15rem; font-weight: 650; letter-spacing: -.01em; }
.page-head { margin-bottom: 1rem; }
.page-head .lede { font-size: .97rem; }
.breadcrumb { font-size: .9rem; }
.breadcrumb-item a { color: var(--ink-faint); }

/* Cards. */
#policy-form, #mail-form, #test-form, #grant-form, #invite-form, #sso-form, .sheet, .table-responsive, .create-bar, .upload-form, .folder-form,
.ws-card, .ws-card:nth-child(n), .stat, .stat-accent, .gate {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#policy-form, #mail-form, #test-form, #grant-form, #invite-form, #sso-form, .sheet { padding: 1.4rem 1.5rem; }
.table-responsive { padding: .35rem .5rem .5rem; }
.alert { border-radius: var(--radius-sm); }

/* Buttons: pills. The main action is near-black. */
.btn { border-radius: 999px; padding: .55rem 1.15rem; font-weight: 550; font-size: .95rem; }
.btn-sm { padding: .32rem .8rem; font-size: .88rem; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: #000; border-color: #000; }
.btn-outline-primary, .btn-outline-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-outline-primary:hover, .btn-outline-secondary:hover { background: var(--surface-sunk); border-color: var(--line-strong); color: var(--ink); }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: none; border-color: var(--line-strong); }

.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line-strong); background: var(--surface); padding: .6rem .85rem; font-size: .97rem; }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.form-control[type="file"] { padding: 0; overflow: hidden; }
.form-control[type="file"]::file-selector-button { padding: .6rem 1rem; background: var(--surface-sunk); border-right: 1px solid var(--line-strong); font-weight: 550; }

/* Tables: roomy rows, no header band. */
.table { font-size: .97rem; }
.table > :not(caption) > * > * { padding: .8rem .9rem; border-bottom-color: var(--line); }
.table thead th { background: transparent; color: var(--ink-faint); font-size: .8rem; font-weight: 500; letter-spacing: 0; }
.table tbody tr:hover > * { background: var(--surface-sunk); }
.table tbody tr:hover > *:first-child { border-radius: 12px 0 0 12px; }
.table tbody tr:hover > *:last-child { border-radius: 0 12px 12px 0; }
.table a { color: var(--ink); font-weight: 550; }
.table a:hover { color: #000; }
.name-cell .icon { width: 1.3rem; height: 1.3rem; color: var(--ink-faint); }
.name-cell .icon-folder { color: var(--accent); }
.table tbody tr:hover .btn, .table tbody tr:focus-within .btn { background: var(--surface); border-color: var(--line-strong); }

/* Tags: soft pills. */
.badge, .tag { border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; font-weight: 550; }
.badge.text-bg-secondary, .tag { background: var(--surface-sunk) !important; color: var(--ink-soft) !important; border-color: transparent; }
.tag-brass { background: var(--accent-soft) !important; color: #8a4b00 !important; border-color: transparent; }
.tag-navy { background: #eceef2 !important; color: var(--ink) !important; border-color: transparent; }
.tag-danger { border-color: transparent; }

/* Workspaces: the numbers lead. */
.ws-grid { gap: 1rem; }
.ws-card, .ws-card:nth-child(n) { padding: 1.3rem 1.4rem 1.1rem; }
.ws-card:hover { border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(20, 23, 28, .05), 0 18px 36px -20px rgba(20, 23, 28, .3); }
.ws-card-title { font-size: 1.15rem; font-weight: 650; color: var(--ink); }
.ws-facts dd { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; }
.ws-facts dt { font-size: .8rem; color: var(--ink-faint); }
.create-bar, .upload-form, .folder-form { padding: .75rem .85rem; }

/* Sign-in. */
.gate { overflow: hidden; }
.gate-art { background: var(--ink); }
.gate-points .icon { color: var(--accent); }
.viewer-page img { border-radius: 6px; }

@media (max-width: 767.98px) {
  .rail-nav { justify-content: flex-start; }
}

/* ---------- Profile ---------- */
img.avatar { object-fit: cover; padding: 0; border: 0; background: var(--surface-sunk); }
.avatar-xl { width: 96px; height: 96px; font-size: 2.2rem; flex: none; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1rem; align-items: start; }
.profile-card h2 { margin-bottom: 1rem; }
.profile-picture-row { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.profile-picture-actions { flex: 1; min-width: 15rem; display: flex; flex-direction: column; gap: 1rem; }
.profile-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem 1.5rem; margin: 0 0 1rem; }
.profile-facts dt { font-size: .8rem; font-weight: 500; color: var(--ink-faint); }
.profile-facts dd { margin: .1rem 0 0; font-weight: 550; overflow-wrap: anywhere; }
.avatar { background: var(--ink); color: #fff; }

/*
  ---------- Typeface ----------
  Geist and Geist Mono, served from this site's own files so every visitor sees the same type and nothing is
  fetched from anywhere else. Licensed under the SIL Open Font License 1.1 (fonts/Geist-OFL.txt).
*/
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --font-body: "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-display: var(--font-body);
  --font-mono: "Geist Mono", "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --bs-body-font-family: var(--font-body);
  --bs-font-monospace: var(--font-mono);
}
body { font-family: var(--font-body); letter-spacing: -.003em; }
h1, .h1, h1.h3 { font-weight: 600; letter-spacing: -.025em; }
h2, h2.h5, .ws-card-title, .brand-name { font-weight: 600; }
.ws-facts dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.table td, .stat-value { font-variant-numeric: tabular-nums; }
.btn { font-weight: 500; }
.hash, code, .font-monospace { font-family: var(--font-mono); }

/*
  ---------- Command bar ----------
  One bar above a file list: choose and upload on the left, new folder on the right. The whole bar is the
  drop target for files. On a narrow screen the two halves stack.
*/
.work-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .75rem 1.25rem;
  margin-bottom: 1rem;
  padding: .75rem .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.work-bar .upload-form, .work-bar .folder-form { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.work-bar .upload-form { flex: 1 1 30rem; gap: .5rem .75rem; }
.work-bar .folder-form { flex: 0 1 26rem; padding-left: 1.25rem; border-left: 1px solid var(--line); flex-wrap: nowrap; }
.work-bar .upload-form.is-dragover { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: .5rem; border-radius: var(--radius-sm); }
.upload-form .upload-hint { order: 5; margin-top: -.1rem; }
.upload-form .upload-line:has(progress[hidden]):has(.upload-status:empty) { display: none; }

/* The browser's own file control, dressed to match: a pill to choose, then the chosen names in plain text. */
.form-control[type="file"] { border: 0; background: transparent; padding: 0; color: var(--ink-soft); overflow: visible; }
.form-control[type="file"]::file-selector-button {
  margin: 0 .9rem 0 0;
  padding: .5rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}
.form-control[type="file"]:hover::file-selector-button { background: var(--surface-sunk) !important; }
.form-control[type="file"]:focus { outline: none; }
.form-control[type="file"]:focus-visible::file-selector-button { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 991.98px) {
  .work-bar .folder-form { flex: 1 1 100%; padding-left: 0; border-left: 0; padding-top: .75rem; border-top: 1px solid var(--line); }
}

/* Details that matter less sit back. */
.text-muted, .form-text { color: var(--ink-faint) !important; }
.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-faint); }
.role-key { background: var(--surface-sunk); border-radius: var(--radius-sm); border: 0; }
.log-table .tag { white-space: nowrap; }
code { background: var(--surface-sunk); color: var(--ink); border-radius: 6px; padding: .1rem .35rem; font-size: .88em; }
