/* Visual system matched to yt-creator.com (YT.DATA): heavy uppercase type,
   thick structural borders, square corners, tiny wide-tracked labels. */
:root {
  --bg: #ffffff;
  --panel: #f9fafb;
  --panel-2: #f9fafb;
  --panel-hover: #f3f4f6;
  --line: #e5e7eb;        /* 4px structural rules */
  --line-soft: #d1d5db;   /* 1px card outlines */
  --text: #0a0a0a;
  --muted: #4b5563;
  --dim: #6b7280;
  --faint: #d1d5db;       /* {brace} words */
  --placeholder: #9ca3af;
  --strong: #000000;      /* tag outlines, primary buttons, active pill */
  --on-strong: #ffffff;
  --toggle-bg: #f3f4f6;
  --frame: #f3f4f6;       /* media tile background */
  --accent: #eab308;      /* status dot yellow */
  --accent-text: #a16207;
  --danger: #dc2626;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23111111' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
/* The media viewer stays dark: photos and video read best on black. */
dialog.viewer {
  --bg: #0a0a0a;
  --panel: #111111;
  --panel-2: #0f0f0f;
  --panel-hover: #161616;
  --line: #222222;
  --line-soft: #333333;
  --text: #f4f4f4;
  --muted: #9ca3af;
  --dim: #6b7280;
  --faint: #444444;
  --placeholder: #444444;
  --strong: #ffffff;
  --on-strong: #000000;
  --toggle-bg: transparent;
  --frame: #000000;
  --accent-text: #eab308;
  --danger: #f87171;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23f4f4f4' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 900; text-transform: uppercase; letter-spacing: -0.05em; line-height: .9; }
h1 { font-size: clamp(44px, 7vw, 88px); }
h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.04em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono, .num { font-variant-numeric: tabular-nums; }
.brace { color: var(--faint); }

/* tiny wide labels, e.g. "● WEEKLY INTELLIGENCE REPORT" */
.eyebrow, .label, label, th {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; color: var(--muted);
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.eyebrow.accent::before { background: var(--accent); }

/* outlined tag, e.g. "DATA LOG" */
.tag {
  display: inline-block; border: 2px solid var(--strong); color: var(--strong);
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .15em;
  padding: 4px 8px; line-height: 1;
}
.tag.dim { border-color: var(--line-soft); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .15em; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--strong); }
.status.pending::before { background: var(--accent); }
.status.warn { color: var(--accent-text); }

/* ---------- header (matches YT.DATA top bar) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 20px 32px; background: var(--bg); border-bottom: 4px solid var(--line);
}
.logo {
  font-size: 22px; font-weight: 800; text-transform: none; letter-spacing: -0.05em;
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.logo .plus { font-weight: 400; font-size: 26px; line-height: 1; }
.site-header .spacer { flex: 1; }
.admin-nav { display: flex; gap: 22px; margin-left: 12px; }
.admin-nav a { text-decoration: none; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .2em; color: var(--dim); padding: 6px 0; border-bottom: 2px solid transparent; }
.admin-nav a:hover { color: var(--text); }
.admin-nav a.active { color: var(--text); border-bottom-color: var(--strong); }

/* pill group in YT.DATA's DARK | LIGHT switch style (used for media library tabs) */
.pill-nav { display: inline-flex; padding: 4px; border: 1px solid var(--line-soft); background: var(--toggle-bg); border-radius: 999px; gap: 2px; }
.pill-nav a, .pill-nav button {
  text-decoration: none; padding: 7px 18px; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
  font: 700 10px var(--sans); text-transform: uppercase; letter-spacing: .2em; color: var(--dim);
}
.pill-nav a:hover, .pill-nav button:hover { color: var(--text); }
.pill-nav a.active, .pill-nav button[aria-pressed="true"] { background: var(--strong); color: var(--on-strong); box-shadow: 0 1px 2px rgba(0,0,0,.08); }


/* ---------- controls ---------- */
label { display: block; margin-bottom: 10px; }
.hint { color: var(--dim); letter-spacing: .15em; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=search], .feed-builder input[type=number], select {
  width: 100%;
  font: 700 14px var(--sans);
  letter-spacing: .04em;
  color: var(--text);
  background: var(--bg);
  border: 4px solid var(--line);
  border-radius: 0;
  padding: 14px 16px;
  outline: none;
  transition: border-color .15s;
}
input::placeholder { color: var(--placeholder); }
input:focus, select:focus { border-color: var(--strong); }
input.invalid { border-color: var(--danger); }
select { appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--bg) var(--select-arrow) no-repeat right 16px center;
  font-size: 11px; text-transform: uppercase; letter-spacing: .15em; }
.field-error { color: var(--danger); font-size: 12px; font-weight: 600; margin-top: 8px; }
.field-error:empty { display: none; }
.feed-builder { display: grid; gap: 18px; }
.feed-builder .drive-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 800 11px/1 var(--sans); text-transform: uppercase; letter-spacing: .2em;
  padding: 16px 26px; border: 2px solid var(--strong); border-radius: 0;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s, opacity .15s;
}
.btn-primary { background: var(--strong); color: var(--on-strong); }
.btn-primary:hover { background: transparent; color: var(--strong); }
.btn-primary:disabled { opacity: .3; cursor: not-allowed; background: var(--strong); color: var(--on-strong); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-soft); }
.btn-ghost:hover { border-color: var(--strong); }
.btn-small { padding: 10px 14px; font-size: 10px; }
.btn-block { width: 100%; }

