/* Heller Studios Drop — styled after Studio OS (os.heller.tv) */
@font-face { font-family: Rubik; font-weight: 400; font-display: swap; src: url(/fonts/rubik-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Rubik; font-weight: 500; font-display: swap; src: url(/fonts/rubik-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Rubik; font-weight: 600; font-display: swap; src: url(/fonts/rubik-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Rubik; font-weight: 800; font-display: swap; src: url(/fonts/rubik-latin-800-normal.woff2) format("woff2"); }

:root {
  --paper: #f5f5f5; --surface: #fafafa; --raised: #ffffff; --ink: #2d2c2a; --muted: #76746f;
  --line: #e3e2df; --hover: #eeeeec; --lime: #e2f4a6; --pink: #eea0ff; --violet: #5a4eff;
  --link: #5a4eff; --btn: #2d2c2a; --btn-ink: #ffffff; --accent: #2d2c2a; --accent-soft: #e2f4a6;
  --red: #b8332a; --red-soft: #fbe3e0; --shadow: 0 6px 24px rgba(0, 0, 0, .1);
  --violet-soft: #e4e1ff; --r: 12px; --r-sm: 8px;
  color-scheme: light;
}
/* Client-facing dark theme, same as Studio OS client views */
:root[data-client] {
  --paper: #2d2c2a; --surface: #353431; --raised: #3d3c39; --ink: #f5f5f5; --muted: #b3b1ab;
  --line: #4a4945; --hover: #45443f; --violet: #a9a3ff; --link: #c4bfff; --btn: #e2f4a6;
  --btn-ink: #2d2c2a; --accent: #e2f4a6; --accent-soft: #48502d; --red: #ff8a80; --red-soft: #4a2b28;
  --shadow: 0 6px 24px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: Rubik, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums;
}
h1, h2 { font-weight: 500; margin: 0; }
a { color: var(--link); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.lede { color: var(--muted); margin: 0; max-width: 70ch; }
.muted { color: var(--muted); }
.note { font-size: 13px; margin: 0; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }

.btn {
  font-weight: 500; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--raised); cursor: pointer; white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn.primary:hover { opacity: .9; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line); }
.btn.danger-armed { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ok { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--ink); }
.btn.pinkbtn { background: var(--pink); border-color: var(--pink); color: var(--ink); }
.btn.pinkbtn:hover { border-color: var(--ink); }
.btn.tiny { padding: 2px 8px; font-size: 12px; }
.hint { opacity: .7; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: center; }
.tab {
  border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted);
  padding: 6px 1px; margin-right: 14px; cursor: pointer; font-size: 14px;
}
.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--violet); font-weight: 500; }
.tab .n { opacity: .6; margin-left: 5px; }
.tab[aria-pressed="true"] .n {
  opacity: 1; background: var(--pink); color: var(--ink); border-radius: 999px;
  padding: 0 7px; font-size: 12px; font-weight: 500;
}

.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input[type=email], input[type=password], input[type=text], input[type=search] {
  background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; font-size: 15px; width: 100%; outline: none;
}
input:focus { border-color: var(--violet); }

.brand { font-weight: 800; font-size: 30px; line-height: .9; letter-spacing: -.035em; }
.brand span { padding-left: .55em; }
.brand.sm { font-size: 17px; }

/* ---- Login / centered card ---- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(420px, 100%); background: var(--raised); border-radius: var(--r); padding: 32px 28px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { font-size: 28px; margin: 8px 0 0; }
.login-card h1 + .lede { margin-top: 6px; }
.login-card .btn.primary { padding: 10px 16px; }
.error { color: var(--red); background: var(--red-soft); padding: 8px 10px; border-radius: var(--r-sm); font-size: 14px; }

/* ---- App shell ---- */
.top {
  display: flex; align-items: center; gap: 16px; padding: 14px 24px;
  background: var(--raised); border-bottom: 1px solid var(--line);
}
.top .title { font-weight: 500; font-size: 17px; border-left: 1px solid var(--line); padding-left: 16px; }
.top .spacer { flex: 1; }
.top .who { color: var(--muted); font-size: 14px; }

main { max-width: 1080px; margin: 0 auto; padding: 28px 24px 80px; display: flex; flex-direction: column; gap: 22px; }

.drop {
  background: var(--pink); border: 2px dashed rgba(45, 44, 42, .28); border-radius: var(--r);
  padding: 44px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: border-color .15s, background .15s, transform .15s;
}
.drop h2 { font-size: 24px; }
.drop .lede { color: var(--ink); opacity: .75; }
.drop .note { color: var(--ink); opacity: .6; }
/* While dragging files over the page: switch to lime as a clear "let go now" signal */
.drop.over, body.dragging .drop { border-color: var(--ink); background: var(--lime); transform: scale(1.01); }

