:root {
  --bg: #0f1513;
  --panel: #161e1b;
  --panel-2: #1d2622;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f3f1ea;
  --muted: #a9b0ab;
  --faint: #6f7873;
  --accent: #ff5a26;
  --accent-2: #ff8a5c;
  --accent-bg: rgba(255, 90, 38, 0.14);
  --green: #9cc8a6;
  --red: #f87171;
  --radius: 10px;
  --mono: var(--brand-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.5 var(--brand-sans, ui-sans-serif, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}
.dots {
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel-2); color: var(--text);
  font-weight: 500; font-size: 13px; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: #22222d; border-color: rgba(255,255,255,.2); }
.btn.primary { background: var(--accent); border-color: transparent; color: #0f1513; font-weight: 700; }
.btn.primary:hover { background: #7c4dee; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }
.btn.danger { color: var(--red); background: transparent; }
.btn.danger:hover { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.3); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn svg { width: 15px; height: 15px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  height: 56px; padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 12, 17, 0.85);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; }
.spacer { flex: 1; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 12.5px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(62,207,142,.15); }

/* ---------- page ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 36px 24px 80px; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.head h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.count { color: var(--faint); font-size: 13px; }
.search {
  height: 34px; width: 240px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; font-size: 13px; outline: none;
}
.search:focus { border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  overflow: hidden; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--line-2); }
.card.flash { border-color: var(--accent); }
.thumb {
  position: relative; height: 160px; overflow: hidden; cursor: pointer;
  background: #0f0f15; border-bottom: 1px solid var(--line);
}
.thumb iframe {
  position: absolute; top: 0; left: 0; width: 400%; height: 400%;
  transform: scale(.25); transform-origin: 0 0; border: 0;
  pointer-events: none; background: #fff;
}
.thumb .none { display: grid; place-items: center; height: 100%; color: var(--faint); font-size: 12.5px; }
.card-body { cursor: pointer; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.card-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meta .sep { color: var(--faint); }
.card-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.card-actions .btn { flex: 1; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--accent-bg); color: var(--accent-2);
}
.pill.green { background: rgba(62,207,142,.12); color: var(--green); }
.tag {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
.badge { position: absolute; top: 10px; right: 10px; z-index: 2; }

/* ---------- empty state ---------- */
.empty {
  border: 1px dashed var(--line-2); border-radius: 14px;
  padding: 56px 24px; text-align: center;
}
.empty h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.01em; }
.empty p { margin: 0 auto 22px; color: var(--muted); max-width: 420px; }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px);
}
.overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 460px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  animation: rise .16s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; padding: 18px 20px 0; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.modal-body { padding: 12px 20px 20px; }
.modal-body p { color: var(--muted); margin: 0 0 16px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; padding: 4px; }
.x:hover { color: var(--text); }