.alert { border: 2px solid var(--danger); color: var(--danger); padding: 12px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }

/* ---------- gate (split hero, like the YT.DATA homepage) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 80px); }
.split-left { padding: 64px 48px; display: flex; flex-direction: column; justify-content: center; gap: 28px; border-right: 4px solid var(--line); }
.split-left p { color: var(--muted); max-width: 440px; font-size: 16px; }
.split-right { background: var(--panel); display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.gate { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.gate .tag { justify-self: start; margin-bottom: 8px; }
.gate input { font-size: 22px; letter-spacing: .4em; text-align: center; padding: 18px; }

/* ---------- creator upload page ---------- */
.page-hero { padding: 56px 32px 40px; border-bottom: 4px solid var(--line); display: grid; gap: 22px; }
.page-hero p { color: var(--muted); max-width: 560px; font-size: 16px; }
.block { border-bottom: 4px solid var(--line); display: grid; grid-template-columns: 280px 1fr; }
.block-head { padding: 32px; border-right: 4px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.block-head .tag { align-self: flex-start; }
.block-head .idx { font-size: 56px; font-weight: 900; letter-spacing: -0.06em; line-height: .8; color: var(--faint); }
.block-head p { color: var(--dim); font-size: 13px; }
.block-body { padding: 32px; background: var(--panel); }
.fields { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
.fields .full { grid-column: 1 / -1; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.field-head > label { margin: 0; }

/* Instagram | TikTok slider switch */
.platform-switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr;
  padding: 4px; border: 1px solid var(--line-soft); background: var(--toggle-bg); border-radius: 999px;
}
.platform-switch input { position: absolute; opacity: 0; pointer-events: none; }
.platform-switch label {
  position: relative; z-index: 1; margin: 0; cursor: pointer; text-align: center;
  padding: 8px 18px; border-radius: 999px; color: var(--dim); transition: color .2s;
  letter-spacing: .18em;
}
.platform-switch label:hover { color: var(--text); }
.platform-switch input:checked + label { color: var(--on-strong); }
.platform-switch .thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  background: var(--strong); border-radius: 999px; transition: transform .25s cubic-bezier(.3,.7,.2,1);
}
.platform-switch input:nth-of-type(2):checked ~ .thumb { transform: translateX(100%); }
.platform-switch input:focus-visible ~ .thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.platform-switch input:disabled + label { cursor: not-allowed; }

.ig-input { position: relative; }
.ig-input span { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--dim); font-weight: 800; }
.ig-input input { padding-left: 38px; }

