/* =========================================================
   Vib — dark blue UI kit
   Flat panels, thin borders, one blue accent. No blur or
   filters, so it stays fast on any machine.
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #05080d;
  --surface: #0c1117;
  --surface-2: #111821;
  --surface-3: #18212c;
  --border: #1d2631;
  --border-2: #2a3542;
  --text: #e6edf5;
  --text-2: #8b97a8;
  --text-3: #566273;

  --blue: #2b84f5;
  --blue-hover: #4596ff;
  --blue-edge: #1659b8;
  --blue-dim: #0b1d38;
  --blue-line: #2d6fd2;
  --red: #f0524a;
  --red-edge: #a8302a;
  --green: #2fbf71;
  --orange: #f5a524;
  --teal: #2bb3c0;
  --purple: #8b7cf6;

  --r-s: 6px;
  --r: 8px;
  --r-m: 12px;
  --r-l: 16px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
/* stop phones from enlarging text on their own when rotated */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #0b1526 0%, transparent 70%), var(--bg);
  background-repeat: no-repeat;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip; /* nothing can make the page slide sideways */
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
/* no double-tap zoom or grey flash when tapping controls */
a, button, [role="button"], label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: rgba(43, 132, 245, .35); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 28px; padding-bottom: 64px; min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); }

/* ---------- type ---------- */
.large-title { font-size: clamp(28px, 4vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -.6px; margin: 0; overflow-wrap: anywhere; }
.title-3, .card-desc, .project-desc { overflow-wrap: anywhere; }
.title-1 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.4px; margin: 0; }
.title-2 { font-size: 20px; line-height: 1.25; font-weight: 650; letter-spacing: -.3px; margin: 0; }
.title-3 { font-size: 16px; line-height: 1.35; font-weight: 600; margin: 0; }
.headline { font-size: 15px; font-weight: 600; margin: 0; }
.footnote { font-size: 13px; }
.secondary { color: var(--text-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap; user-select: none;
  font-size: 14px; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(2px); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.small svg.icon { width: 16px; height: 16px; }
.btn.large { height: 46px; padding: 0 22px; font-size: 15px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* solid blue with a darker bottom edge */
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-edge); }
.btn.primary:hover { background: var(--blue-hover); }
.btn.primary:active { box-shadow: 0 1px 0 var(--blue-edge); }
/* navy fill, blue border */
.btn.outline { background: var(--blue-dim); border-color: var(--blue-line); color: #cfe2ff; box-shadow: 0 3px 0 #06101f; }
.btn.outline:hover { border-color: var(--blue); background: #0e2547; }
.btn.outline:active { box-shadow: 0 1px 0 #06101f; }
/* dark, grey border */
.btn.ghost { background: var(--surface-2); border-color: var(--border-2); color: var(--text); box-shadow: 0 3px 0 #03060a; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.ghost:active { box-shadow: 0 1px 0 #03060a; }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 3px 0 var(--red-edge); }
.btn.danger:hover { background: #ff6a62; }
.btn.danger:active { box-shadow: 0 1px 0 var(--red-edge); }
.btn.success { background: var(--green); color: #04150c; box-shadow: 0 3px 0 #1c7c48; }
.btn.destructive { color: var(--red); }

.icon-btn {
  width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; padding: 0;
  border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn.small svg.icon { width: 15px; height: 15px; }
.icon-btn.plain { border-color: transparent; background: none; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(5, 8, 13, .96); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-edge); }
.brand-mark svg.icon { width: 18px; height: 18px; stroke-width: 3; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: var(--r);
  color: var(--text-2); font-size: 14px; font-weight: 500; transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: #fff; background: var(--blue-dim); box-shadow: inset 0 0 0 1px var(--blue-line); }
.nav-link.active svg.icon { color: var(--blue); }
.search {
  flex: 1; min-width: 0; max-width: 380px; margin-left: auto; display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border-2);
  color: var(--text-3); transition: border-color .15s;
}
.search:focus-within { border-color: var(--blue); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--text-3); }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.search-toggle { display: none; margin-left: auto; }
.btn .short { display: none; }

/* Phones: search shrinks to an icon; tapping it swaps the bar for a full-width search box */
@media (max-width: 560px) {
  .search { display: none; }
  .search-toggle { display: inline-grid; }
  .topbar.searching .search { display: flex; margin-left: 0; }
  .topbar.searching .brand, .topbar.searching .top-right { display: none; }
  .topbar.searching .search-toggle { margin-left: 0; }
  .search input::-webkit-search-cancel-button { display: none; } /* the close button next to it does this */
  .btn .long { display: none; }
  .btn .short { display: inline; }
}

.account { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border-radius: var(--r);
  border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; color: var(--text-2);
}
.account-btn:hover { background: var(--surface-2); }
.account-name { color: var(--text); font-size: 14px; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  --size: 36px; width: var(--size); height: var(--size); flex: none; border-radius: var(--r);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--size) * .42);
  background: linear-gradient(150deg, var(--a1, #0b2a5b), var(--a2, var(--blue)));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-m);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  animation: pop .14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head .sub { font-size: 12px; color: var(--text-2); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-s);
  background: none; color: var(--text); font-size: 14px; cursor: pointer; text-align: left;
}
.menu-item svg.icon { color: var(--text-2); }
.menu-item:hover { background: var(--surface-3); }
.menu-item.destructive, .menu-item.destructive svg.icon { color: var(--red); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* bottom tab bar (phones only) */
.dock { display: none; }

/* ---------- page header & chips ---------- */
.page-header { margin: 4px 0 22px; }
.page-header p { margin: 6px 0 0; max-width: 620px; color: var(--text-2); font-size: 15px; }
.row-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: #3a4757; }
.chip.selected { background: var(--blue-dim); border-color: var(--blue-line); color: #fff; }
.chip svg.icon { width: 14px; height: 14px; color: var(--blue); }
.chip .count { color: var(--text-3); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m);
  transition: border-color .15s, transform .15s var(--ease);
}
.card { min-width: 0; }
/* lift on hover only with a real mouse; on touch screens it sticks after a tap and makes cards jump */
@media (hover: hover) {
  .card:hover { border-color: var(--blue-line); transform: translateY(-2px); }
}
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-badge {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 9px; border-radius: var(--r-s); font-size: 12px; font-weight: 600;
  background: var(--blue); color: #fff; box-shadow: 0 2px 0 var(--blue-edge);
}
.thumb-badge svg.icon { width: 11px; height: 11px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-desc { margin: 0; color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--text-3); }
.card-meta .by { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--text-2); font-weight: 500; }
.card-meta .by span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-s);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--c, var(--blue)); background: color-mix(in srgb, var(--c, var(--blue)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--blue)) 30%, transparent);
}
.pill svg.icon { width: 12px; height: 12px; }

.placeholder {
  position: relative; width: 100%; height: 100%; display: grid; place-items: center;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 8px, transparent 8px 16px),
    linear-gradient(150deg, var(--p1), var(--p2));
}
.placeholder svg.icon { width: 44px; height: 44px; color: rgba(255, 255, 255, .85); stroke-width: 1.6; }
.placeholder span { position: absolute; left: 14px; bottom: 10px; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .7); }

