/* ad-examples.ts.app: the deck slide's look. Black stage, off-white rounded panel, Montserrat. */
@font-face { font-family: Montserrat; font-weight: 400; font-display: swap; src: url(/static/fonts/montserrat-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Montserrat; font-weight: 500; font-display: swap; src: url(/static/fonts/montserrat-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Montserrat; font-weight: 600; font-display: swap; src: url(/static/fonts/montserrat-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Montserrat; font-weight: 700; font-display: swap; src: url(/static/fonts/montserrat-latin-700-normal.woff2) format('woff2'); }

:root {
  --stage: #000;
  --paper: #f6fafd;      /* sampled from the deck slide */
  --ink: #0b0b0f;
  --muted: #5d6470;
  --accent: #435fdc;     /* the slide's blue */
  --frame: #e2e6eb;
  --line: #d9dee5;
  --danger: #b42318;
  --font: Montserrat, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--stage); }
body.stage { min-height: 100vh; padding: clamp(10px, 1.6vw, 28px); }

.panel { background: var(--paper); border-radius: clamp(18px, 2.4vw, 40px); max-width: 1680px; margin: 0 auto;
  padding: clamp(22px, 3.2vw, 56px) clamp(18px, 4.6vw, 88px) clamp(28px, 3.6vw, 64px); min-height: calc(100vh - 2 * clamp(10px, 1.6vw, 28px)); }
.panel-card { max-width: 560px; min-height: 0; margin-top: 10vh; }
.panel-home { min-height: 0; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 40px; }
.mark { font-weight: 600; letter-spacing: .07em; font-size: clamp(13px, 1vw, 17px); }
.mark-light { color: #f6fafd; }

.headline { font-weight: 700; font-size: clamp(24px, 2.5vw, 46px); line-height: 1.16; letter-spacing: -.005em; margin: clamp(18px, 2.2vw, 40px) 0 clamp(10px, 1vw, 18px); max-width: 1500px; }
.headline-sm { font-size: clamp(22px, 2vw, 30px); }
.sub { font-weight: 500; font-size: clamp(14px, 1.2vw, 21px); line-height: 1.5; margin: 0; max-width: 1500px; }
.sub strong { font-weight: 700; }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* ── The reel ─────────────────────────────────────────────────────────── */
.reel { container-type: inline-size; margin-top: clamp(22px, 2.6vw, 44px); display: flex; flex-direction: column; gap: clamp(14px, 1.4vw, 24px); }
.reel-empty p { color: var(--muted); text-align: center; padding: 60px 0; border: 2px dashed var(--line); border-radius: 14px; margin: 0; }
.row { display: flex; gap: 16px; align-items: flex-start; max-width: 100%; margin: 0 auto; }
.tile { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; outline-offset: 4px; }
.media { position: relative; width: 100%; overflow: hidden; border-radius: 8px; background: #dfe4ea;
  box-shadow: 0 0 0 5px var(--frame), 0 3px 14px 5px rgba(20, 30, 50, .16); }
.media video, .media img, .media iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.media iframe { pointer-events: none; transform: scale(1.02); }
.play { position: absolute; left: 50%; top: 50%; width: 22%; max-width: 64px; min-width: 34px; aspect-ratio: 1; transform: translate(-50%, -50%) scale(.9);
  border-radius: 50%; border: 3px solid #fff; background: rgba(0, 0, 0, .28); display: grid; place-items: center; opacity: 0; transition: opacity .18s, transform .18s; }
.play svg { width: 46%; fill: #fff; margin-left: 8%; }
.tile:hover .play, .tile:focus-visible .play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.arch { font-weight: 700; text-transform: uppercase; text-align: center; font-size: clamp(9px, .82vw, 15px); line-height: 1.25; letter-spacing: .01em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.arch-above { min-height: 2.5em; display: flex; align-items: flex-end; justify-content: center; margin-bottom: clamp(10px, 1vw, 16px); }
.arch-below { margin-top: clamp(12px, 1.1vw, 18px); }
/* Two-line labels ("CHALLENGE | ENTERTAIN + SELL", lib/labels.ts, Michelle 2026-11-04): line 1 bold and a little bigger,
   line 2 regular at the deck slide's size ratio (5pt under 8pt). Labels without a | look exactly as before. */
.arch.arch-2l, .watch-label.arch-2l { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.arch-above.arch-2l { justify-content: flex-end; }
/* --l1 (public/static/reel.js) shrinks every line 1 on the page together so none of them wraps ("STUDIO INTERVIEW + DEMO"). */
.arch-1 { display: block; font-size: calc(1.12em * var(--l1, 1)); line-height: 1.2; }
.arch-2l > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.arch-2 { display: block; font-size: max(9px, .7em); font-weight: 400; line-height: 1.3; letter-spacing: .03em; margin-top: .2em; }
/* Top row: tiles line up on the clip, so a longer label grows UP into the space above instead of pushing its clip down. */
.row-top { align-items: flex-end; }

/* ── Logo pages (lib/logos.ts): logo instead of headline, bigger labels ── */
/* The logo sits in the top bar, centred, so the ads get the height the headline used to take. */
.panel-logo { padding-top: clamp(14px, 1.4vw, 26px); padding-bottom: clamp(14px, 1.4vw, 26px); }
.top-logo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
/* TubeScience people: the orange tools get their own line above, so the logo row is only TUBESCIENCE + the logo, dead centre. */
.top-logo.has-tools { row-gap: 10px; }
.top-logo.has-tools .tools { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
.top-logo.has-tools .mark { grid-column: 1; grid-row: 2; }
.top-logo.has-tools .brand-logo { grid-column: 2; grid-row: 2; }
.brand-logo { margin: 0; line-height: 0; }
.brand-logo img { display: block; max-width: min(50vw, 520px); max-height: 12vh; width: auto; object-fit: contain; }
.reel-big { margin-top: clamp(14px, 2vh, 30px); }
/* Bigger labels may use a quarter of the gap on each side (neighbours always keep 8px between them); public/static/reel.js shrinks them all together if a word wouldn't fit, and a word wider than its clip wraps rather than being cut off. */
.reel-big .arch { font-size: var(--arch-fs, clamp(12px, 1vw, 19px)); margin-left: -4px; margin-right: -4px; overflow-wrap: anywhere; }

/* ── A group's page (/meta): one card per page inside it ───────────────── */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: clamp(16px, 1.6vw, 28px); margin-top: clamp(26px, 3vw, 52px); }
.hub-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; outline-offset: 4px; }
.hub-still { display: block; aspect-ratio: 9 / 16; max-height: 52vh; border-radius: 8px; overflow: hidden; background: #dfe4ea;
  box-shadow: 0 0 0 5px var(--frame), 0 3px 14px 5px rgba(20, 30, 50, .16); margin-bottom: 10px; transition: transform .18s; }
.hub-still img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hub-card:hover .hub-still, .hub-card:focus-visible .hub-still { transform: translateY(-3px); }
.hub-name { font-weight: 700; font-size: clamp(16px, 1.3vw, 22px); }
.hub-count { color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .row { display: grid; grid-template-columns: 1fr 1fr; width: 100% !important; gap: 22px 12px; }
  .arch-above { min-height: 0; }
  /* Phones: the logo gets its own line under TUBESCIENCE and the tools, so the bar never runs off the screen. */
  .top-logo { grid-template-columns: auto 1fr; row-gap: 12px; }
  .top-logo .brand-logo { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .top-logo.has-tools .mark { grid-column: 1 / -1; grid-row: 2; }
  .top-logo.has-tools .brand-logo { grid-column: 1 / -1; grid-row: 3; }
  .brand-logo img { max-width: 80vw; }
}

/* ── TubeScience-only tools ───────────────────────────────────────────── */
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn { font: 600 13px/1 var(--font); color: var(--ink); background: transparent; border: 1.5px solid var(--ink); border-radius: 999px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: rgba(0, 0, 0, .05); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #2a2a33; }
.btn-ghost { border-color: transparent; }
.btn-lg { font-size: 15px; padding: 14px 24px; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
:root { --ts: #e8590c; }
/* TubeScience-only controls on a page: orange, with a "TS-visible only" note (Michelle, 2026-10-15). Never sent to viewers. */
.ts-only { font: 700 12px/1 var(--font); color: var(--ts); letter-spacing: .02em; white-space: nowrap; margin-right: 4px; }
.tools-ts .btn { color: var(--ts); border-color: var(--ts); }
.tools-ts .btn:hover { background: rgba(232, 89, 12, .08); }
.tools-ts .btn-dark { background: var(--ts); color: #fff; }
.tools-ts .btn-dark:hover { background: #c94d0a; }
.tools-ts .btn-ghost { border-color: transparent; }
.chip { font: 700 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; background: #e7ebff; color: var(--accent); padding: 6px 9px; border-radius: 6px; }
.link-btn { background: none; border: 0; color: var(--accent); font: 600 13px var(--font); cursor: pointer; padding: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #111; color: #fff; font: 500 14px/1.4 var(--font);
  padding: 12px 18px; border-radius: 12px; max-width: min(92vw, 640px); opacity: 0; pointer-events: none; transition: .2s; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.toast.on { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.toast a { color: #9fb0ff; word-break: break-all; }
.toast button { margin-left: 10px; }
.err { background: #fdecea; color: var(--danger); border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: 14px; line-height: 1.45; }
.panel-card form { margin-top: 22px; }

/* ── Edit panel (editors) ─────────────────────────────────────────────── */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; z-index: 40; box-shadow: -10px 0 40px rgba(0,0,0,.35);
  transform: translateX(105%); transition: transform .22s; display: flex; flex-direction: column; font-size: 14px; }
.drawer.on { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer header h2 { font-size: 17px; margin: 0; }
.drawer .body { overflow: auto; padding: 18px 22px 30px; flex: 1; }
.drawer footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.field { margin-bottom: 18px; }
.field > label, .field > .lbl { display: block; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.drawer input[type=text], .drawer input[type=url], .drawer textarea, .inline-form input, .inline-form select {
  width: 100%; font: 500 14px/1.4 var(--font); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--ink); }
.drawer textarea { min-height: 70px; resize: vertical; }
.check { display: flex; gap: 9px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.ads-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ads-list li { display: grid; grid-template-columns: 26px 46px 1fr auto; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; padding: 7px; }
.ads-list .num { font-weight: 700; color: var(--muted); text-align: center; font-size: 12px; }
.ads-list .thumb { width: 46px; height: 58px; border-radius: 6px; object-fit: cover; background: #e5e9ee; }
.ads-list .t { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.ads-list .t b { color: var(--ink); }
.ads-list input { padding: 6px 8px !important; font-size: 13px !important; text-transform: uppercase; }
.ads-list .acts { display: flex; flex-direction: column; gap: 2px; }
.ads-list .acts button { background: none; border: 0; cursor: pointer; font-size: 14px; padding: 3px 6px; border-radius: 6px; color: var(--muted); }
.ads-list .acts button:hover { background: #eef1f5; color: var(--ink); }
.ads-list .row-sep { grid-column: 1 / -1; }
.sep { font: 700 11px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 2px; }
.add-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.add-row input { flex: 1; min-width: 180px; }
.pending { color: var(--muted); font-size: 13px; margin-top: 8px; }
.form-msg { font-size: 13px; color: var(--danger); }
.form-msg.ok { color: #067647; }

/* ── Home ─────────────────────────────────────────────────────────────── */
.card-sec { margin-top: 30px; }
.card-sec h2 { font-size: 18px; margin: 0 0 12px; }
table.pages { width: 100%; border-collapse: collapse; font-size: 14px; }
table.pages th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--line); }
table.pages td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.pages a { color: var(--ink); font-weight: 700; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 200px; }
.ed-list { list-style: none; padding: 0; margin: 0 0 12px; }
.ed-list li { display: flex; gap: 14px; align-items: center; padding: 6px 0; font-weight: 600; }
/* The page list's orange Edit link (opens /<page>/edit, the page with the TS-only tools). */
table.pages a.edit-link { color: var(--ts); }
@media (max-width: 760px) { table.pages th:nth-child(3), table.pages td:nth-child(3), table.pages th:nth-child(6), table.pages td:nth-child(6) { display: none; } }

/* ── Full-ad tab ──────────────────────────────────────────────────────── */
body.watch { background: #000; color: #fff; min-height: 100vh; display: flex; flex-direction: column; }
.watch-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; gap: 16px; }
.watch-stage { flex: 1; display: grid; place-items: center; padding: 0 16px 16px; position: relative; }
.watch-col { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; }
.watch-media { position: relative; max-width: 100%; }
.watch-media .soundbtn { top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
/* The concept type sits right above the ad, big enough to read at a glance. */
.watch-label { font-weight: 700; font-size: clamp(18px, 1.8vw, 28px); line-height: 1.2; letter-spacing: .03em; color: #f6fafd; text-align: center; text-transform: uppercase; max-width: 90vw; }
.watch-stage .full { max-width: 100%; max-height: calc(100vh - 80px); display: block; border-radius: 8px; background: #111; }
.watch-col .watch-label + .watch-media .full { max-height: calc(100vh - 160px); }
.soundbtn { position: absolute; font: 700 16px var(--font); padding: 14px 22px; border-radius: 999px; border: 0; cursor: pointer; background: #fff; color: #000; }