.dropzone {
  border: 2px dashed var(--line-soft); padding: 44px 20px; text-align: center; cursor: pointer;
  background: var(--panel-2); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--strong); outline: none; }
.dropzone.dragging { border-color: var(--strong); background: var(--panel-hover); }
.dropzone svg { color: var(--strong); margin-bottom: 14px; }
.dropzone strong { display: block; font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: -0.03em; margin-bottom: 8px; }
.dropzone .muted { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--dim); }

.file-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.file-list:empty { display: none; }
.file-item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center;
  border-bottom: 1px solid var(--line-soft); padding: 12px 0;
}
.file-thumb { width: 48px; height: 48px; background: var(--panel-hover); border: 1px solid var(--line-soft); overflow: hidden; display: grid; place-items: center; color: var(--dim); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--dim); margin-top: 3px; }
.file-item.error .file-meta, .file-item.invalid .file-meta { color: var(--danger); }
.file-item.done .file-meta { color: var(--text); }
.file-item.uploading .file-meta { color: var(--accent-text); }
.progress { height: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--strong); transition: width .2s; }
.file-item:not(.uploading) .progress { display: none; }
.remove-btn { border: 2px solid var(--line-soft); background: none; color: var(--muted); cursor: pointer; width: 32px; height: 32px; font-size: 16px; line-height: 1; }
.remove-btn:hover { border-color: var(--strong); color: var(--strong); }

.submit-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-top: 26px; flex-wrap: wrap; }
#form-message { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--accent-text); }

.success { padding: 80px 32px; display: grid; gap: 22px; justify-items: start; border-bottom: 4px solid var(--line); }
.success p { color: var(--muted); font-size: 16px; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; min-height: 0; }
  .split-left { border-right: 0; border-bottom: 4px solid var(--line); padding: 40px 20px; }
  .split-right { padding: 40px 20px; }
  .block { grid-template-columns: 1fr; }
  .block-head { border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 24px 20px; flex-direction: row; align-items: center; }
  .block-head .idx { font-size: 36px; }
  .block-head p { display: none; }
  .block-body { padding: 24px 20px; }
  .fields { grid-template-columns: 1fr; }
  .page-hero { padding: 40px 20px 32px; }
  .site-header { padding: 14px 20px; gap: 10px; flex-wrap: wrap; }
  .pill-nav a, .pill-nav button { padding: 6px 12px; }
  .admin-nav { order: 5; width: 100%; margin: 4px 0 0; }
  .success { padding: 56px 20px; }
}