/* ---------- empty & loading ---------- */
.empty { text-align: center; padding: 56px 24px; border: 1px dashed var(--border-2); border-radius: var(--r-m); background: var(--surface); }
.empty.small { padding: 32px 20px; }
.empty .em-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: var(--r-m); display: grid; place-items: center; color: #fff; background: var(--blue); box-shadow: 0 3px 0 var(--blue-edge); }
.empty .em-icon svg.icon { width: 24px; height: 24px; }
.empty p { color: var(--text-2); margin: 6px 0 0; }
.empty .btn { margin-top: 20px; }
.loading { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--border-2); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- groups, rows, forms ---------- */
.section { margin-top: 32px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-header .headline { font-size: 15px; font-weight: 600; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; }
.row + .row { border-top: 1px solid var(--border); }
.row .r-icon { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; flex: none; color: var(--ic, var(--text-2)); background: color-mix(in srgb, var(--ic, var(--text-2)) 14%, transparent); }
.row .r-icon svg.icon { width: 17px; height: 17px; }
.row .r-text { flex: 1; min-width: 0; }
.row .r-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-title.mono { font-family: var(--mono); font-size: 13px; }
.row .r-sub { font-size: 12px; color: var(--text-2); }
.r-sub.wrap { white-space: normal; }
a.row:hover { background: var(--surface-2); }
.row.input-row { padding: 0 14px; }
.row input, .row textarea { flex: 1; width: 100%; border: 0; outline: none; background: none; color: var(--text); font-size: 15px; padding: 14px 0; }
.row textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.row input::placeholder, .row textarea::placeholder { color: var(--text-3); }
.row:focus-within { box-shadow: inset 2px 0 0 var(--blue); }

.form-page { max-width: 720px; margin: 0 auto; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 4px; }
.drop {
  padding: 28px 20px; text-align: center; cursor: pointer; border-radius: var(--r-m);
  border: 1px dashed var(--border-2); background: var(--surface); transition: border-color .15s, background .15s;
}
.drop:hover { border-color: var(--blue-line); }
.drop.over { border-color: var(--blue); background: var(--blue-dim); }
.drop .d-icon { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: var(--r-m); display: grid; place-items: center; color: var(--blue); background: var(--blue-dim); border: 1px solid var(--blue-line); }
.drop .d-icon svg.icon { width: 22px; height: 22px; }
.drop strong { display: block; font-size: 15px; font-weight: 600; }
.drop .footnote { color: var(--text-2); margin-top: 3px; }
.drop-actions { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.cover-preview { position: relative; border-radius: var(--r-m); overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--border); background: var(--surface-2); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-preview .icon-btn { position: absolute; top: 10px; right: 10px; }

.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--blue); transition: width .3s var(--ease); }
.progress.over > span { background: var(--red); }
.files-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px 10px; }
.file-scroll { max-height: 320px; overflow: auto; border-top: 1px solid var(--border); }
.btn.plain { background: none; border: 0; box-shadow: none; color: var(--blue); padding: 0 8px; }

