/* ============================================================
   sala.video — create workspace
   Extracted from mockup designs, consolidated
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Major+Mono+Display&display=swap');

:root {
  --paper: #f1ece0;
  --paper-2: #e8e2d2;
  --ink: #0a0a0a;
  --mute: #908b7e;
  --light: #c6c0b0;
  --green: #008a4b;
  --red: #e62a17;
  --yellow: #f5c008;
  --orange: #ef8a17;
  --blue: #143fb7;
  --purple: #6d28b4;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.menlo { font-family: Menlo, 'Space Mono', monospace; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }

.frame {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 10px 140px;
}

/* ─── Topbar ──────────────────────────────────────────── */

.brand-mark {
  font-family: 'Major Mono Display', monospace;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000000;
}
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1.5px solid var(--light);
  gap: 24px;
}

.timer {
  font-family: 'Space Mono', monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--green);
  justify-self: center;
  font-variant-numeric: tabular-nums;
}
.topnav {
  display: flex;
  gap: 8px;
  justify-self: end;
}
.topnav a {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 16px;
  color: #fff;
}
.topnav a.green  { background: var(--green); }
.topnav a.blue   { background: var(--blue); }
.topnav a.red    { background: var(--red); }
.topnav a.orange { background: var(--orange); }
.topnav a.purple { background: var(--purple); }
.topnav a.dark   { background: var(--ink); }
.topnav a.yellow { background: var(--yellow); color: var(--ink); }
.topnav a.active { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ─── Page header (Projects index) ────────────────────── */

.page-head {
  padding: 64px 0 56px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
}
.h-title {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 56px;
  line-height: 0.96;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.h-title .of {
  color: var(--red);
  font-style: italic;
  font-weight: 400;
}
.h-meta {
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mute);
  line-height: 1.9;
}
.h-meta b { color: var(--ink); font-weight: 700; }
.new-btn {
  display: inline-block;
  margin-top: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 9px 14px;
}
.new-btn:hover { background: #2a2a2a; }

/* ─── Filter bar ──────────────────────────────────────── */

.filterbar {
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.filterbar .stamp {
  background: var(--red);
  color: #fff;
  font-weight: 700;
  padding: 8px 12px 9px;
}
.filterbar .titles { color: var(--green); font-weight: 700; }
.filterbar .grp { display: flex; gap: 20px; align-items: center; color: var(--mute); }
.filterbar a.active { color: var(--ink); }
.filterbar a.active::before { content: '▸ '; color: var(--ink); }
.filterbar .sep { width: 1px; height: 16px; background: rgba(10,10,10,0.2); }
.filterbar .count b { color: var(--ink); font-weight: 700; }
.filterbar .right { margin-left: auto; display: flex; gap: 20px; color: var(--mute); }

/* ─── Project cards grid ──────────────────────────────── */

.grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px 32px;
}
.card { display: block; }
.card-poster {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #1a1a1a;
  margin-bottom: 18px;
}
.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-poster .ph {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(45deg,
      #1a1a1a 0 14px,
      #232323 14px 28px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.32);
  text-transform: uppercase;
}
.card-stamp {
  position: absolute;
  top: 14px; left: 14px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 8px;
  background: var(--green);
  color: #fff;
}
.card-stamp.post    { background: var(--yellow); color: var(--ink); }
.card-stamp.dev     { background: var(--blue); }
.card-stamp.shoot,
.card-stamp.production { background: var(--red); }
.card-stamp.archive { background: var(--ink); color: var(--paper); }
.card-num {
  position: absolute;
  bottom: 14px; right: 14px;
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
}
.card-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.card-title {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.card-year {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mute);
  margin-top: 4px;
}
.card-liner {
  font-size: 12px;
  line-height: 1.55;
  color: #2c2a25;
  max-width: 38ch;
}
.card-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(10,10,10,0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.card-foot .pub.on  { color: var(--green); }
.card-foot .pub.off { color: var(--mute); }
.card:hover .card-info .card-title {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

/* ─── Breadcrumb ──────────────────────────────────────── */

.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.crumb b { color: var(--ink); font-weight: 400; }
.crumb .sep { opacity: 0.4; }

/* ─── Project header ──────────────────────────────────── */

.pheader {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 280px 1fr 400px;
  gap: 32px;
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--ink);
}
.pposter {
  aspect-ratio: 3/4;
  background: #1a1a1a;
  overflow: hidden;
  position: relative;
}
.pposter .ph {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, #1a1a1a 0 14px, #232323 14px 28px);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; letter-spacing: 0.16em; color: rgba(255,255,255,0.32);
  text-transform: uppercase;
}
.pposter img { width: 100%; height: 100%; object-fit: cover; }
.pposter .stamp {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 8px;
}
.pposter .stamp.green  { background: var(--green); color: #fff; }
.pposter .stamp.red    { background: var(--red); color: #fff; }
.pposter .stamp.blue   { background: var(--blue); color: #fff; }
.pposter .stamp.archive{ background: var(--ink); color: var(--paper); }

.ptitle-wrap { padding-bottom: 8px; }
.ptag {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 18px;
}
.ptitle {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 64px;
  line-height: 0.94;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.ptitle .end {
  color: var(--red);
  font-style: italic;
  font-weight: 400;
}
.pliner {
  font-size: 14px;
  line-height: 1.65;
  color: #2c2a25;
  max-width: 54ch;
}
/* .pside styles moved below — now a flex column for video + meta */

/* ─── Public page strip ───────────────────────────────── */

.pub-strip {
  margin-top: 28px;
  padding: 18px 22px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 22px;
}
.pub-strip .lbl {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(241,236,224,0.55);
}
.pub-strip .url {
  font-family: Menlo, monospace;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.pub-strip .count {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pub-strip a.cta {
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ─── In-page nav blocks ──────────────────────────────── */

.pagenav {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pagenav a {
  padding: 22px 22px 24px;
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px 16px;
  min-height: 92px;
}
.pagenav a.green  { background: var(--green); }
.pagenav a.red    { background: var(--red); }
.pagenav a.blue   { background: var(--blue); }
.pagenav a.yellow { background: var(--yellow); color: var(--ink); }
.pagenav a .nn {
  grid-column: 1 / -1;
  font-size: 11px;
  letter-spacing: 0.16em;
  opacity: 0.7;
  font-weight: 400;
}
.pagenav a.yellow .nn { opacity: 0.85; }
.pagenav a .count {
  font-size: 28px;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* ─── Section headers ─────────────────────────────────── */

.section { margin-top: 64px; scroll-margin-top: 24px; }
.sec-head {
  display: grid;
  grid-template-columns: 120px 1fr auto auto;
  align-items: stretch;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 28px;
}
.sec-num {
  background: var(--green);
  color: #fff;
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 56px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1.5px solid var(--ink);
}
.sec-num.red    { background: var(--red); }
.sec-num.blue   { background: var(--blue); }
.sec-num.yellow { background: var(--yellow); color: var(--ink); }
.sec-name {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  padding: 22px 24px;
  display: flex;
  align-items: center;
}
.sec-rule {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-left: 1px dashed rgba(10,10,10,0.22);
}
.sec-rule b { color: var(--ink); font-weight: 700; }
.sec-add {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 0 24px;
  display: flex;
  align-items: center;
  border-left: 1.5px solid var(--ink);
}
.sec-add:hover { background: #2a2a2a; }

/* ─── Materials table ─────────────────────────────────── */

.mat-cols, .mat-row {
  display: grid;
  grid-template-columns: 56px 140px 1fr 220px 120px;
  gap: 20px;
}
.mat-cols {
  padding-bottom: 8px;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.mat-cols .pub-col { display: flex; align-items: center; gap: 6px; justify-content: center; }
.mat-cols .pub-col span.dot {
  width: 8px; height: 8px; background: var(--green); display: inline-block;
}
.mat-row {
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px dashed rgba(10,10,10,0.22);
}
.mat-row:last-child { border-bottom: none; }
.mat-check { display: flex; align-items: center; justify-content: center; }
.mat-check input {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  position: relative;
}
.mat-check input:checked { background: var(--green); border-color: var(--green); }
.mat-check input:checked::after {
  content: '';
  width: 12px; height: 7px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  margin-top: -3px;
}
.mat-check input:disabled { opacity: 0.4; cursor: not-allowed; }

.mat-thumb {
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
}
.mat-thumb .ph {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, #1a1a1a 0 10px, #232323 10px 20px);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; letter-spacing: 0.14em; color: rgba(255,255,255,0.3);
  text-transform: uppercase; text-align: center; padding: 4px;
}
.mat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mat-thumb.empty {
  background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
}
.mat-thumb.empty::before, .mat-thumb.empty::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 1px;
  background: rgba(10,10,10,0.22); left: 50%;
}
.mat-thumb.empty::before { transform: rotate(45deg) scaleY(1.6); }
.mat-thumb.empty::after  { transform: rotate(-45deg) scaleY(1.6); }
.mat-thumb .rt {
  position: absolute; bottom: 6px; right: 6px;
  background: var(--ink); color: var(--paper);
  font-size: 9px; letter-spacing: 0.06em; padding: 2px 5px;
}
.mat-thumb.paper {
  background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; text-align: center;
}
.mat-thumb.paper.green  { background: var(--green); color: #fff; }
.mat-thumb.paper.red    { background: var(--red); color: #fff; }
.mat-thumb.paper.yellow { background: var(--yellow); color: var(--ink); }
.mat-thumb.paper.blue   { background: var(--blue); color: #fff; }

.mat-body { display: flex; flex-direction: column; gap: 4px; }
.mat-name {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.mat-name .empty-mark {
  color: var(--mute); font-weight: 400; margin-left: 10px;
  font-size: 10px; letter-spacing: 0.16em;
}
.mat-meta { font-size: 11px; color: var(--mute); }
.mat-type {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink); display: flex; flex-direction: column; gap: 4px;
}
.mat-type .kind {
  display: inline-block; align-self: flex-start;
  padding: 3px 7px; background: var(--ink); color: var(--paper);
}
.mat-type .kind.green { background: var(--green); color: #fff; }
.mat-type .kind.red   { background: var(--red); color: #fff; }
.mat-type .kind.yellow{ background: var(--yellow); color: var(--ink); }
.mat-type .kind.blue  { background: var(--blue); color: #fff; }
.mat-type .kind.empty { background: var(--paper); color: var(--mute); border: 1px solid var(--mute); }
.mat-type .sub { color: var(--mute); font-size: 10px; letter-spacing: 0.06em; text-transform: none; }
.mat-action { display: flex; justify-content: flex-end; }
.mat-action a {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  border-bottom: 1px solid var(--ink); padding-bottom: 2px;
}
.mat-action a.mute { color: var(--mute); border-bottom-color: var(--mute); }
.mat-action a.up { background: var(--ink); color: var(--paper); border: none; padding: 7px 10px; }

/* ─── Written materials ───────────────────────────────── */

.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
.doc {
  border: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.doc.wide { grid-column: 1 / -1; }
.doc-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
}
.doc-head .tag {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 3px 7px; background: var(--ink); color: var(--paper);
}
.doc-head .tag.green { background: var(--green); }
.doc-head .tag.red   { background: var(--red); }
.doc-head .tag.blue  { background: var(--blue); }
.doc-head .tag.yellow{ background: var(--yellow); color: var(--ink); }
.doc-head .ttl {
  font-family: 'Space Mono', monospace;
  font-weight: 700; font-size: 14px; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.doc-head .spacer { flex: 1; }
.doc-head label {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mute); cursor: pointer;
}
.doc-head label input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--paper); border: 1.5px solid var(--ink);
  cursor: pointer; display: grid; place-items: center; position: relative;
}
.doc-head label input:checked { background: var(--green); border-color: var(--green); }
.doc-head label input:checked::after {
  content: '';
  width: 9px; height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  margin-top: -2px;
}
.doc-head label.on { color: var(--ink); }
.doc-body {
  padding: 20px 22px 16px;
  font-size: 14px;
  line-height: 1.65;
  color: #1f1c17;
  min-height: 140px;
  outline: none;
}
.doc-body[contenteditable="true"]:focus { background: #fcfaf3; }
.doc-body p + p { margin-top: 12px; }
.doc-foot {
  border-top: 1px dashed rgba(10,10,10,0.22);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.doc-foot .spacer { flex: 1; }
.doc-foot a { border-bottom: 1px solid var(--ink); color: var(--ink); padding-bottom: 1px; }
.doc-foot .lang { color: var(--ink); }

/* ─── Uploaded documents ──────────────────────────────── */

.docs-uploads {
  border-top: 1px solid var(--ink);
  padding-top: 28px;
  margin-top: 16px;
}
.uploads-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.uploads-head .lbl {
  font-family: 'Space Mono', monospace;
  font-weight: 700; font-size: 14px;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.uploads-head .sub {
  color: var(--mute); font-size: 11px; letter-spacing: 0.04em;
}
.uploads-head .add {
  margin-left: auto;
  background: var(--ink); color: var(--paper);
  padding: 7px 10px; font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.uploads {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.upload {
  border: 1px solid var(--ink);
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  background: var(--paper);
}
.upload .row { display: flex; align-items: center; gap: 10px; }
.upload .ext {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 11px; letter-spacing: 0.04em;
  padding: 3px 6px;
  background: var(--ink); color: var(--paper);
}
.upload .ext.pdf { background: var(--red); }
.upload .ext.doc, .upload .ext.docx { background: var(--blue); }
.upload .ext.txt { background: var(--ink); }
.upload .name {
  font-family: 'Space Mono', monospace;
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.02em; text-transform: uppercase;
  line-height: 1.25;
}
.upload .meta { font-size: 10px; color: var(--mute); letter-spacing: 0.04em; }
.upload .foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed rgba(10,10,10,0.22);
}
.upload label {
  display: flex; align-items: center; gap: 6px;
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mute); cursor: pointer;
}
.upload label input {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--paper); border: 1.5px solid var(--ink);
  cursor: pointer; display: grid; place-items: center; position: relative;
}
.upload label input:checked { background: var(--green); border-color: var(--green); }
.upload label input:checked::after {
  content: '';
  width: 8px; height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  margin-top: -1px;
}
.upload .open {
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  border-bottom: 1px solid var(--ink); padding-bottom: 1px;
}
.upload.add-tile {
  border-style: dashed;
  color: var(--mute);
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  min-height: 140px;
}
.upload.add-tile .plus { font-size: 28px; font-weight: 400; color: var(--ink); }
.upload.add-tile .lab { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }

/* ─── Footer ──────────────────────────────────────────── */

.footrule {
  margin-top: 100px;
  padding-top: 18px;
  border-top: 1px solid var(--light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.footrule .colors { display: flex; gap: 0; }
.footrule .colors span { width: 22px; height: 12px; }

/* ─── Login page ──────────────────────────────────────── */

.login-wrap {
  max-width: 420px;
  margin: 120px auto 0;
}
.login-wrap h1 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 42px;
  line-height: 0.96;
  text-transform: uppercase;
  margin-bottom: 40px;
}
.login-wrap h1 .sub {
  color: var(--red);
  font-style: italic;
  font-weight: 400;
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  font-family: Menlo, 'Space Mono', monospace;
  font-size: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
.field input:focus { background: #fcfaf3; }
.submit-btn {
  width: 100%;
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 16px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  margin-top: 12px;
}
.submit-btn:hover { background: #2a2a2a; }
.error-msg {
  background: var(--red);
  color: #fff;
  padding: 12px 16px;
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

/* ─── Empty state ─────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 120px 40px;
  color: var(--mute);
}
.empty-state h2 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 28px;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
}
.empty-state p {
  font-size: 14px;
  line-height: 1.6;
  max-width: 40ch;
  margin: 0 auto 28px;
}

/* ─── Project header: .pside becomes flex column ──────── */
/* Video on top, metadata at bottom, in the right column   */

.pside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
}
.pside-meta {
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mute);
  line-height: 1.9;
  padding-bottom: 8px;
}
.pside-meta b { color: var(--ink); font-weight: 700; letter-spacing: 0.02em; }
.pside-meta .public-link {
  display: inline-block;
  margin-top: 14px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ─── Video embed (sits inside .pside, right column) ──── */

.pside-video { width: 100%; }
.pside-video-title {
  display: block;
  margin-top: 8px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.pside-video-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.video-embed {
  position: relative;
  padding-top: 56.25%;
  background: #0a0a0a;
}
.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-empty {
  position: relative;
  padding-top: 56.25%;
  background: #0a0a0a;
  cursor: pointer;
}
.video-empty-inner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.video-empty .plus {
  font-size: 36px;
  color: rgba(255,255,255,0.2);
  font-weight: 300;
}
.video-empty .lab {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.video-empty .sub {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.22);
  text-align: center;
  line-height: 1.6;
}
.video-empty:hover .plus { color: rgba(255,255,255,0.4); }
.video-empty:hover .lab  { color: rgba(255,255,255,0.65); }

.video-locked {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: repeating-linear-gradient(45deg, #0a0a0a 0 16px, #111 16px 32px);
}
.video-locked .lock-icon { font-size: 32px; color: rgba(255,255,255,0.12); }
.video-locked .lock-label { font-size: 11px; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); }
.video-locked .lock-meta { font-size: 10px; color: rgba(255,255,255,0.25); }

/* ─── Header video badge ─────────────────────────────── */

.mat-row-header {
  background: rgba(0, 138, 75, 0.04);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}
.header-badge {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 6px;
  margin-left: 10px;
  vertical-align: middle;
  font-weight: 700;
}

/* ─── Trial nudge (last 5 days only) ──────────────────── */

.trial-nudge {
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px dashed var(--mute);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.trial-nudge b { color: var(--ink); font-weight: 700; }
.trial-nudge .cta {
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

/* ─── Upload modal ────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 10, 0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
}
.modal-title {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.modal-close {
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--mute);
  padding: 0 4px;
}
.modal-close:hover { color: var(--ink); }
.modal-body {
  padding: 24px 20px 28px;
}
.modal-body .field { margin-bottom: 18px; }
.modal-body select {
  width: 100%;
  font-family: Menlo, monospace;
  font-size: 13px;
  padding: 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
}
.modal-body input[type="file"] {
  width: 100%;
  font-family: Menlo, monospace;
  font-size: 12px;
  padding: 12px;
  border: 1.5px dashed var(--mute);
  background: var(--paper);
  cursor: pointer;
}
.modal-body input[type="file"]:hover { border-color: var(--ink); }

/* ─── Progress bar ────────────────────────────────────── */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--paper-2);
  border: 1px solid rgba(10,10,10,0.15);
  margin-bottom: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width 0.3s ease;
}

/* Indeterminate state: iOS needs time to export video before bytes move */
@keyframes progress-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.progress-fill.progress-indeterminate {
  width: 25% !important;
  transition: none;
  animation: progress-shimmer 1.4s ease-in-out infinite;
}
.progress-text {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mute);
  margin-bottom: 16px;
}

/* ─── Public page strip: toggle + states ──────────────── */

.pub-strip.pub-off {
  background: var(--paper-2);
  color: var(--mute);
  border: 1px dashed var(--mute);
}
.pub-strip.pub-off .url {
  opacity: 0.4;
}
.pub-strip.pub-off .count {
  color: var(--mute);
}

.pub-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pub-toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.pub-off .pub-toggle input {
  background: var(--paper);
  border-color: var(--mute);
}
.pub-toggle input::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  transition: transform 0.2s;
}
.pub-off .pub-toggle input::after {
  background: var(--mute);
}
.pub-toggle input:checked {
  background: var(--green);
  border-color: var(--green);
}
.pub-toggle input:checked::after {
  transform: translateX(16px);
  background: #fff;
}
.pub-toggle input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pub-toggle-label {
  font-weight: 700;
}
.pub-off .pub-toggle-label {
  color: var(--ink);
}

.trial-note {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mute);
  font-style: italic;
}

/* ─── Locked upload button (trial limit) ──────────────── */

.sec-add-locked {
  opacity: 0.4;
  position: relative;
}
.sec-add-locked:hover {
  opacity: 0.7;
  background: var(--yellow) !important;
  color: var(--ink) !important;
}

/* ─── Account page ────────────────────────────────────── */

.account-section {
  margin-top: 48px;
}
.account-form {
  padding: 28px 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
  margin-bottom: 24px;
}
.success-msg {
  background: var(--green);
  color: #fff;
  padding: 12px 16px;
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-top: 18px;
}

/* Plan comparison */
.plan-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 28px 0;
}
.plan-detail.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 760px) {
  .plan-detail.cols-3 { grid-template-columns: 1fr; }
}
.plan-col {
  border: 1px dashed var(--mute);
  padding: 24px;
}
.plan-col.pro {
  border: 1.5px solid var(--ink);
}
.plan-name {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 22px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.plan-items {
  font-size: 13px;
  line-height: 2.2;
}
.plan-items .muted {
  color: var(--mute);
}
.plan-reveal {
  padding: 8px 0 20px;
}
.plan-reveal summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 10px 0;
  list-style: none;
  user-select: none;
}
.plan-reveal summary::-webkit-details-marker { display: none; }
.plan-reveal summary::before {
  content: '▸ ';
  color: var(--green);
}
.plan-reveal[open] summary::before {
  content: '▾ ';
}

/* ─── Feature guide ───────────────────────────────────── */
.guide-body {
  padding: 8px 0 12px;
  max-width: 760px;
}
.guide-body p {
  font-size: 14px;
  line-height: 1.7;
  color: #2c2a25;
  margin-bottom: 14px;
}
.guide-steps {
  margin: 0 0 4px 0;
  padding-left: 22px;
}
.guide-steps li {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 8px;
}
.guide-body code {
  font-family: Menlo, monospace;
  font-size: 12px;
  background: var(--paper-2, #e8e2d2);
  padding: 1px 6px;
}
.guide-note {
  border-left: 2px solid var(--light);
  padding-left: 14px !important;
  font-size: 13px !important;
  color: var(--mute) !important;
  margin-top: 6px;
}

/* ─── Public pages dashboard ──────────────────────────── */

.pub-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px dashed rgba(10,10,10,0.22);
}
.pub-row:last-child { border-bottom: none; }
.pub-row-off { opacity: 0.65; }

.pub-row-poster {
  width: 80px;
  aspect-ratio: 3/4;
  background: #1a1a1a;
  overflow: hidden;
}
.pub-row-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.pub-row-poster .ph {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, #1a1a1a 0 8px, #232323 8px 16px);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; letter-spacing: 0.14em; color: rgba(255,255,255,0.3);
  text-transform: uppercase;
}

.pub-row-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pub-row-title {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.pub-row-url {
  font-family: Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--green);
}
.pub-row-off .pub-row-url { color: var(--mute); }
.pub-row-liner {
  font-size: 12px;
  line-height: 1.5;
  color: var(--mute);
  max-width: 50ch;
}

.pub-row-stats {
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mute);
  line-height: 1.9;
}
.pub-row-stats b {
  color: var(--ink);
  font-weight: 700;
}

.pub-row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pub-row-btn {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}
.pub-row-btn:hover { background: #2a2a2a; }
.pub-row-btn.outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.pub-row-btn.outline:hover { background: var(--paper-2); }

/* ─── Upgrade page ────────────────────────────────────── */

.upgrade-features { margin-top: 48px; }
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.feature-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--light);
  background: var(--paper);
}
.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.feature-text {
  font-size: 13px;
  line-height: 1.65;
  color: #2c2a25;
}
.feature-text b {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.payment-methods { margin-top: 48px; }
.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.payment-card {
  border: 1.5px solid var(--ink);
  background: var(--paper);
}
.payment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--ink);
}
.payment-label {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.payment-price {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--green);
}
.payment-card-body {
  padding: 20px;
}
.payment-card-body p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--mute);
  margin-bottom: 20px;
}
.payment-card-body .submit-btn {
  width: 100%;
}

/* QR section */
.qr-section {
  display: flex;
  gap: 20px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--light);
  margin-bottom: 16px;
}
.qr-code {
  flex-shrink: 0;
}
.qr-placeholder {
  width: 120px;
  height: 120px;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-inner {
  font-family: Menlo, monospace;
  font-size: 24px;
  color: var(--mute);
}
.qr-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.qr-row {
  display: flex;
  gap: 12px;
  font-size: 12px;
}
.qr-label {
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  min-width: 80px;
}
.qr-value {
  font-family: Menlo, monospace;
  font-weight: 700;
}
.qr-ref {
  color: var(--red);
  letter-spacing: 0.06em;
}

.qr-upload input[type="file"] {
  width: 100%;
  font-family: Menlo, monospace;
  font-size: 12px;
  padding: 10px;
  border: 1.5px dashed var(--mute);
  background: var(--paper);
  cursor: pointer;
  margin-bottom: 12px;
}

/* ─── Export page ─────────────────────────────────────── */

.export-form { padding: 28px 0; }
.export-section { margin-bottom: 28px; }
.export-section-head {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(10,10,10,0.18);
  margin-bottom: 4px;
}
.export-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(10,10,10,0.12);
  cursor: pointer;
}
.export-item:hover { background: rgba(10,10,10,0.02); margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.export-item input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; flex-shrink: 0;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
}
.export-item input:checked { background: var(--green); border-color: var(--green); }
.export-item input:checked::after {
  content: '';
  width: 12px; height: 7px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg); margin-top: -3px;
}
.export-item input:disabled { opacity: 0.5; }
.export-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.export-name {
  font-weight: 700; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.export-desc { font-size: 11px; color: var(--mute); }
.export-kind {
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mute);
}
.export-tag {
  font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 7px; background: var(--paper-2); color: var(--mute);
}
.export-thumb {
  width: 60px; height: 45px;
  background: #1a1a1a; overflow: hidden; flex-shrink: 0;
}
.export-thumb img { width: 100%; height: 100%; object-fit: cover; }
.export-options {
  margin-top: 24px; padding: 20px 0;
  border-top: 1px solid var(--light);
}

/* Video download list */
.download-list { padding: 12px 0; }
.download-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px dashed rgba(10,10,10,0.18);
}
.download-row:last-child { border-bottom: none; }
.download-thumb {
  aspect-ratio: 16/9;
  background: #1a1a1a;
  overflow: hidden;
  position: relative;
}
.download-thumb img { width: 100%; height: 100%; object-fit: cover; }
.download-thumb .rt {
  position: absolute; bottom: 4px; right: 4px;
  background: var(--ink); color: var(--paper);
  font-size: 9px; padding: 2px 5px;
}
.download-info { display: flex; flex-direction: column; gap: 4px; }
.download-name {
  font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.download-meta { font-size: 11px; color: var(--mute); }
.download-actions { display: flex; gap: 8px; }
.download-btn {
  font-family: Menlo, monospace; font-weight: 700;
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 8px 14px;
  background: var(--ink); color: var(--paper);
}
.download-btn:hover { background: #2a2a2a; }
.download-btn.outline {
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink);
}
.download-btn.outline:hover { background: var(--paper-2); }

/* ─── Section header: dual buttons ────────────────────── */

.sec-actions {
  display: flex;
  gap: 0;
  border-left: 1.5px solid var(--ink);
}
.sec-actions .sec-add {
  border-left: none;
}
.sec-actions .sec-add + .sec-add {
  border-left: 1px solid rgba(241,236,224,0.3);
}

/* ─── Export checkbox in modal ────────────────────────── */

.export-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 13px;
}
.export-check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex-shrink: 0;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
}
.export-check input:checked { background: var(--green); border-color: var(--green); }
.export-check input:checked::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg); margin-top: -2px;
}
.export-check input:disabled { opacity: 0.4; }
.export-check b { font-weight: 700; }

/* ─── Video page ──────────────────────────────────────── */

.video-page { margin-top: 28px; }

.vp-player {
  position: relative;
  padding-top: 56.25%;
  background: #0a0a0a;
}
.vp-player iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.vp-processing {
  position: relative;
  padding-top: 56.25%;
  background: #0a0a0a;
}
.vp-processing-inner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}

.vp-info {
  padding: 24px 0;
  border-bottom: 1px solid var(--light);
}
.vp-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}
.vp-kind {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.vp-title {
  font-weight: 700;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.vp-meta {
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mute);
  line-height: 1.9;
}
.vp-meta b { color: var(--ink); font-weight: 700; }

.vp-actions {
  display: flex;
  gap: 8px;
  padding: 18px 0;
  border-bottom: 1px solid var(--light);
  flex-wrap: wrap;
}
.vp-btn {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 16px;
  background: var(--ink);
  color: var(--paper);
}
.vp-btn:hover { background: #2a2a2a; }
.vp-btn.green { background: var(--green); }
.vp-btn.green:hover { background: #007a42; }

.vp-section {
  padding: 28px 0;
}
.vp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vp-section-add {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 7px 12px;
}
.vp-empty {
  padding: 32px 0;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.6;
}

/* Screener link rows */
.screener-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(10,10,10,0.18);
}
.screener-row:last-child { border-bottom: none; }
.screener-expired { opacity: 0.45; }
.screener-label {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
.screener-url {
  font-family: Menlo, monospace;
  font-size: 11px;
  color: var(--green);
  margin-top: 2px;
}
.screener-meta {
  font-size: 11px;
  color: var(--mute);
  margin-top: 2px;
}
.screener-stats {
  text-align: right;
  font-size: 11px;
  color: var(--mute);
  line-height: 1.8;
}
.screener-actions a {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}
.screener-actions .mute {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ─── Image lightbox ──────────────────────────────────── */

.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 10, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox-box {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.lightbox-img {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  min-height: 200px;
}
.lightbox-img img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.lightbox-bar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--light);
}
.lightbox-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lightbox-title {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.lightbox-meta {
  font-size: 11px;
  color: var(--mute);
}
.lightbox-actions {
  display: flex;
  gap: 8px;
}

/* ─── Clickable material rows ─────────────────────────── */

.mat-name-link {
  color: inherit;
  text-decoration: none;
}
.mat-name-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a.mat-thumb {
  display: block;
  cursor: pointer;
}
a.mat-thumb:hover img {
  opacity: 0.85;
}

/* ─── Green export button ─────────────────────────────── */

.sec-add-green {
  background: var(--green) !important;
}
.sec-add-green:hover {
  background: #007a42 !important;
}

/* ─── Video page subtitle ─────────────────────────────── */

.vp-subtitle {
  font-size: 13px;
  color: var(--mute);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ─── Video action icons (compact) ────────────────────── */

.mat-action-group {
  display: flex;
  gap: 4px;
}
.act-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1px solid var(--light);
  color: var(--mute);
  text-decoration: none;
  transition: all 0.15s;
}
.act-icon:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-2);
}
.act-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* CSS tooltips — instant on hover */
[data-tip] {
  position: relative;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 9px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}
[data-tip]:hover::after {
  opacity: 1;
}

/* ─── Writing block reorder + delete ──────────────────── */

.doc-reorder {
  display: flex;
  gap: 2px;
  margin-right: 12px;
}
.doc-reorder a {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid var(--light);
  color: var(--mute);
  text-decoration: none;
}
.doc-reorder a:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-2);
}
.doc-delete {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--mute);
  margin-left: 8px;
  text-decoration: none;
}
.doc-delete:hover {
  color: var(--red);
}

/* ─── Writing text formatting consistency ─────────────── */
/* Forces consistent presentation regardless of pasted formatting */

.doc-body {
  font-family: 'Space Mono', monospace !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  color: #1f1c17 !important;
  font-weight: 400 !important;
}
.doc-body * {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  font-weight: inherit !important;
  background: none !important;
  margin: 0;
  padding: 0;
}
.doc-body p { margin-bottom: 12px; }
.doc-body p:last-child { margin-bottom: 0; }
.doc-body b, .doc-body strong { font-weight: 700 !important; }
.doc-body i, .doc-body em { font-style: italic; }

/* ─── Drag handle for writing blocks ──────────────────── */

.doc-grip {
  cursor: grab;
  font-size: 14px;
  color: var(--light);
  user-select: none;
  padding: 0 4px;
  line-height: 1;
}
.doc-grip:hover {
  color: var(--mute);
}
.doc-grip:active {
  cursor: grabbing;
}

/* SortableJS drag states */
.doc-ghost {
  opacity: 0.15;
}
.doc-chosen {
  box-shadow: 0 4px 24px rgba(10, 10, 10, 0.15);
}
.doc-drag {
  opacity: 0.9;
}

/* ─── Version badge ───────────────────────────────────── */

.version-badge {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 2px 5px;
  background: var(--blue);
  color: #fff;
  vertical-align: middle;
  margin-left: 8px;
  font-weight: 700;
}

/* Remove icon hover state */
.act-remove:hover {
  color: var(--red) !important;
  border-color: var(--red) !important;
}

/* ─── Analytics dashboard ─────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 32px;
  margin-bottom: 16px;
}
.stat-card {
  border: 1.5px solid var(--ink);
  padding: 24px 20px;
  text-align: center;
}
.stat-num {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 36px;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Per-project analytics inline */
.analytics-stats {
  display: flex;
  gap: 20px;
}
.analytics-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.analytics-num {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 18px;
}
.analytics-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Geographic bars */
.geo-grid {
  padding: 8px 0;
}
.geo-row {
  display: grid;
  grid-template-columns: 140px 1fr 50px;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
}
.geo-country {
  font-size: 12px;
  font-weight: 700;
}
.geo-bar {
  height: 8px;
  background: var(--paper-2);
}
.geo-bar span {
  display: block;
  height: 100%;
  background: var(--green);
  min-width: 2px;
}
.geo-count {
  font-family: Menlo, monospace;
  font-size: 12px;
  text-align: right;
  color: var(--mute);
}

/* Activity timeline */
.activity-list {
  padding: 8px 0;
}
.activity-row {
  display: grid;
  grid-template-columns: 140px 1fr auto 70px;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(10,10,10,0.12);
  font-size: 12px;
}
.activity-row:last-child { border-bottom: none; }
.activity-type {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.activity-type.blue  { color: var(--blue); }
.activity-type.green { color: var(--green); }
.activity-detail {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}
.activity-sub {
  font-weight: 400;
  color: var(--mute);
  text-transform: none;
}
.activity-loc {
  font-size: 11px;
  color: var(--mute);
  text-align: right;
}
.activity-time {
  font-family: Menlo, monospace;
  font-size: 11px;
  color: var(--mute);
  text-align: right;
}

/* ─── Public strip password controls ──────────────────── */

.pub-password {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--light);
}
.pub-pw-status {
  font-size: 16px;
  line-height: 1;
}
.pub-pw-action {
  font-family: Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  border-bottom: 1px solid var(--light);
  padding-bottom: 1px;
}
.pub-pw-action:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ─── Lightbox caption field ──────────────────────────── */

.lightbox-caption {
  padding: 12px 18px;
  background: #faf8f2;
  border-top: 1px solid var(--light);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.lightbox-caption textarea {
  flex: 1;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  min-height: 36px;
}
.lightbox-caption textarea::placeholder {
  color: var(--light);
}
.lb-save {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 14px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.lb-save:hover { background: #2a2a2a; }

/* ─── Material caption ────────────────────────────────── */

.mat-caption {
  font-size: 11px;
  line-height: 1.5;
  color: var(--mute);
  margin-top: 4px;
  max-width: 48ch;
  font-style: italic;
}

/* ─── Project header edit icon ────────────────────────── */

.ptag-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 11px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  vertical-align: middle;
  margin-left: 10px;
  text-decoration: none;
}
.ptag-edit:hover {
  color: var(--paper);
  background: var(--ink);
}

/* ─── Language toggle ─────────────────────────────────── */

.lang-toggle {
  font-family: Menlo, monospace !important;
  font-weight: 700 !important;
  font-size: 10px !important;
  letter-spacing: 0.12em !important;
  padding: 5px 10px !important;
  border: 1px solid var(--light) !important;
  color: var(--mute) !important;
  background: transparent !important;
  margin-right: 4px;
}
.lang-toggle:hover {
  border-color: var(--ink) !important;
  color: var(--ink) !important;
}

/* ─── Video page: editable title ──────────────────────── */

.vp-title-edit {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.vp-title-input {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid transparent;
  outline: none;
  padding: 0 0 2px;
  flex: 1;
}
.vp-title-input:focus {
  border-bottom-color: var(--ink);
}
.vp-title-save, .vp-notes-save {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.vp-title-input:focus ~ .vp-title-save,
.vp-title-edit:hover .vp-title-save,
.vp-notes:hover .vp-notes-save,
.vp-notes textarea:focus ~ .vp-notes-save {
  opacity: 1;
}

/* ─── Video page: notes/comment ───────────────────────── */

.vp-notes {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(10,10,10,0.12);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.vp-notes textarea {
  flex: 1;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  min-height: 36px;
  padding: 0;
}
.vp-notes textarea::placeholder {
  color: var(--light);
}

/* ─── Lightbox: title input ───────────────────────────── */

.lb-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.lb-title-input {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  outline: none;
  padding: 0 0 4px;
}
.lb-title-input:focus {
  border-bottom-color: var(--ink);
}

/* ─── Video page: thumbnail picker ────────────────────── */

.vp-thumbnail {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--light);
}
.vp-thumb-preview {
  width: 160px;
  aspect-ratio: 16/9;
  background: #1a1a1a;
  overflow: hidden;
  flex-shrink: 0;
}
.vp-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vp-thumb-controls {
  flex: 1;
}
.vp-thumb-label {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.vp-thumb-desc {
  font-size: 11px;
  color: var(--mute);
  line-height: 1.55;
  margin-bottom: 12px;
}
.vp-thumb-form {
  display: flex;
  gap: 8px;
}
.vp-thumb-input {
  font-family: Menlo, monospace;
  font-size: 14px;
  padding: 8px 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  width: 80px;
  text-align: center;
  outline: none;
}
.vp-thumb-input:focus { background: #fcfaf3; }
.vp-thumb-btn {
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
}
.vp-thumb-btn:hover { background: #2a2a2a; }

.thumb-tabs { display:flex; margin-bottom:16px; border-bottom:1.5px solid var(--ink); }
.thumb-tab { font-family:'Space Mono',monospace; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; padding:10px 16px; border:1.5px solid var(--ink); border-bottom:none; background:var(--paper-2); margin-right:6px; cursor:pointer; }
.thumb-tab.active { background:var(--ink); color:var(--paper); }
.thumb-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.thumb-cell { padding:0; border:1.5px solid var(--ink); background:var(--paper-2); cursor:pointer; aspect-ratio:16/9; overflow:hidden; display:block; }
.thumb-cell img { width:100%; height:100%; object-fit:cover; display:block; }
.thumb-cell:hover { outline:2px solid var(--blue); }
.thumb-status { margin-top:14px; font-size:12px; min-height:1.2em; }
@media (max-width:520px){ .thumb-grid { grid-template-columns:repeat(2,1fr); } }

/* ── Mobile: global topbar + nav ─────────────────────── */
@media (max-width: 640px) {
  .frame { padding-bottom: 60px; }

  .topbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 0;
  }
  .timer { display: none; }
  .topnav {
    justify-self: unset;
    flex-wrap: wrap;
    gap: 4px;
  }
  .topnav a {
    padding: 6px 10px;
    font-size: 11px;
  }
  .brand-mark {
    font-size: 18px;
    font-family: 'Major Mono Display', monospace;
  }

  .crumb { flex-wrap: wrap; gap: 6px 8px; }
}

/* ── Mobile: video page ───────────────────────────────── */
@media (max-width: 640px) {
  .vp-title-row {
    flex-direction: column;
    gap: 12px;
  }
  .vp-meta {
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;
  }
  .vp-meta div { line-height: 1.6; }
  .vp-actions {
    gap: 6px;
  }
  .vp-btn {
    font-size: 10px;
    padding: 10px 14px;
  }
  .screener-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .screener-stats {
    text-align: left;
  }
  .screener-actions {
    padding-top: 2px;
  }
  .vp-section-head {
    flex-wrap: wrap;
    gap: 10px;
  }
  .vp-notes textarea {
    font-size: 16px;
  }
  .vp-title-input {
    font-size: 16px;
  }
}

/* ── Mobile: projects list page ───────────────────────── */
@media (max-width: 640px) {
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 28px 0 20px;
  }
  .h-title { font-size: 36px; }
  .h-meta { text-align: left; }

  /* Filterbar: single scrollable row, no wrap */
  .filterbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    padding: 8px 0;
  }
  .filterbar::-webkit-scrollbar { display: none; }
  .filterbar .stamp { flex-shrink: 0; font-size: 9px; padding: 6px 10px 7px; }
  .filterbar .titles { display: none; }
  .filterbar .sep { display: none; }
  .filterbar .grp {
    display: contents; /* flatten children directly into flex row */
  }
  .filterbar .grp a {
    flex-shrink: 0;
    padding: 0 10px;
    white-space: nowrap;
  }
  .filterbar .right { display: none; }

  /* Project cards: hide footer (materials count + public/private) */
  .card-foot { display: none; }
  /* Also trim card liner on mobile to save vertical space */
  .card-liner { display: none; }

  /* Cards: 2-column grid */
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 16px;
    margin-top: 24px;
  }
  .card-title { font-size: 14px; }
  .card-year  { font-size: 10px; }
}

/* ── Mobile: project page ─────────────────────────────── */
@media (max-width: 640px) {
  .pheader {
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
    margin-top: 16px;
  }
  .pposter {
    grid-row: 1;
    grid-column: 1;
  }
  .ptitle-wrap {
    grid-row: 1;
    grid-column: 2;
    padding-bottom: 0;
  }
  .pside {
    grid-row: 2;
    grid-column: 1 / -1;
  }
  .ptitle { font-size: 28px; line-height: 1; }
  .pside-meta { text-align: left; }

  .pub-strip {
    flex-wrap: wrap;
    gap: 10px;
  }
  .pub-strip .url {
    font-size: 11px;
    word-break: break-all;
  }
  .pub-strip .count {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .pagenav {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
}

/* ── Mobile: project page sections ────────────────────── */
@media (max-width: 640px) {

  /* 1. Section headings: compact, hide items/public, keep 01/TITLE/ACTION */
  .sec-head {
    grid-template-columns: 44px 1fr auto;
    height: 44px;
    margin-bottom: 14px;
  }
  .sec-num { font-size: 18px; }
  .sec-name { font-size: 13px; padding: 0 12px; letter-spacing: 0.06em; }
  .sec-rule { display: none; }
  .sec-add { font-size: 10px; padding: 0 12px; letter-spacing: 0.08em; }
  .sec-actions { display: flex; align-items: stretch; }
  .sec-add-green { display: none; } /* hide Export on mobile */

  /* 2. Videos + stills: 2-col grid, thumbnail above, icons below */
  .mat-cols { display: none; }

  #videos, #stills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  #videos .sec-head, #stills .sec-head,
  #videos .empty-state, #stills .empty-state {
    grid-column: 1 / -1;
  }

  /* Card: flex column — thumbnail on top, icon bar directly below */
  #videos .mat-row, #stills .mat-row {
    display: flex;
    flex-direction: column;
    position: static;
    aspect-ratio: unset;
    overflow: hidden;
    padding: 0;
    margin: 0;       /* override .mat-row-header { margin: 0 -8px } bleed */
    gap: 0;
    min-width: 0;    /* critical: prevents grid item expanding beyond track width */
    max-width: 100%; /* belt-and-suspenders: clamp to grid track */
    border: 1px solid var(--light);
    background: var(--paper);
  }

  #videos .mat-check, #stills .mat-check,
  #videos .mat-body,  #stills .mat-body,
  #videos .mat-type,  #stills .mat-type {
    display: none;
  }

  /* Thumbnail: consistent 16/9 crop — display:block required for <a> tags */
  #videos .mat-thumb, #stills .mat-thumb {
    display: block;
    position: relative;
    inset: unset;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    flex-shrink: 0;
    overflow: hidden;
    min-width: 0;
  }

  /* Images must fill and crop to the enforced ratio */
  #videos .mat-thumb img, #stills .mat-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Icon bar: flush below thumbnail, full card width */
  #videos .mat-action, #stills .mat-action {
    position: static;
    bottom: unset; left: unset; right: unset;
    width: 100%;
    background: var(--paper-2);
    border-top: 1px solid var(--light);
    justify-content: center;
    padding: 8px 4px;
    gap: 10px;
    flex-shrink: 0;
  }

  #videos .act-icon, #stills .act-icon {
    width: 28px; height: 28px;
    font-size: 13px;
    border-color: var(--light);
    color: var(--mute);
  }
  #videos .act-active, #stills .act-active {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
  }

  /* 3. Written materials: single column, full width */
  .doc-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 24px;
  }
  .doc.wide { grid-column: 1; }

  .doc-head {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
  }
  .doc-head .spacer { display: none; }
  .doc-head label { margin-left: auto; }

  .doc-body {
    padding: 14px 16px;
    font-size: 15px;
  }

  .doc-foot {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
  }
  .doc-foot .spacer { display: none; }
}

/* ── Mobile: public analytics page ───────────────────── */
@media (max-width: 640px) {
  /* 4-column stats grid → 2×2 so cards don't overflow */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
  }
  .stat-num  { font-size: 28px; }
  .stat-card { padding: 18px 14px; }
}

/* ─── Admin panel ─────────────────────────────────────── */
.admin-table {
  margin-top: 24px;
  border-top: 1.5px solid var(--ink);
}
.admin-row {
  display: grid;
  grid-template-columns: 2.4fr 1.3fr 0.7fr 0.7fr 0.9fr 0.9fr 0.5fr;
  gap: 12px;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid var(--light);
  font-size: 13px;
}
.admin-head {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  border-bottom: 1px solid var(--ink);
}
.admin-acct { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.admin-acct span { font-size: 12px; color: var(--mute); }
.admin-acct .muted { font-size: 11px; }
.admin-actions { text-align: right; }
.admin-btn {
  font-family: Menlo, monospace; font-size: 16px; line-height: 1;
  padding: 4px 10px; background: var(--paper); border: 1px solid var(--ink);
  cursor: pointer;
}
.admin-btn:hover { background: var(--ink); color: var(--paper); }

.admin-detail {
  padding: 18px 8px 24px;
  border-bottom: 1px solid var(--light);
  background: var(--paper-2);
}
.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}
.admin-detail-col { display: flex; flex-direction: column; gap: 8px; }
.admin-detail-h {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mute); margin-bottom: 4px;
}
.admin-act {
  text-align: left; font-family: 'Space Mono', monospace; font-size: 12px;
  padding: 9px 12px; background: var(--paper); border: 1px solid var(--ink);
  cursor: pointer;
}
.admin-act:hover { background: var(--ink); color: var(--paper); }
.admin-act.danger { border-color: var(--red); color: var(--red); }
.admin-act.danger:hover { background: var(--red); color: #fff; }

.admin-pay { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-pay th {
  text-align: left; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mute); padding: 4px 8px 4px 0; font-weight: 400;
}
.admin-pay td { padding: 5px 8px 5px 0; border-top: 1px solid var(--light); }

@media (max-width: 760px) {
  .admin-row {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "acct status actions" "meta meta meta";
    row-gap: 8px;
  }
  .admin-row > div:nth-child(3),
  .admin-row > div:nth-child(4),
  .admin-row > div:nth-child(5),
  .admin-row > div:nth-child(6) { display: none; }
  .admin-head { display: none; }
  .admin-acct { grid-area: acct; }
  .admin-actions { grid-area: actions; }
  .admin-detail-grid { grid-template-columns: 1fr; }
  .admin-detail-col[style] { grid-column: 1 / -1 !important; }
}

/* ── Billing lifecycle: renewal banner ─────────────────── */
.notice-msg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  background: var(--yellow);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  margin: 18px 0;
}
.notice-msg.danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.notice-msg .notice-text { flex: 1 1 320px; }
.notice-msg .notice-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}
.notice-msg .notice-cta {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 2px solid currentColor;
}
.notice-msg .notice-link {
  font-size: 12px;
  text-decoration: underline;
  opacity: 0.85;
}

/* ── Locked (greyed) videos for trial / lapsed accounts ── */
.mat-row.mat-locked .mat-thumb,
.mat-row.mat-locked .mat-body,
.mat-row.mat-locked .mat-type { opacity: 0.45; }
.mat-row.mat-locked .empty-mark { color: var(--ink); opacity: 1; }
.video-locked { cursor: pointer; }

.vp-locked {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  aspect-ratio: 16 / 9;
}
.vp-locked-inner { text-align: center; padding: 24px; }
.vp-locked-icon { font-size: 40px; margin-bottom: 10px; }

/* ── Trailer embed (modal) ──────────────────────────────── */
.embed-row { display: flex; gap: 10px; }
.embed-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1.5px solid var(--ink);
}
.embed-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-code {
  flex: 1 1 auto;
  min-width: 0;
  font-family: Menlo, 'Space Mono', monospace;
  font-size: 12px;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}
.embed-copy {
  white-space: nowrap;
  font-family: Menlo, monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
}
.embed-copy:hover { background: #2a2a2a; }