/* ---------- admin ---------- */
.admin-main { padding: 0 0 80px; }
.admin-head { padding: 40px 32px 32px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 4px solid var(--line); }
.admin-head > div:first-child { display: grid; gap: 16px; }
.admin-head h1 { font-size: clamp(40px, 5vw, 64px); }
.admin-head .back { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; color: var(--dim); text-decoration: none; }
.admin-head .back:hover { color: var(--text); }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 4px solid var(--line); }
.stat { padding: 24px 32px; border-right: 1px solid var(--line-soft); display: grid; gap: 10px; }
.stat:last-child { border-right: 0; }
.stat .value { font-size: 44px; font-weight: 900; letter-spacing: -0.05em; line-height: .9; }
.stat .sub { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--dim); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 20px 32px; border-bottom: 1px solid var(--line-soft); }
.toolbar input[type=search] { max-width: 340px; padding: 12px 14px; font-size: 12px; }
.toolbar select { width: auto; padding: 12px 40px 12px 14px; border-width: 4px; }
.toolbar select[name="product"] { width: 280px; max-width: 100%; }
.product-filter-note { padding: 0 32px 14px; margin: 0; }
.toolbar .spacer { flex: 1; }
.toolbar .count { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; color: var(--dim); }
.toolbar a { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
th { color: var(--dim); background: var(--panel-2); }
th:first-child, td:first-child { padding-left: 32px; }
th:last-child, td:last-child { padding-right: 32px; }
tbody tr:hover { background: var(--panel); }
td.num, th.num { text-align: right; }
td.num { font-weight: 800; font-size: 16px; }
td.dimmed { color: var(--dim); }
.creator-cell { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--panel-hover); border: 1px solid var(--line-soft); display: block;
}
.avatar.lg { width: 84px; height: 84px; border-width: 2px; }
.platform-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .15em; color: var(--dim);
}
.platform-badge svg { width: 13px; height: 13px; }
.creator-title { display: flex; align-items: center; gap: 22px; }
.creator-title > div { display: grid; gap: 10px; }
.handle { font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; text-decoration: none; font-size: 15px; }
.handle:hover { text-decoration: underline; text-underline-offset: 4px; }
.ext-link { color: var(--dim); text-decoration: none; font-size: 12px; margin-left: 6px; }
.ext-link:hover { color: var(--strong); }
.empty { padding: 72px 32px; color: var(--dim); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; }

.profile { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 4px solid var(--line); }
.profile > div { padding: 24px 32px; border-right: 1px solid var(--line-soft); display: grid; gap: 10px; align-content: start; }
.profile > div:last-child { border-right: 0; }
.profile .value { font-weight: 700; font-size: 15px; word-break: break-word; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 32px; border-bottom: 1px solid var(--line-soft); background: var(--panel-2); }
.section-title h2 { font-size: 22px; }
.section-body { border-bottom: 4px solid var(--line); }
.section-body.pad { padding: 24px 32px; }