.files-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section-hint { margin: -4px 0 12px; color: var(--text-2); font-size: 13px; }

/* storage meter shared by the finished project and the code */
.meter-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 14px 16px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.progress.split { display: flex; }
.progress.split > span { border-radius: 0; }
.progress.split > span.code { background: var(--purple); }
.progress.split.over > span { background: var(--red); }
.meter-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.meter-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); margin-right: 6px; }
.meter-legend .dot.code { background: var(--purple); }

/* folder tree */
.tree { max-height: 480px; overflow: auto; border-top: 1px solid var(--border); padding: 4px 0; }
.group > .tree:first-child { border-top: 0; }
.tree-row {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding-right: 10px; font-size: 13px;
  color: var(--text); cursor: default; user-select: none;
}
.tree-row:hover { background: var(--surface-2); }
.tree-row.folder { cursor: pointer; font-weight: 500; }
a.tree-row { cursor: pointer; }
.tree-row .chev { width: 16px; flex: none; display: grid; place-items: center; color: var(--text-3); }
.tree-row .chev svg.icon { width: 14px; height: 14px; transition: transform .15s; }
.tree-row[aria-expanded="true"] .chev svg.icon { transform: rotate(90deg); }
.tree-row .t-icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; color: var(--ic, var(--text-2)); }
.tree-row .t-icon svg.icon { width: 16px; height: 16px; }
.tree-row .t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.tree-row.folder .t-name { font-family: var(--font); font-size: 13px; }
.tree-row .t-meta { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.tree-row .t-dl { color: var(--text-3); display: grid; place-items: center; }
a.tree-row:hover .t-dl { color: var(--blue); }
.tree-row .icon-btn.small { width: 26px; height: 26px; }
.tree-row.more { color: var(--text-3); font-style: italic; }

.notice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: 14px; margin-bottom: 16px; }
.notice.err { background: rgba(240, 82, 74, .1); border: 1px solid rgba(240, 82, 74, .35); color: #ff8a83; }
.submit-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 28px; }
.upload-status { flex: 1; min-width: 220px; }
.upload-status .footnote { color: var(--text-2); margin-bottom: 8px; }