.queue { display: flex; flex-direction: column; gap: 8px; }
.qitem {
  background: var(--raised); border-radius: var(--r-sm); padding: 10px 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center;
}
.qitem .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qitem .meta { color: var(--muted); font-size: 13px; }
.bar { grid-column: 1 / -1; height: 4px; background: var(--hover); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--violet); transition: width .2s; }
.qitem.done { background: var(--lime); }
.qitem.done .bar { background: rgba(45, 44, 42, .12); }
.qitem.done .bar > i { background: var(--ink); }
.qitem.done .meta { color: var(--ink); }
.qitem.failed .meta { color: var(--red); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.toolbar input[type=search] { max-width: 340px; }

/* ---- File list ---- */
.list {
  background: var(--raised); border-radius: var(--r); overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto auto; column-gap: 20px;
}
.row {
  grid-column: 1 / -1; display: grid; grid-template-columns: subgrid;
  align-items: center; padding: 12px 16px; border-top: 1px solid var(--line);
}
.empty { grid-column: 1 / -1; }
.row:first-child { border-top: 0; }
.row.head { color: var(--muted); font-size: 13px; padding-top: 10px; padding-bottom: 10px; }
.row:not(.head):hover { background: var(--surface); }
.row.fresh, .row.fresh:hover { background: color-mix(in srgb, var(--lime) 60%, var(--raised)); }
.row.fresh:hover { background: var(--lime); }
.c-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--ink); letter-spacing: .02em;
}
.avatar.pink { background: var(--pink); }
.avatar.lime { background: var(--lime); }
.avatar.violet { background: var(--violet); color: #fff; }
.fname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw {
  font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; color: var(--ink);
  background: var(--violet-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.c-exp { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.exp { font-size: 13px; background: var(--hover); border-radius: 999px; padding: 3px 10px; }
.exp.soon { background: var(--pink); font-weight: 500; }

/* ---- Team dialog ---- */
dialog.panel {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  border: 0; border-radius: var(--r); padding: 24px 26px 28px; background: var(--raised); color: var(--ink);
  box-shadow: var(--shadow);
}
dialog.panel::backdrop { background: rgba(45, 44, 42, .45); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { font-size: 22px; }
dialog.panel h3 { font-size: 13px; font-weight: 500; color: var(--muted); margin: 24px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.invite-form { display: flex; gap: 10px; align-items: flex-end; background: var(--pink); border-radius: var(--r-sm); padding: 14px; }
.invite-form .f { flex: 1; color: var(--ink); }
.invite-done {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--lime); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 10px; font-size: 14px;
}
dialog.panel .error { margin-top: 10px; }
.mlist { display: flex; flex-direction: column; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mrow:first-child { border-top: 0; }
.mmain { flex: 1; min-width: 0; }
.mmain .fname { display: flex; align-items: center; gap: 8px; }
.badge { font-size: 11px; font-weight: 500; background: var(--violet-soft); border-radius: 999px; padding: 1px 8px; }
.avatar.pending { background: var(--hover); color: var(--muted); }
.mrow .avatar { width: 32px; height: 32px; font-size: 12px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--btn); color: var(--btn-ink); padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow); z-index: 10;
}

@media (max-width: 820px) {
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .top .who { display: none; }
  main { padding: 20px 16px 60px; }
  .list { display: block; }
  .row.head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .row > .c-size, .row > .c-who { display: none; }
  .row > .c-pw { grid-column: 1; grid-row: 2; }
  .row > .c-exp { grid-column: 1; grid-row: 3; }
  .row > .actions { grid-column: 2; grid-row: 1 / span 3; flex-direction: column; align-items: stretch; }
  .invite-form { flex-direction: column; align-items: stretch; }
  .toolbar input[type=search] { max-width: none; }
}

/* ---- Public download page ---- */
.dl-card { gap: 18px; }
.dl-file { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--surface); border-radius: var(--r-sm); }
.dl-icon {
  width: 42px; height: 50px; flex: none; border-radius: 6px; background: var(--accent);
  color: var(--btn-ink); display: grid; place-items: center; font-weight: 600; font-size: 11px; letter-spacing: .02em;
}
.dl-name { font-weight: 500; word-break: break-word; }
.dl-foot { color: var(--muted); font-size: 13px; }