.field { display: flex; gap: 8px; }
.field input, .code {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #0f0f15;
  color: var(--text); font-family: var(--mono); font-size: 12.5px; outline: none;
}
.code { display: block; height: auto; padding: 12px; white-space: pre-wrap; word-break: break-all; line-height: 1.6; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; text-align: left; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; counter-increment: s; }
.steps li::before {
  content: counter(s); display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.steps b { display: block; font-weight: 600; margin-bottom: 6px; }
.steps .sub { color: var(--muted); font-size: 13px; }
.os { display: flex; gap: 4px; margin-bottom: 8px; }

/* ---------- viewer (owner preview + public share page) ---------- */
.viewer { position: fixed; inset: 0; z-index: 40; display: none; flex-direction: column; background: var(--bg); }
.viewer.open { display: flex; }
.vbar {
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.vtitle { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #0f0f15; }
.seg button {
  height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--muted); font-size: 12.5px; cursor: pointer;
}
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.stage-area { flex: 1; display: flex; justify-content: center; align-items: stretch; overflow: auto; padding: 0; }
.stage-area.framed { padding: 24px; }
.stage-area iframe {
  width: 100%; height: 100%; border: 0; background: #fff;
  transition: width .2s ease, max-width .2s ease;
}
.stage-area.framed iframe { border-radius: 12px; box-shadow: 0 0 0 1px var(--line-2), 0 20px 60px rgba(0,0,0,.45); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 9px 14px; border-radius: 8px; max-width: min(520px, calc(100vw - 32px)); text-align: center; line-height: 1.4;
  background: #24242f; border: 1px solid var(--line-2); font-size: 13px;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- sign in ---------- */
.center { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.signin { width: 100%; max-width: 380px; text-align: center; }
.signin img { width: 40px; height: 40px; margin-bottom: 18px; }
.signin h1 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 6px; }
.signin p { color: var(--muted); margin: 0 0 24px; }
.signin form { display: grid; gap: 10px; }
.signin .btn { justify-content: center; height: 38px; }
.hide-sm { }
@media (max-width: 640px) {
  .top { padding: 0 14px; }
  .search { width: 100%; }
  .head { flex-wrap: wrap; }
  .hide-sm { display: none; }
  main { padding: 24px 14px 60px; }
}

/* ---------- forms + auth ---------- */
.input {
  width: 100%; height: 38px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--text); font: inherit; font-size: 14px; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 4px; }
.sent h2 { font-size: 18px; margin: 0 0 6px; }
.sent-icon {
  width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px;
  background: var(--accent-bg); color: var(--accent-2);
}
.sent b { color: var(--text); font-weight: 600; }
.dev-link { display: block; margin-top: 18px; font-size: 12.5px; color: var(--accent-2); font-family: var(--mono); }
.row { display: flex; gap: 8px; justify-content: center; }
.pair { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.pair img { width: 40px; height: 40px; margin: 0; }
.pair-line { width: 36px; border-top: 2px dashed var(--line-2); }
.pair-mac {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line-2); font-size: 18px; color: var(--muted);
}
[hidden] { display: none !important; }

/* ---------- account menu ---------- */
.menu { position: relative; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--kiln, #ff5a26); color: #0f1513; font-weight: 700;
  font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.dropdown {
  position: absolute; right: 0; top: 40px; min-width: 220px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45); display: none;
}
.menu.open .dropdown { display: block; }
.dropdown .who { padding: 8px 10px 10px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; background: none; border: 0; font-size: 13px; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: rgba(255,255,255,.05); }

/* ---------- share modal ---------- */
.label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 8px; }
.label:first-child { margin-top: 4px; }
.people { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; max-height: 200px; overflow: auto; }
.people li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; }
.people .av {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--panel-2); border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 600; color: var(--muted);
}
.people .em { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.people .role { color: var(--faint); font-size: 12px; }
.choice { display: grid; gap: 6px; }
.choice label {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
}
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.choice input { accent-color: var(--accent); margin-top: 3px; }
.choice b { display: block; font-weight: 600; font-size: 13.5px; }
.choice span { color: var(--muted); font-size: 12.5px; }

/* ---------- sections ---------- */
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 40px 0 12px; }
.shared-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.shared-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}
.shared-row:hover { border-color: var(--line-2); }
.shared-row .t { flex: 1; min-width: 0; }
.shared-row .t div { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-row .t span { color: var(--muted); font-size: 12.5px; }
.devices { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.devices li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.devices .n { flex: 1; }
.devices .n span { display: block; color: var(--muted); font-size: 12.5px; }
.download { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #0f0f15; }
.download .n { flex: 1; }
.download .n b { display: block; }
.download .n span { color: var(--muted); font-size: 12.5px; }
.muted-link { color: var(--muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: 0; padding: 0; }
.field input.input { font-family: inherit; font-size: 13.5px; height: 36px; }
.perms { list-style: none; padding: 0; margin: 0 auto 24px; max-width: 300px; text-align: left; display: grid; gap: 8px; }
.perms li { display: flex; gap: 10px; color: var(--muted); font-size: 13.5px; }
.perms li::before { content: '✓'; color: var(--green); font-weight: 700; }
.fine { font-size: 12px; color: var(--faint); margin-top: 16px !important; }

/* ---------- connections ---------- */
.modal.wide { max-width: 560px; }
.seg.tabs { display: flex; width: 100%; margin-bottom: 18px; }
.seg.tabs button { flex: 1; }
.seg.tabs.sm { margin: 16px 0 12px; }
.modal-body p b { color: var(--text); font-weight: 600; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); font-size: 13.5px; }
.howto b { color: var(--text); font-weight: 600; }
div.howto { padding: 0; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 10px !important; }
.sub.warn { color: #f5b14c; margin-top: 8px !important; }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.btn.block { display: flex; width: 100%; justify-content: center; height: 40px; margin-top: 12px; }
.pair-mac.sm { width: 32px; height: 32px; font-size: 14px; flex: none; }
.download { margin-bottom: 0; }
.devices .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.empty .row { flex-wrap: wrap; }

/* ---------- touch screens ---------- */
@media (hover: none) {
  .btn { min-height: 40px; }
  .btn.sm { min-height: 36px; }
  .seg button { min-height: 32px; }
  .card:hover { border-color: var(--line); }
}

/* ---------- iPad / small laptops ---------- */
@media (max-width: 1024px) {
  main { padding: 28px 20px 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .top {
    height: calc(56px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
    padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); gap: 10px;
  }
  .status { padding: 0 9px; }
  #connectBtn { width: 38px; padding: 0; justify-content: center; }
  main { padding: 20px max(14px, env(safe-area-inset-left)) calc(40px + env(safe-area-inset-bottom)); }
  .head h1 { font-size: 18px; }
  .search { order: 5; flex-basis: 100%; }
  .grid { grid-template-columns: 1fr; }
  .thumb { height: 190px; }
  .shared-list { grid-template-columns: 1fr; }
  .empty { padding: 40px 18px; }

  /* Modals become bottom sheets. */
  .overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.wide {
    max-width: none; border-radius: 16px 16px 0 0; border-bottom: 0;
    max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet .22s cubic-bezier(.2, .8, .2, 1);
  }
  .modal-head { padding-top: 22px; position: relative; }
  .modal-head::before {
    content: ''; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
    border-radius: 2px; background: var(--line-2);
  }
  .seg.tabs.sm { overflow-x: auto; }
  .seg.tabs.sm button { flex: none; padding: 0 12px; }

  /* No zoom-on-focus in iOS Safari. */
  .input, .search, .field input, .field input.input { font-size: 16px; }

  .vbar {
    height: calc(52px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
    padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); gap: 8px;
  }
  .vtitle { flex: 1; min-width: 0; }
  .vbar .spacer { display: none; }
  .stage-area iframe { height: 100%; }
  .signin { padding-bottom: env(safe-area-inset-bottom); }
  .toast { top: calc(12px + env(safe-area-inset-top)); bottom: auto; transform: translate(-50%, -20px); }
  .toast.show { transform: translate(-50%, 0); }
}
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }

.pill.off { background: rgba(255,255,255,.08); color: var(--muted); }
#expiry button { white-space: nowrap; }
#expiryNote { margin: 10px 0 0 !important; }
#expiryNote.warn { color: #f5b14c; }
#customDays { margin-top: 10px; }
@media (max-width: 640px) { #expiry { overflow-x: auto; } #expiry button { flex: none; padding: 0 12px; } }
.pill.badge { background: rgba(15, 21, 19, .9); color: var(--accent-2); border: 1px solid rgba(255,138,92,.35); backdrop-filter: blur(6px); }
.pill.badge.off { color: var(--muted); border-color: var(--line-2); }
.perms.ask li::before { content: '→'; color: var(--accent-2); }
.dest { color: var(--accent-2) !important; }

.views li { padding: 4px; }
.views .av { width: 22px; height: 22px; font-size: 10.5px; }
.danger-zone {
  display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 14px;
  border: 1px solid rgba(248,113,113,.25); border-radius: 12px; background: rgba(248,113,113,.04);
}
.danger-zone div { flex: 1; }
.danger-zone b { display: block; }
.danger-zone span { color: var(--muted); font-size: 12.5px; }
#deleteForm { margin-top: 12px; }
.devices .pill { margin-left: 6px; vertical-align: 1px; }

/* Connect a computer */
.code-input { width: 100%; text-align: center; font-family: var(--mono, ui-monospace, monospace); font-size: 22px; letter-spacing: .12em; padding: 12px; margin: 6px 0 10px; }
.signin .btn.wide { width: 100%; justify-content: center; }
.signin p.warn { color: #f5b14c; font-size: 13px; line-height: 1.5; margin-top: 18px; }

/* Security panel */
#sessions .n .pill { display: inline-block; width: auto; margin: 0 0 0 8px; vertical-align: 1px; }
#sessions .pair-mac.sm { display: grid; place-items: center; color: var(--muted); }
#securityModal .perms { margin: 0 0 24px; max-width: none; }

/* Upload: drop zone + progress */
.drop-zone { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: rgba(12, 12, 17, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.drop-zone[hidden] { display: none; }
.drop-card { pointer-events: none; display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 420px; width: 100%;
  padding: 44px 28px; border: 2px dashed var(--accent, #ff5a26); border-radius: 18px; background: rgba(255, 90, 38, .08); }
.drop-card svg { width: 34px; height: 34px; color: var(--accent, #ff5a26); }
.drop-card b { font-size: 18px; }
.drop-card span { color: var(--muted); font-size: 14px; }
.up-progress { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; width: min(360px, calc(100% - 32px));
  padding: 12px 14px; border-radius: 12px; background: var(--panel, #16161d); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 13.5px; }
.up-progress[hidden] { display: none; }
.up-progress .bar { height: 4px; margin-top: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.up-progress .bar i { display: block; height: 100%; width: 0; background: var(--accent, #ff5a26); transition: width .2s; }

/* Delete */
.card-actions .btn.icon { flex: 0 0 auto; width: 32px; padding: 0; justify-content: center; color: var(--muted); }
.card-actions .btn.icon:hover { color: var(--red); border-color: rgba(248,113,113,.35); }
@media (max-width: 640px) { .card-actions .btn.icon { width: 40px; } }
.btn.danger.solid { background: var(--red); color: #1a0b0b; border-color: transparent; }
.btn.danger.solid:hover { background: #fb8a8a; }

/* ---------- projects ---------- */
.head { margin-bottom: 14px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 30px; }
.projects { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.chip svg { width: 14px; height: 14px; flex: none; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { color: var(--text); background: var(--panel-2); border-color: var(--line-2); box-shadow: 0 0 0 1px var(--line-2); }
.chip .n { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip.add { border-style: dashed; background: transparent; }
.chip.drop { border-color: var(--accent); background: var(--accent-bg); color: var(--text); }
.chip-new { display: inline-flex; gap: 6px; }
.chip-new input { height: 32px; width: 170px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; outline: none; }
.card[draggable="true"] .thumb { cursor: grab; }
.card.dragging { opacity: .45; }
.ptag { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptag svg { width: 12px; height: 12px; flex: none; }
.move-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.move-list button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--text); font-size: 14px; text-align: left; cursor: pointer;
}
.move-list button:hover { background: rgba(255,255,255,.04); border-color: var(--line); }
.move-list button.on { border-color: var(--line-2); background: var(--panel-2); }
.move-list button svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.move-list button .chk { margin-left: auto; color: var(--accent-2); font-size: 13px; }
.move-new, .row-input { display: flex; gap: 8px; }
.move-new .input, .row-input .input { flex: 1; min-width: 0; font-family: inherit; }
@media (max-width: 640px) {
  .projects { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 18px; padding: 0 14px 4px; scrollbar-width: none; }
  .projects::-webkit-scrollbar { display: none; }
  .brand img { width: 30px; height: 30px; }
  .move-new { flex-direction: column; }
}

/* ---------- Google sign-in ---------- */
.signin .btn.google { background: #fff; color: #1f1f1f; border-color: #fff; gap: 10px; font-weight: 600; }
.signin .btn.google:hover { background: #ececf1; }
.signin .or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 6px 0 2px; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- touch: every control at least 40px tall ---------- */
@media (hover: none), (max-width: 640px) {
  .btn, .btn.sm { min-height: 40px; }
  .card-actions .btn.icon { width: 44px; }
  .chip { min-height: 40px; }
  .x { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; margin: -8px -10px -8px 0; }
  #expiry { flex-wrap: wrap; overflow: visible; gap: 2px; }
  #expiry button { flex: 1 1 auto; min-height: 40px; padding: 0 10px; }
  .vbar .btn { min-height: 38px; }
  .card-title a { display: inline-block; padding: 8px 0; margin: -8px 0; }
  .top .avatar { width: 38px; height: 38px; }
  .vbar .brand { padding: 9px; margin: -9px -4px -9px -9px; }
}
/* Very narrow phones (320–380px): drop the wordmark so the header buttons keep their size. */
@media (max-width: 380px) {
  .top .brand { font-size: 0; gap: 0; }
  .top { gap: 8px; }
}

/* ---------- brand: wordmark, sign-in ---------- */
.wm { font-size: 17px; }
.signin img { width: 48px; height: 48px; border-radius: 11px; }
.signin h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.signin .btn { border-radius: 999px; height: 44px; font-size: 14px; }
.signin .input { height: 44px; border-radius: 12px; }

/* =========================================================
   Phase 3: the app in the littlerender system.
   Fewer boxes, text tabs, the Frame on hover, pill buttons.
   ========================================================= */
body.app { background: var(--bg); }
.btn { border-radius: 999px; font-weight: 600; }
.btn.primary { box-shadow: none; }
.btn.primary:hover { background: var(--kiln-2, #ff7a4d); }
.top { height: 64px; border-bottom: 0; background: rgba(15, 21, 19, 0.86); gap: 12px; }
.top .brand img { width: 30px; height: 30px; border-radius: 8px; }
.status { border: 0; background: var(--panel); font-family: var(--mono); font-size: 11.5px; }

main { padding-top: 44px; }
.head { align-items: flex-end; margin-bottom: 18px; }
.head h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
.count { font: 500 13px var(--mono); color: var(--faint); align-self: flex-start; margin-top: 4px; }
.search { height: 40px; width: 260px; border-radius: 999px; border: 0; background: var(--panel); padding: 0 16px; }
.search:focus { box-shadow: 0 0 0 2px var(--accent); }
.search::-webkit-search-cancel-button { filter: invert(.6); }

/* Projects as text tabs, not boxes */
.projects { gap: 4px 22px; margin-bottom: 30px; border-bottom: 1px solid var(--line); padding-bottom: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.projects::-webkit-scrollbar { display: none; }
.chip { border: 0; background: transparent; border-radius: 0; padding: 0 0 12px; height: auto; min-height: 0; font-size: 15px; font-weight: 600; color: var(--muted); position: relative; white-space: nowrap; flex: none; }
.chip:hover { color: var(--text); }
.chip.on { background: transparent; box-shadow: none; color: var(--text); }
.chip.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.chip .n { font-family: var(--mono); font-size: 11.5px; }
.chip.add { border: 0; color: var(--faint); }
.chip.add:hover { color: var(--accent); }
.chip.drop { background: var(--accent-bg); color: var(--text); border-radius: 8px 8px 0 0; }
.chip-new { padding-bottom: 8px; flex: none; }

/* Cards: the work is the hero, no box around it */
.grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 40px 28px; }
.card { border: 0; background: transparent; border-radius: 0; overflow: visible; }
.card:hover { border: 0; }
.thumb { height: auto; aspect-ratio: 16 / 10; border: 0; border-radius: 8px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); transition: transform .2s ease, box-shadow .2s ease; }
.card::before, .card::after { content: ""; position: absolute; width: 22px; height: 22px; border: 0 solid var(--accent); opacity: 0; transition: opacity .15s ease, transform .2s cubic-bezier(.2,.8,.2,1); pointer-events: none; z-index: 3; }
.card::before { top: -8px; left: -8px; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 5px; transform: translate(-6px, -6px); }
.card { container-type: inline-size; }
.card::after { top: calc(100cqw * 0.625 - 14px); right: -8px; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 5px; transform: translate(6px, 6px); }
.card.flash .thumb { box-shadow: 0 0 0 2px var(--accent); }
.card-body { padding: 14px 2px 4px; }
.card-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.015em; }
.meta { font-size: 12px; font-family: var(--mono); color: var(--faint); }
.meta .tag { border: 0; padding: 0; color: var(--accent-2); text-transform: lowercase; }
.card-actions { padding: 8px 0 0; }
.card-actions .btn { flex: 0 0 auto; }
.card-actions .btn.primary { padding: 0 18px; }
.card-actions .btn.icon { background: transparent; border-color: transparent; }
.card-actions .btn.icon:hover { background: var(--panel); }
.pill.badge { top: 10px; left: 10px; right: auto; font-family: var(--mono); font-size: 11px; background: rgba(15,21,19,.88); color: var(--on-dark, #f3f1ea); border: 0; }
.pill.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.pill.badge.public::before { background: var(--accent); }
.pill.badge.off::before { background: var(--faint); }
@media (hover: hover) {
  .card:hover::before, .card:hover::after, .card:focus-within::before, .card:focus-within::after { opacity: 1; transform: none; }
  .card:hover .thumb { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2), 0 24px 40px -24px rgba(0,0,0,.8); }
}

/* Empty states: words, not a dashed box */
.empty { border: 0; padding: 72px 0; text-align: left; }
.empty h2 { font-size: clamp(32px, 5vw, 56px); font-weight: 800; letter-spacing: -0.045em; line-height: 1; margin-bottom: 14px; }
.empty h2 .it { color: var(--accent); }
.empty p { margin: 0 0 28px; font-size: 17px; max-width: 34ch; }
.empty .row { justify-content: flex-start; }

/* Modals and sheets */
.modal { background: var(--darkroom-2, #18201d); border: 0; border-radius: 20px; box-shadow: 0 40px 100px -20px rgba(0,0,0,.7), 0 0 0 1px var(--line); }
.modal-head { padding: 22px 24px 0; }
.modal-head h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.035em; }
.modal-body { padding: 14px 24px 24px; }
.modal-foot { border-top: 0; padding: 0 24px 22px; }
.modal .label { font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.input, .field input { border-radius: 12px; background: var(--bg); border-color: var(--line); }
.choice label { border-radius: 12px; }
.seg { border-radius: 999px; background: var(--bg); padding: 3px; }
.seg button { border-radius: 999px; }
.seg button.on { background: var(--panel-2); }
.dropdown { border-radius: 14px; background: var(--darkroom-2, #18201d); }

/* Viewer bar */
.vbar { background: var(--bg); border-bottom: 1px solid var(--line); }
.vtitle { font-weight: 700; letter-spacing: -0.015em; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  main { padding: 26px 16px 90px; }
  .top { height: calc(58px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .status { padding: 0 8px; }
  .head { flex-wrap: wrap; row-gap: 14px; }
  .head .spacer { display: none; }
  .search { order: 5; width: 100%; height: 44px; }
  .projects { margin: 0 -16px 24px; padding: 0 16px; gap: 4px 20px; }
  .chip { min-height: 40px; padding-bottom: 10px; display: inline-flex; align-items: flex-end; }
  .grid { grid-template-columns: 1fr; gap: 34px; }
  .card-actions .btn.primary { flex: 1; }
  .empty { padding: 40px 0; }
  .empty .row { flex-direction: column; align-items: stretch; }
  .empty .row .btn { justify-content: center; }
  .modal { border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px rgba(0,0,0,.6); }
  .modal-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
@media (min-width: 641px) and (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .top .brand .wm { display: none; } }
@media (hover: none), (max-width: 640px) { .top .brand { min-height: 40px; } }

/* =========================================================
   Phase 4: what guests see. The work fills the screen;
   one quiet bar says who shared it and that it's live.
   ========================================================= */
.share .vbar { height: 60px; gap: 14px; padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.share .vbar .brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.vhead { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.vhead .vtitle { font-size: 15px; }
.vby { font: 11.5px var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share .stage-area.framed { padding: 28px; background: radial-gradient(80% 60% at 50% 0%, rgba(255,90,38,.06), transparent 70%); }
.share .stage-area.framed iframe { border-radius: 14px; }
@media (max-width: 640px) {
  .share .vbar { height: calc(56px + env(safe-area-inset-top)); gap: 10px; }
  .share .vhead { flex: 1; }
  .share .vbar .spacer { display: none; }
  .share #copy { padding: 0 14px; }
}

/* Sign-in, gate and connect pages: no dot grid, just the dark stage. */
.dots { background-image: none; }
.signin h1 { text-wrap: balance; }
.signin .only-switch .btn, .signin .only-none .btn { border-radius: 999px; }

/* Duplicate upload: replace, rename or skip */
#dupModal .modal-body p { margin-bottom: 18px; }
.btn.wide { width: 100%; justify-content: center; }
.dup-rename { margin: 22px 0 14px; }
.dup-rename .label { margin-bottom: 8px; }
.dup-rename .field input { font-family: inherit; font-size: 14px; }
#dupSkip { color: var(--muted); background: transparent; border-color: transparent; }
@media (max-width: 640px) { .dup-rename .field { flex-direction: column; } .dup-rename .field .btn { justify-content: center; } }
.toast { background: var(--light, #fff); color: var(--darkroom, #0f1513); border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 600; font-size: 13.5px; box-shadow: 0 20px 40px -16px rgba(0,0,0,.7); }
@media (max-width: 640px) { .dup-rename .field input { flex: none; height: 46px; } }

/* ---------- a shared project, as guests see it ---------- */
.sp-head { margin: 8px 0 34px; }
.sp-head .label { font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.sp-head h1 { margin: 12px 0 0; font-size: clamp(36px, 6vw, 64px); font-weight: 800; letter-spacing: -0.045em; line-height: .98; overflow-wrap: anywhere; }
.sp-by { margin: 14px 0 0; font: 13px var(--mono); color: var(--faint); overflow-wrap: anywhere; }
.sp-card { color: inherit; text-decoration: none; }
.sp-card[aria-disabled="true"] { pointer-events: none; opacity: .6; }
.sp-card:focus-visible .thumb { box-shadow: 0 0 0 2px var(--accent); }
.shared-project .grid .empty { grid-column: 1 / -1; }
.vbar .back { flex: none; }

/* Project sharing */
#projShareBtn { margin-left: 4px; }
.chip.shared > span:first-of-type::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--green); vertical-align: middle; }
.proj-note { margin: 4px 0 18px !important; padding: 12px 14px; border-radius: 12px; background: var(--accent-bg); color: var(--text) !important; font-size: 13.5px; line-height: 1.5; }
@media (max-width: 640px) { #projShareBtn { order: 4; } }

/* Phones: the viewer never pans sideways around the page; the page scrolls inside its frame. */
@media (max-width: 640px), (pointer: coarse) {
  .viewer .stage-area:not(.framed) { overflow: hidden; }
  .viewer .stage-area:not(.framed) iframe { width: 1px; min-width: 100%; }
  body.share { overflow: hidden; overscroll-behavior: none; position: fixed; inset: 0; }
  .viewer { overscroll-behavior: none; touch-action: pan-y pinch-zoom; }
}

/* Invite note */
.invite-note { display: block; width: 100%; margin-top: 8px; padding: 10px 12px; min-height: 64px; resize: vertical; font: inherit; font-size: 13.5px; line-height: 1.5; color: var(--text); border: 1px solid var(--line); }
.invite-note:focus { outline: none; border-color: var(--kiln, #ff5a26); }
@media (max-width: 640px), (pointer: coarse) { .invite-note { font-size: 16px; } }

/* Projects on phones: one button and a list, instead of a long row of tabs to swipe */
.proj-switch { display: none; }
@media (max-width: 640px) {
  .projects { display: none; }
  .proj-switch {
    display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 24px; padding: 0 14px 0 16px; height: 50px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text);
    font: 600 15px/1 inherit; font-family: inherit; text-align: left; cursor: pointer;
  }
  .proj-switch .ps-ico:empty { display: none; }
  .proj-switch .ps-ico svg { width: 18px; height: 18px; display: block; color: var(--accent); }
  .proj-switch .ps-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .proj-switch .ps-n { font: 500 12.5px var(--mono); color: var(--faint); }
  .proj-switch .ps-chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
}
#projSheet .modal-body { display: flex; flex-direction: column; gap: 12px; }
#projSheet .ps-list { max-height: min(56vh, 520px); overflow-y: auto; overscroll-behavior: contain; margin: 0; }
#projSheet .ps-search { height: 44px; font-size: 16px; }
.ps-shared { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; margin-left: -2px; }
.ps-empty { padding: 14px 4px; color: var(--muted); list-style: none; }
#psList .chk { color: var(--faint); font: 500 12px var(--mono); margin-left: auto; }
#psList button.on .chk { color: var(--muted); }
#psNew { display: flex; flex-direction: row; gap: 8px; margin: 0; }
#psNew input { flex: 1; min-width: 0; height: 46px; font-size: 16px; }
#psNew .btn { flex: none; height: 46px; padding: 0 18px; }

/* Passkey sign-in, under the email form. */
.signin .btn.passkey { width: 100%; gap: 9px; margin-top: 4px; }

/* Security: two short lists, small text actions. */
.sec { padding-top: 4px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 6px; }
.sec-h:first-child { margin-top: 2px; }
.sec-h h4 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.text-btn { appearance: none; background: none; border: 0; padding: 6px 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent-2, #ff8a5c); cursor: pointer; white-space: nowrap; }
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-btn:disabled { opacity: .5; cursor: default; }
.text-btn.danger { color: var(--red); }
.sec-list { list-style: none; margin: 0; padding: 0; }
.sec-list li { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.sec-list li:last-child { border-bottom: 1px solid var(--line); }
.sec-list .ic { flex: none; color: var(--muted); }
.sec-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-list .meta { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.sec-list .meta.here { color: var(--green); }
.sec-list .text-btn { color: var(--muted); font-weight: 500; font-size: 13.5px; margin-left: 4px; }
.sec-list .text-btn:hover { color: var(--red); text-decoration: none; }
.sec-list li.empty { color: var(--muted); font-size: 14px; }
.sec .form-error:empty { min-height: 0; margin: 0; }
.sec-delete { display: block; margin: 26px 0 2px; font-size: 13.5px; font-weight: 500; }
.sec-list .meta { font-family: var(--brand-sans); letter-spacing: 0; }
.sec-list li.empty { border-radius: 0; border-left: 0; border-right: 0; background: none; padding: 6px 0; text-align: left; justify-content: flex-start; }

/* Profile photo */
.avatar { display: grid; place-items: center; padding: 0; overflow: hidden; }
.avatar.has-photo { background: var(--panel-2); }
.avatar .face { width: 100%; height: 100%; display: grid; place-items: center; object-fit: cover; }
.dropdown .who { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.who-photo { flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; cursor: pointer; background: var(--kiln, #ff5a26); color: #0f1513; font-weight: 700; font-size: 17px; }
.who-photo .face { width: 100%; height: 100%; display: grid; place-items: center; object-fit: cover; }
.who-photo:hover { filter: brightness(1.08); }
.who-text { min-width: 0; }
.who-text b { display: block; color: var(--text); font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text span { font-size: 12.5px; color: var(--faint); }
.dropdown .who .link { display: inline; width: auto; padding: 0; background: none; border: 0; color: var(--accent-2); font: inherit; cursor: pointer; }
.dropdown .who .link:hover { background: none; text-decoration: underline; }
.dropdown .who .link[data-photo="remove"] { color: var(--muted); }

/* ---------- Top bar: logo and avatar. Upload lives in the grid, the rest in the avatar menu. ---------- */
.top .avatar { width: 38px; height: 38px; font-size: 15px; }
.sync-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); border: 2.5px solid var(--bg); pointer-events: none; }
.sync-dot.on { background: var(--green); }
.dropdown { min-width: 290px; top: 48px; }
.dropdown > button, .dropdown > a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; font-size: 14px; border-radius: 9px; }
.dropdown > button svg, .dropdown > a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.dropdown > a.out { color: var(--muted); }
.who-text .sync { display: block; color: var(--muted); }
.who-text .sync.on { color: var(--green); }
.who-text .sync.on::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; }

/* ---------- Upload tile: the first thing in the grid ---------- */
.show-sm { display: none; }
.upload-tile {
  appearance: none; font: inherit; color: var(--muted); cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 220px; padding: 18px; border-radius: 12px; background: transparent;
  border: 1.5px dashed var(--line-2); transition: border-color .15s, background .15s, box-shadow .15s;
}
.upload-tile:hover { border-color: rgba(255,138,92,.6); background: rgba(255,90,38,.04); }
.upload-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-tile .up-ic { width: 42px; height: 42px; border-radius: 999px; background: var(--accent); color: #0f1513; display: grid; place-items: center; flex: none; }
.upload-tile .up-text { display: grid; gap: 3px; }
.upload-tile b { color: var(--text); font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.upload-tile .up-sub { font-size: 12.5px; line-height: 1.4; }
.upload-tile.hot { border-style: solid; border-color: var(--accent); background: rgba(255,90,38,.09); box-shadow: 0 0 0 6px rgba(255,90,38,.08); }
.upload-tile.hot b { color: var(--accent-2); }
.upload-tile.hot .up-sub > span { display: none; }
.upload-tile.hot .up-sub::after { content: "Release anywhere"; }
@media (max-width: 640px) {
  .show-sm { display: inline; }
  .upload-tile { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 72px; padding: 12px 16px; border-radius: 14px; gap: 14px; }
  .upload-tile b { font-size: 16px; }
  .upload-tile .up-sub { font-size: 13px; }
  .top .avatar { width: 44px; height: 44px; font-size: 17px; }
  .dropdown { position: fixed; left: 10px; right: 10px; top: auto; bottom: 10px; min-width: 0; border-radius: 22px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .dropdown > button, .dropdown > a { min-height: 54px; font-size: 16px; }
}
@media (max-width: 640px) {
  /* A blurred header would trap the fixed menu inside it; use a solid one on phones. */
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .menu.open::before { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 0; }
  .dropdown { z-index: 1; }
  .dropdown::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 2px auto 8px; }
}

/* =========================================================
   The app in the V3 type: Archivo throughout. Headlines condensed,
   labels in plain sentence case, monospace only for real code.
   ========================================================= */
button, input, select, textarea { font-family: inherit; }
h1, h2, .head h1, .signin h1, .empty h2, .sp-head h1, .sp-head h2 { font-family: var(--brand-sans); font-stretch: 74%; font-weight: 800; letter-spacing: -0.01em; }
.head h1 { font-size: clamp(42px, 6vw, 64px); line-height: .92; }
.signin h1 { font-size: 36px; line-height: 1; }
.empty h2 { line-height: .95; }
.modal-head h3 { font-weight: 750; letter-spacing: -0.015em; }
.it { color: var(--accent); }

/* Labels: sentence case, no code font. */
.label, .modal .label, .sp-head .label { font: 650 13px var(--brand-sans); letter-spacing: 0; text-transform: none; color: var(--text); }
.sp-head .label { color: var(--accent); }

/* Numbers, dates and small details: the same face, quieter. */
.count, .chip .n, .meta, .pill.badge, .vby, .sp-by, .proj-switch .ps-n, #psList .chk, .status { font-family: var(--brand-sans); letter-spacing: 0; }
.count { font-weight: 500; font-size: 14px; }
.chip .n { font-size: 12.5px; font-weight: 500; color: var(--faint); }
.meta { font-size: 13px; }
.meta .tag { text-transform: capitalize; font-weight: 600; }
.pill.badge { font-size: 12px; font-weight: 600; }
.vby, .sp-by { font-size: 13px; }

/* Code stays code. */
.input.mono, .code-input, .dev-link, code, pre, #cmd { font-family: var(--mono); }
.tag { font-family: var(--brand-sans); font-size: 12px; }
.signin .form-error:empty { min-height: 0; margin: 0; }

/* Views in the share sheet */
.view-total { margin: 4px 0 0; font-size: 14px; color: var(--accent-2); font-weight: 600; }
#people .role { white-space: nowrap; }
#people .role b { color: var(--text); font-weight: 650; }
#people .role .none { color: var(--faint); }
@media (max-width: 640px) { #people .role { font-size: 12.5px; } }
.modal-head > div { flex: 1; min-width: 0; }
.modal-head:has(.view-total) { align-items: flex-start; }
.home-logo { display: inline-block; border-radius: 12px; transition: transform .15s; }
.home-logo:hover { transform: scale(1.06); }
.home-logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* Sign-in code step */
.sent h2 { font-family: var(--brand-sans); font-stretch: 74%; font-weight: 800; font-size: 28px; line-height: 1; margin: 6px 0 8px; }
.sent .sent-msg { margin: 0 0 18px; }
.code-form { display: grid; gap: 10px; }
.code-box { height: 58px !important; text-align: center; font-size: 28px !important; font-weight: 700; letter-spacing: .3em; padding-left: .3em !important; font-variant-numeric: tabular-nums; }
.code-box::placeholder { color: var(--line-2); letter-spacing: .3em; }
.sent-actions { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 14px; color: var(--faint); font-size: 13.5px; }
.sent-actions .text-btn { font-size: 13.5px; }