/* ---------- sign in ---------- */
.auth-wrap { min-height: calc(100vh - 220px); min-height: calc(100dvh - 220px); display: grid; place-items: center; }
.sheet {
  width: 100%; max-width: 420px; padding: 28px 24px 24px; border-radius: var(--r-l);
  background: var(--surface); border: 1px solid var(--border-2); box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
}
.sheet .app-icon { width: 48px; height: 48px; border-radius: var(--r-m); margin: 0 auto 14px; display: grid; place-items: center; color: #fff; background: var(--blue); box-shadow: 0 3px 0 var(--blue-edge); }
.sheet .app-icon svg.icon { width: 24px; height: 24px; stroke-width: 3; }
.sheet h1 { text-align: center; }
.sheet .lead { text-align: center; color: var(--text-2); margin: 6px 0 22px; font-size: 14px; }
.sheet .group { background: var(--surface-2); }
.sheet .btn { width: 100%; margin-top: 18px; }
.sheet .hint { font-size: 12px; color: var(--text-3); padding: 8px 2px 0; }

.segmented { position: relative; display: flex; padding: 3px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--border-2); margin-bottom: 22px; }
.segmented button { position: relative; z-index: 1; flex: 1; height: 32px; border: 0; background: none; border-radius: var(--r-s); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.seg-thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: var(--r-s);
  background: var(--blue); box-shadow: 0 2px 0 var(--blue-edge);
  transition: transform .25s var(--ease);
}
.segmented.right .seg-thumb { transform: translateX(100%); }
.segmented button[aria-selected="true"] { color: #fff; }
.section-header .segmented { margin: 0; min-width: 200px; }

/* ---------- project page ---------- */
.back-row { margin-bottom: 18px; }
.project-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.project-cover { border-radius: var(--r-l); overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); border: 1px solid var(--border); }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-cover .placeholder svg.icon { width: 72px; height: 72px; }
.project-info { display: flex; flex-direction: column; gap: 16px; }
.author { display: inline-flex; align-items: center; gap: 12px; width: fit-content; }
.author .who b { display: block; font-weight: 600; }
.author .who small { display: block; color: var(--text-2); font-size: 12px; }
.meta-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.project-desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; color: #c4ceda; line-height: 1.6; }

.runner { border: 1px solid var(--border-2); border-radius: var(--r-m); overflow: hidden; background: var(--surface); }
.runner-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.runner-bar .live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin: 0 6px 0 4px; flex: none; box-shadow: 0 0 0 3px rgba(47, 191, 113, .2); }
.runner-bar .url { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner iframe { display: block; width: 100%; height: 640px; border: 0; background: #fff; }
.runner:fullscreen iframe { height: calc(100vh - 53px); }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 4px 0 28px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); }
.profile-head .avatar { --size: 76px; border-radius: var(--r-m); font-size: 32px; }
.profile-head .stats { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- admin & moderation ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 16px; }
.stat .r-icon { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; color: var(--ic); background: color-mix(in srgb, var(--ic) 15%, transparent); margin-bottom: 12px; }
.stat .r-icon svg.icon { width: 17px; height: 17px; }
.stat .value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }

