/* Tonjum Transfer — theme ported from tonjum.net (matte glass on the Mankato line-art backdrop) */
:root {
  --bg: #1b1d26;
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.62);
  --text-3: rgba(255, 255, 255, 0.4);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.16);
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.09);
  --blue: #3b82f6;
  --indigo: #6366f1;
  --blue-soft: #60a5fa;
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #fbbf24;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { overscroll-behavior: none; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif; font-feature-settings: 'cv11', 'ss01';
  font-size: 15px; line-height: 1.5;
}
h1, h2, h3, h4 { font-family: 'Outfit', 'Inter', ui-sans-serif, system-ui, sans-serif; margin: 0; font-weight: 600; letter-spacing: -0.01em; word-spacing: 0.08em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--blue-soft); text-decoration: none; }
a:hover { color: #93c5fd; }
::selection { background: rgba(59, 130, 246, 0.4); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
[hidden] { display: none !important; }

/* Background */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg::before { content: ''; position: absolute; inset: 0; background: url('/img/bg.webp') center / cover no-repeat; opacity: 0.35; }
.bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(26, 28, 36, 0.7), rgba(26, 28, 36, 0.4), rgba(26, 28, 36, 0.8)); }
#root { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 56px;
  background: rgba(4, 8, 24, 0.7); border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
}
.nav-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, 0.92); font-weight: 500; font-size: 0.9375rem; letter-spacing: -0.01em; white-space: nowrap; justify-self: start; }
.brand .accent { color: var(--blue-soft); margin-left: -4px; }
.brand:hover { color: #fff; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.nav-links { display: flex; gap: 2px; justify-content: center; }
.nav-link { color: rgba(255, 255, 255, 0.55); font-size: 0.8125rem; padding: 6px 12px; border-radius: 8px; transition: color 0.35s var(--ease), background 0.35s var(--ease); white-space: nowrap; }
.nav-link:hover { color: rgba(255, 255, 255, 0.92); }
.nav-link.active { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--text-2); justify-self: end; }
.nav-user .who { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout */
.page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 96px 24px 64px; }
.page.narrow { max-width: 760px; }
.page.tiny { max-width: 460px; }
.eyebrow { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(96, 165, 250, 0.7); margin-bottom: 10px; }
.page-head { margin-bottom: 28px; }
.page-head p { color: var(--text-2); margin-top: 10px; max-width: 56ch; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > div:empty { display: none; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 0.8125rem; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
footer.foot { text-align: center; padding: 24px; color: var(--text-3); font-size: 0.75rem; }

/* Matte card */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 1.25rem;
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2); padding: 28px;
}
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.18) 0%, transparent 40%, transparent 60%, rgba(255, 255, 255, 0.06) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude;
}
.card::after { content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); pointer-events: none; }
.card.flush { padding: 0; overflow: hidden; }
.card.blue { background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(99, 102, 241, 0.16)); border-color: rgba(99, 130, 246, 0.3); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 26px; border-radius: 9999px;
  font: inherit; font-size: 0.9375rem; font-weight: 500; letter-spacing: 0.01em; color: #fff; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(99, 130, 246, 0.3); background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.24));
  transition: all 0.4s var(--ease);
}
.btn:hover:not(:disabled) { border-color: rgba(99, 130, 246, 0.55); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(59, 130, 246, 0.22); background: linear-gradient(135deg, rgba(59, 130, 246, 0.42), rgba(99, 102, 241, 0.34)); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: transparent; border-color: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.82); }
.btn.secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.26); box-shadow: none; color: #fff; }
.btn.danger { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.32); color: #fca5a5; }
.btn.danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.2); border-color: rgba(248, 113, 113, 0.55); box-shadow: 0 8px 32px rgba(248, 113, 113, 0.15); color: #fecaca; }
.btn.sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn.lg { padding: 15px 34px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn svg, .icon svg { width: 16px; height: 16px; flex: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-soft); cursor: pointer; }
.link-btn:hover { color: #93c5fd; }
.icon-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: all 0.3s var(--ease); flex: none; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.icon-btn.danger:hover { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
.icon-btn svg { width: 16px; height: 16px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 0.8125rem; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 0.75rem; color: var(--text-3); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 0.9375rem; color: #fff; padding: 11px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); outline: none; transition: all 0.3s var(--ease);
}
textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: rgba(99, 130, 246, 0.6); background: rgba(255, 255, 255, 0.07); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
select option { background: #232635; color: #fff; }
.input-row { display: flex; gap: 8px; }
.input-row .suffix { display: flex; align-items: center; color: var(--text-3); font-size: 0.8125rem; padding: 0 4px; white-space: nowrap; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.875rem; color: var(--text-2); user-select: none; }
.check input { accent-color: var(--blue); width: 16px; height: 16px; margin: 0; }
.or { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.error-box { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); color: #fca5a5; padding: 10px 14px; border-radius: 12px; font-size: 0.875rem; }
.info-box { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(99, 130, 246, 0.3); color: #bfdbfe; padding: 10px 14px; border-radius: 12px; font-size: 0.875rem; }

/* Dropzone */
.drop {
  border: 1.5px dashed rgba(255, 255, 255, 0.2); border-radius: 1rem; padding: 34px 20px; text-align: center;
  background: rgba(255, 255, 255, 0.025); transition: all 0.4s var(--ease);
}
.drop.over { border-color: var(--blue); background: rgba(59, 130, 246, 0.12); transform: scale(1.005); }
.drop .big { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--blue-soft); }
.drop .big svg { width: 100%; height: 100%; }
.drop h3 { margin-bottom: 4px; }
.drop .actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* File list */
.files { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); min-width: 0; }
.file:last-child { border-bottom: 0; }
.file .ico { color: var(--blue-soft); width: 18px; height: 18px; flex: none; }
.file .ico svg { width: 18px; height: 18px; }
.file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .name small { display: block; color: var(--text-3); font-size: 0.75rem; }
.file .size { color: var(--text-3); font-size: 0.8125rem; white-space: nowrap; }
.files.scroll { max-height: 320px; overflow-y: auto; }
.tree-dir > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.tree-dir > summary::-webkit-details-marker { display: none; }
.tree-dir > summary .icon, .file .ico { display: inline-flex; align-items: center; }
.tree-dir > summary .chev { transition: transform 0.3s var(--ease); color: var(--text-3); }
.tree-dir[open] > summary .chev { transform: rotate(90deg); }
.tree-dir > summary:hover { background: rgba(255, 255, 255, 0.04); }
.tree-dir .tree-children { border-left: 1px solid rgba(255, 255, 255, 0.08); margin-left: 21px; }
.file a.name { color: #fff; }
.file a.name:hover { color: #93c5fd; }

/* Progress */
.progress { height: 8px; border-radius: 9999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--indigo)); transition: width 0.25s linear; }
.progress.warn > div { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.progress.thin { height: 5px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 9999px; background: rgba(255, 255, 255, 0.08); color: var(--text-2); }
.badge.blue { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.badge.green { background: rgba(74, 222, 128, 0.14); color: #86efac; }
.badge.red { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
.badge.amber { background: rgba(251, 191, 36, 0.14); color: #fcd34d; }
.badge svg { width: 11px; height: 11px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.3s var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
td.actions { text-align: right; white-space: nowrap; }
td .sub { display: block; color: var(--text-3); font-size: 0.75rem; }
tr.disabled td { opacity: 0.5; }

/* Tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); margin-bottom: 20px; }
.tab { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 0.8125rem; padding: 7px 18px; border-radius: 9999px; cursor: pointer; transition: all 0.3s var(--ease); }
.tab.active { background: rgba(59, 130, 246, 0.25); color: #fff; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px 20px; }
.stat .v { font-family: 'Outfit', sans-serif; font-size: 1.6rem; font-weight: 600; }
.stat .k { font-size: 0.75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }

/* Modal */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 10, 18, 0.65); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade 0.25s var(--ease); }
.modal { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: rgba(30, 33, 45, 0.94); animation: rise 0.4s var(--ease); }
.modal h2 { margin-bottom: 18px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.secret { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); font-size: 1.15rem; letter-spacing: 0.06em; }
.secret span { flex: 1; user-select: all; }

/* Toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 11px 20px; border-radius: 9999px; font-size: 0.875rem; background: rgba(30, 33, 45, 0.95); border: 1px solid var(--line-2); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); animation: rise 0.4s var(--ease); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); color: #fca5a5; }

/* Link box */
.linkbox { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 16px; border-radius: 9999px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); }
.linkbox input { background: transparent; border: 0; padding: 6px 0; box-shadow: none !important; flex: 1; min-width: 0; font-size: 0.9375rem; }

.center { text-align: center; }
.hero-icon { width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.25)); border: 1px solid rgba(99, 130, 246, 0.35); color: #bfdbfe; }
.hero-icon svg { width: 26px; height: 26px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--blue-soft); animation: spin 0.8s linear infinite; margin: 60px auto; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
/* Animate the cards/headings themselves, never a wrapper around them: a partly transparent ancestor stops the
   cards' backdrop-filter blur from applying, so the blur (and brightness) would pop in when the fade ended. */
.page-head, .tabs, .page .card, .page .spinner { animation: rise 0.7s var(--ease) backwards; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

@media (max-width: 720px) {
  .page { padding: 84px 16px 48px; }
  .card { padding: 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .nav-inner { padding: 0 12px; }
  th:nth-child(n+4), td:nth-child(n+4) { white-space: nowrap; }
}

@media (max-width: 440px) { .brand .co { display: none; } .brand .accent { margin-left: 0; } }

/* Below ~960px the brand + links + user no longer fit on one row without pushing the links off-center. */
@media (max-width: 960px) {
  .nav-inner { gap: 0 8px; }
  .nav-user .who { display: none; }
  /* Phones: brand + sign-out on one row, the links centered on a second row. */
  .nav.has-links { height: auto; }
  .nav.has-links .nav-inner { height: auto; padding-block: 8px 6px; grid-template-columns: 1fr auto; grid-template-areas: 'brand user' 'links links'; row-gap: 4px; }
  .nav.has-links .brand { grid-area: brand; }
  .nav.has-links .nav-user { grid-area: user; }
  .nav.has-links .nav-links { grid-area: links; }
  .nav.has-links ~ .page { padding-top: 116px; }
  .nav-inner { grid-template-columns: 1fr auto; }
}

/* Media preview lightbox */
.overlay.lb { background: rgba(6, 8, 14, 0.88); padding: 16px; }
.lb-box { width: 100%; max-width: 1200px; max-height: 100%; display: flex; flex-direction: column; gap: 12px; animation: rise 0.4s var(--ease); }
.lb-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lb-stage { display: flex; align-items: center; justify-content: center; min-height: 0; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 12px; background: #000; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5); }
.lb-stage video { width: 100%; }
.lb-audio { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 28px; width: min(560px, 100%); border-radius: 1.25rem; background: var(--surface); border: 1px solid var(--line); }
.lb-audio .hero-icon { margin: 0; }
.lb-audio audio { width: 100%; }
.lb-name { text-align: center; word-break: break-word; }
.lb-msg { text-align: center; padding: 48px 24px; color: var(--text-2); }
@media (max-width: 720px) { .lb-head .btn { display: none; } }

/* Selection */
input.sel { accent-color: var(--blue); width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; }
.selbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: rgba(59, 130, 246, 0.14); border: 1px solid rgba(99, 130, 246, 0.35); font-size: 0.875rem; }
.tree-dir > summary .icon-btn { margin-left: 4px; }
@media (max-width: 720px) {
  .tree-dir > summary .size { display: none; }   /* give nested folder names room on phones */
  .selbar .grow { flex-basis: 100%; }
}