/* media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
.section-body .media-grid, .grid-wrap .media-grid { border-top: 0; }
.grid-wrap { padding: 0; border-bottom: 4px solid var(--line); }
.tile {
  position: relative; display: block; border: 0; padding: 0; text-align: left; cursor: pointer;
  background: var(--panel); font: inherit; color: inherit;
  border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  outline-offset: -2px;
}
.tile:hover { outline: 2px solid var(--strong); }
.tile-products { font-size: 11px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.media-card .tile { width: 100%; }
.media-card-actions { padding: 10px 14px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.media-card-actions { display: grid; gap: 10px; align-content: start; }
.ai-complete { color: #166534; font-weight: 900; font-size: 20px; }
.review-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-size: 12px; font-weight: 700; }
.review-label input, input[data-ai-select], #analysis-select-all { width: 18px; height: 18px; accent-color: #166534; flex-shrink: 0; }
.human-review-form { display: grid; gap: 5px; }
.review-save-status { font-size: 11px; color: var(--muted); }
.viewer-top .ai-complete { color: #86efac; }
.info-transcript { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.tile .frame { aspect-ratio: 4 / 5; background: var(--frame); display: grid; place-items: center; overflow: hidden; }
.tile .frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.tile:hover .frame img { transform: scale(1.03); }
.tile .frame .placeholder { color: var(--dim); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; text-align: center; padding: 10px; }
.tile .badge {
  position: absolute; top: 10px; left: 10px; background: #000; color: #fff; border: 2px solid #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .1em; padding: 4px 7px; line-height: 1;
}
.tile .dup { left: auto; right: 10px; background: var(--accent); color: #000; border-color: var(--accent); text-transform: uppercase; }
.tile .caption { padding: 12px 14px 14px; display: grid; gap: 4px; }
.tile .caption .who { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .caption .when { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lib-section-head { display: flex; align-items: center; gap: 14px; padding: 22px 32px; border-bottom: 1px solid var(--line-soft); background: var(--panel-2); }
.lib-section-head h2 { font-size: 26px; }
.lib-section-head .spacer { flex: 1; }
.lib-section-head a.more { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .2em; color: var(--text); text-decoration: none; border-bottom: 2px solid var(--strong); padding-bottom: 3px; }
.lib-tabs { display: inline-flex; }
.lib-tabs .n { opacity: .6; margin-left: 6px; }

.stats.stats-4 { grid-template-columns: repeat(4, 1fr); }
.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 32px; border-bottom: 1px solid var(--line-soft); font-size: 14px; font-weight: 600;
}
.notice.ok { background: #f0fdf4; color: #166534; }
.notice.err { background: #fef2f2; color: var(--danger); }
.notice form { margin: 0; }
.drive-step { display: grid; gap: 14px; align-content: start; }
.drive-step .big { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.drive-step .big a { text-decoration: none; }
.drive-step .big a:hover { text-decoration: underline; text-underline-offset: 4px; }
.drive-step code, .setup-help code { font: 12px var(--mono); background: var(--panel-hover); padding: 2px 6px; word-break: break-all; }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 240px; }
.auto-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.save-all-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.save-all-row form { margin: 0; }
td.wrap { white-space: normal; min-width: 260px; color: var(--danger); font-size: 13px; }
.setup-help { border-bottom: 4px solid var(--line); }
.setup-help summary { cursor: pointer; padding: 22px 32px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .2em; background: var(--panel-2); }
.setup-body { padding: 8px 32px 32px; max-width: 880px; display: grid; gap: 12px; font-size: 14px; color: var(--muted); }
.setup-body h3 { font-size: 16px; color: var(--text); margin-top: 12px; letter-spacing: -0.02em; line-height: 1.2; }
.setup-body ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.setup-body strong { color: var(--text); }
.drive-folders { display: flex; flex-wrap: wrap; gap: 10px; padding: 20px 32px; border-bottom: 4px solid var(--line); }
.drive-folders a { text-decoration: none; border: 1px solid var(--line-soft); padding: 10px 14px; font-weight: 800; font-size: 13px; display: inline-flex; gap: 10px; align-items: center; }
.drive-folders a:hover { border-color: var(--strong); }
.drive-folders .n { font-size: 10px; letter-spacing: .15em; color: var(--dim); text-transform: uppercase; }

.pager { display: flex; gap: 14px; justify-content: center; align-items: center; padding: 28px 20px; }
.pager .count { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; color: var(--dim); }

/* lightbox */
dialog.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; color: var(--text); }
dialog.viewer::backdrop { background: rgba(0, 0, 0, .94); }
.viewer-inner { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.viewer-top { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 4px solid var(--line); background: var(--bg); }
.viewer-top .title { flex: 1; min-width: 0; display: grid; gap: 4px; }
.viewer-top .title div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-top #viewer-title { font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; }
.viewer-top .title .meta { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--dim); }
.viewer-top a, .viewer-top button {
  color: #fff; background: transparent; border: 2px solid var(--line-soft); padding: 9px 12px;
  font: 800 10px var(--sans); text-transform: uppercase; letter-spacing: .18em; text-decoration: none; cursor: pointer;
}
.viewer-top a:hover, .viewer-top button:hover { border-color: #fff; }
.viewer-top form button { color: var(--danger); }
.viewer-top form button:hover { border-color: var(--danger); }
.viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 20px 72px; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: calc(100vh - 120px); background: #000; display: block; }
.viewer-stage .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border: 2px solid #fff; cursor: pointer; background: #000; color: #fff; font-size: 22px;
}
.viewer-stage .nav:hover { background: #fff; color: #000; }
.viewer-stage .prev { left: 14px; }
.viewer-stage .next { right: 14px; }
.viewer-note { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; text-align: center; margin-top: 14px; }

@media (max-width: 980px) {
  .stats, .stats.stats-4 { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line-soft); }
  .profile { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .admin-head, .toolbar, .section-title, .section-body.pad, .lib-section-head, .notice, .setup-help summary, .setup-body, .drive-folders { padding-left: 20px; padding-right: 20px; }
  .field-head { flex-wrap: wrap; }
  .avatar.lg { width: 60px; height: 60px; }
  .stat, .profile > div { padding: 20px; }
  .stat .value { font-size: 34px; }
  .profile { grid-template-columns: 1fr; }
  .profile > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
  th:first-child, td:first-child { padding-left: 20px; }
  .viewer-stage { padding: 12px 8px; }
  .viewer-stage .nav { display: none; }
  .viewer-top { flex-wrap: wrap; }
  .site-header .logo { font-size: 18px; }
  .pill-nav a { padding: 6px 12px; }
}

/* AI review */
.ai-intro { margin: 20px 0; max-width: 780px; }
.ai-setup { background: var(--panel); border: 2px solid var(--line); padding: 24px; display: grid; gap: 14px; }
.ai-key-form { display: grid; gap: 10px; max-width: 560px; }
.ai-key-form .btn { justify-self: start; }
.ai-counts { display: flex; flex-wrap: wrap; gap: 24px; margin: 28px 0; font-weight: 800; }
.ai-section { margin-top: 28px; margin-bottom: 12px; }
.ai-files { margin-top: 16px; }
.ai-file { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.ai-file img { width: 64px; height: 64px; object-fit: cover; }
.ai-file > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ai-file p { color: var(--muted); font-size: 12px; }
.ai-file .tag { white-space: normal; }
.ai-brief { margin-top: 30px; padding: 20px 0; }
.ai-brief p { margin-top: 14px; max-width: 850px; }
.ai-tile-status { margin: 6px 0; font-size: 11px; font-weight: 800; }
.ai-notice { border-left: 4px solid var(--accent); padding: 12px 16px; background: var(--panel); margin-bottom: 20px; }
.ai-result-layout { display: grid; grid-template-columns: minmax(220px,1fr) minmax(0,2fr); gap: 36px; margin-top: 24px; }
.ai-preview img,.ai-preview video { width: 100%; max-height: 600px; object-fit: contain; background: var(--panel); }
.ai-preview p { margin: 12px 0; overflow-wrap: anywhere; }
.media-info-layout > .ai-preview { position: sticky; top: var(--media-sticky-top,96px); align-self: start; max-height: calc(100dvh - var(--media-sticky-top,96px) - 16px); overflow-y: auto; }
.media-info-layout .media-player { background: var(--bg); }
.media-info-layout .media-player video, .media-info-layout .media-player img { display: block; max-height: max(140px,calc(100dvh - var(--media-sticky-top,96px) - 240px)); }
.source-url-box { display: grid; gap: 10px; padding: 18px; border: 2px solid var(--line); margin-bottom: 24px; }
.source-url-box label { margin: 0; }
@media(max-width:800px) {
  .media-info-layout { display: block; }
  .media-info-layout > .ai-preview { display: contents; position: static; max-height: none; overflow: visible; }
  .media-info-layout .media-player { position: sticky; top: var(--media-sticky-top,140px); z-index: 10; border-bottom: 2px solid var(--line); }
  .media-info-layout .media-player video, .media-info-layout .media-player img { max-height: 32dvh; }
  .media-info-layout > div:last-child { margin-top: 24px; }
}
.ai-detail { margin-top: 16px; }
.ai-check { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ai-check .tag { align-self: start; text-align: center; white-space: normal; }
.ai-check p { margin-top: 6px; color: var(--muted); }
.ai-missing { border-color: var(--danger); }
.ai-unclear { border-color: var(--accent); }
.ai-result-layout ul { padding-left: 22px; }
.ai-result-layout li { margin-bottom: 8px; }
@media(max-width:800px) { .ai-result-layout { grid-template-columns: 1fr; } .ai-check { grid-template-columns: 95px 1fr; } .admin-nav { flex-wrap: wrap; gap: 12px; } .site-header { flex-wrap: wrap; } }

/* Creator content and product choices */
 .product-picker { min-width: 0; }
.product-picker > p { margin-top: 8px; font-size: 13px; }
#product-select { text-transform: none; letter-spacing: normal; font-size: 14px; }
.selected-products { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.selected-product { display: inline-flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); background: var(--bg); font-size: 12px; }
.product-remove { border: 0; background: transparent; padding: 0 4px; cursor: pointer; font-size: 20px; }
select.invalid { border-color: var(--danger); }
.product-tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.product-tag-list .tag { white-space: normal; letter-spacing: .04em; text-transform: none; }


.landing-action h2 { font-size: 28px; }
.landing-action p { color: var(--muted); font-size: 15px; line-height: 1.6; }

/* Platform choice beside the username field */
.username-entry { display: flex; align-items: center; gap: 14px; }
.username-entry .ig-input { flex: 1; min-width: 0; }
.username-entry .platform-switch { flex-shrink: 0; }
@media(max-width:600px) {
  .username-entry { gap: 8px; }
  .username-entry .platform-switch label { padding: 8px 9px; font-size: 9px; letter-spacing: .08em; }
  .username-entry .ig-input input { font-size: 12px; letter-spacing: normal; }
}

/* Creator portraits and imported social profiles. */
.avatar.creator-avatar { width:200px; height:200px; min-width:200px; border-radius:8px; object-fit:cover; }
.creator-card { display:grid; grid-template-columns:200px minmax(0,1fr); gap:28px; padding:32px; border-bottom:4px solid var(--line); }
.creator-portrait { align-self:start; }
.creator-card-body { min-width:0; }
.creator-card-top { display:flex; justify-content:space-between; align-items:start; gap:16px; }
.creator-card-top h2 { font-size:26px; margin:10px 0 5px; overflow-wrap:anywhere; }
.creator-card-top .platform-badge { margin-bottom:10px; }
.creator-card-top .handle { display:block; }
.social-followers { margin-top:10px; }
.social-bio { margin:16px 0; white-space:pre-line; overflow-wrap:anywhere; line-height:1.6; max-width:85ch; }
.social-links { display:flex; gap:8px 20px; flex-wrap:wrap; margin:12px 0; }
.social-links a { font-size:13px; overflow-wrap:anywhere; text-decoration:underline; }
.creator-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px 24px; padding:18px 0; margin:0 0 12px; border-bottom:1px solid var(--line-soft); }
.creator-facts dt { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; color:var(--dim); margin-bottom:5px; }
.creator-facts dd { margin:0; font-size:13px; overflow-wrap:anywhere; }
.social-import-date { margin-top:12px; }
.social-upload-form { display:grid; gap:12px; max-width:560px; }
.social-upload-form label { font-size:12px; font-weight:800; }
.social-upload-form input, .social-upload-form select { width:100%; max-width:100%; }
.social-upload-form button { justify-self:start; margin:8px 0; }
.social-preview-bio { min-width:220px; max-width:500px; white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:800px) {
  .creator-card { padding:24px 20px; gap:20px; }
  .creator-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .creator-card-top { flex-direction:column; }
  .creator-title { flex-wrap:wrap; }
}
@media(max-width:560px) {
  .creator-card { grid-template-columns:minmax(0,1fr); }
  .creator-facts { grid-template-columns:minmax(0,1fr); gap:12px; }
}
.media-info-layout .source-url-box { margin-top:18px; padding:14px; }
.media-info-layout .source-url-box input { min-width:0; width:100%; }
#creator-video-progress { width:100%; height:16px; }

.creator-video-group-nav { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:16px; }
.creator-video-group-nav a { gap:12px; }
.creator-video-group { scroll-margin-top:110px; }
.creator-video-group .section-title h3 { font-size:22px; }
.tile-video-group { margin:8px 0; font-size:11px; font-weight:800; }