.report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.report + .report { margin-top: 10px; }
.report-head { display: flex; align-items: center; gap: 12px; }
.report-head .r-icon { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; flex: none; color: var(--ic); background: color-mix(in srgb, var(--ic) 15%, transparent); }
.report-head .r-icon svg.icon { width: 17px; height: 17px; }
.report-head .r-text { flex: 1; min-width: 0; }
.report .link { color: var(--blue); }
.report .link:hover { text-decoration: underline; }
.report .reason { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; font-size: 14px; color: #c4ceda; white-space: pre-wrap; overflow-wrap: anywhere; }
.r-actions, .user-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.user-row { flex-wrap: wrap; align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.user-row .name-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-row .name-line .r-title { font-weight: 600; }
.user-actions { width: 100%; padding-left: 48px; margin-top: 4px; }

/* toggle switch */
.switch {
  position: relative; flex: none; width: 46px; height: 26px; padding: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--border-2); transition: background .2s, border-color .2s;
}
.switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-3); transition: transform .2s var(--ease), background .2s; }
.switch[aria-checked="true"] { background: var(--blue); border-color: var(--blue); }
.switch[aria-checked="true"] .knob { transform: translateX(20px); background: #fff; }

/* ---------- dialog ---------- */
.alert {
  width: min(380px, calc(100% - 40px)); padding: 22px; border-radius: var(--r-l);
  background: var(--surface); color: var(--text); border: 1px solid var(--border-2);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}
.alert[open] { animation: pop .15s var(--ease); }
.alert::backdrop { background: rgba(2, 4, 8, .7); }
.alert h2 { font-size: 17px; font-weight: 650; margin: 0 0 6px; }
.alert p { color: var(--text-2); font-size: 14px; margin: 0 0 18px; }
.alert .actions { display: flex; justify-content: flex-end; gap: 10px; }
.alert-field {
  display: block; width: 100%; margin: -4px 0 18px; padding: 10px 12px; border-radius: var(--r);
  border: 1px solid var(--border-2); background: var(--bg); color: var(--text); font-size: 14px; outline: none;
}
.alert-field:focus { border-color: var(--blue); }
textarea.alert-field { min-height: 96px; resize: vertical; }
input.alert-field[readonly] { font-family: var(--mono); font-size: 17px; text-align: center; letter-spacing: 1px; color: #cfe2ff; }

/* ---------- toast ---------- */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  font-size: 14px; font-weight: 500; pointer-events: auto; animation: toast-in .2s var(--ease);
}
.toast .t-icon { width: 26px; height: 26px; border-radius: var(--r-s); display: grid; place-items: center; flex: none; color: var(--c, var(--green)); background: color-mix(in srgb, var(--c, var(--green)) 16%, transparent); }
.toast .t-icon svg.icon { width: 15px; height: 15px; }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- footer ---------- */
.footer { color: var(--text-3); font-size: 12px; padding: 40px 0 0; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav-link { padding: 0 10px; }
  .account-name { display: none; }
}
@media (max-width: 860px) {
  .project-head { grid-template-columns: 1fr; }
  .runner iframe { height: 500px; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { gap: 12px; }
  .nav-links, .brand-name, .hide-sm { display: none; }
  .search { max-width: none; }
  main.wrap { padding-bottom: 96px; }
  .dock {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: var(--r);
    color: var(--text-3); font-size: 11px; font-weight: 500;
  }
  .tab svg.icon { width: 21px; height: 21px; }
  .tab.active { color: var(--blue); background: var(--blue-dim); }
  .toast-host { left: 16px; right: 16px; bottom: 84px; }
  .user-actions { padding-left: 0; }
  .profile-head .avatar { --size: 60px; font-size: 26px; }
}

/* Phones (iPhones especially) zoom the whole page in when you tap a text box with text
   smaller than 16px, so every text field is 16px on touch screens */
@media (max-width: 760px), (pointer: coarse) {
  input, textarea, select, .search input, .row input, .row textarea, .alert-field { font-size: 16px; }
}

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