/* GENUINE delivery portal. Swap these tokens for official brand colors/fonts. */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --ink: #1d1b19;
  --muted: #6b655e;
  --line: #e3ded6;
  --accent: #1d1b19;
  --accent-ink: #ffffff;
  --ok: #2f6b3f;
  --ok-bg: #e5f0e7;
  --warn: #8a5a00;
  --warn-bg: #fbf0d9;
  --error: #a3261c;
  --error-bg: #fbe6e3;
  --radius: 10px;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412; --surface: #1f1d1a; --ink: #f1ede7; --muted: #a39b91; --line: #34302b;
    --accent: #f1ede7; --accent-ink: #151412;
    --ok: #8fcf9d; --ok-bg: #1f3325; --warn: #e8bf6a; --warn-bg: #3a2e16; --error: #f0978d; --error-bg: #3d1f1b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.big { font-size: 20px; letter-spacing: 0.04em; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1180px; }
main.wrap { padding-top: 28px; padding-bottom: 64px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { font-weight: 700; letter-spacing: 0.22em; text-decoration: none; font-size: 15px; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head h2 { margin: 0; }
section { margin: 32px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.center { text-align: center; }
.inline { display: inline; margin: 0; }
form.inline.nav { display: flex; gap: 14px; }
.error { color: var(--error); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card.narrow { max-width: 440px; margin: 48px auto; }
.callout { border-color: var(--warn); background: var(--warn-bg); margin-bottom: 16px; }
.linkbox { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.linkbox a { word-break: break-all; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }
.flash { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--error-bg); color: var(--error); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 7px; padding: 10px 16px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { opacity: 0.88; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn-meta { font-weight: 400; opacity: 0.7; font-size: 0.9em; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
button.link.danger { color: var(--error); }

.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.form label .muted { font-weight: 400; }
input, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
input:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.check { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 400 !important; font-size: 13px !important; margin: 0 !important; color: var(--muted); }
.check input { width: auto; margin: 0; }
input.filter { max-width: 320px; margin: 0 0 16px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.error { background: var(--error-bg); color: var(--error); }
.badge.muted { color: var(--muted); }

table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list th, .list td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.list tr:last-child td { border-bottom: 0; }
.list .num { text-align: right; font-variant-numeric: tabular-nums; }
.list td a { text-decoration: none; font-weight: 600; }
@media (max-width: 720px) {
  table.list { display: block; overflow-x: auto; }
}
details summary { cursor: pointer; color: var(--muted); margin-bottom: 12px; }
.archive { margin-top: 24px; }

.folders { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.folders li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.folders li:last-child { border-bottom: 0; }
.folder-name::before { content: "▸ "; color: var(--muted); }
.publish { display: inline-flex; gap: 14px; align-items: center; }

/* Client gallery */
.client-head { margin-bottom: 24px; }
.batch { margin: 36px 0; }
.batch-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.batch-head h2 { margin: 0 0 2px; font-size: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
@media (max-width: 480px) { .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.tile { position: relative; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.thumb { text-decoration: none; position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--line); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ficon { font-weight: 700; letter-spacing: 0.12em; color: var(--muted); font-size: 14px; }
.play { position: absolute; width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,0.55); }
.play::after { content: ""; position: absolute; left: 18px; top: 14px; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.thumb:hover .play { background: rgba(0,0,0,0.75); }
figcaption { padding: 10px 44px 12px 12px; }
.fname { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmeta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl { position: absolute; right: 8px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; border: 1px solid var(--line); font-weight: 700; }
.dl:hover { background: var(--ink); color: var(--bg); }

dialog.viewer { width: min(1100px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: var(--radius); background: #000; color: #fff; }
dialog.viewer::backdrop { background: rgba(0,0,0,0.8); }
.viewer-body { display: flex; justify-content: center; align-items: center; background: #000; }
.viewer-body video, .viewer-body img { max-width: 100%; max-height: 80vh; display: block; }
.viewer-body iframe { width: 100%; height: 80vh; border: 0; background: #fff; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: #111; }
.viewer-bar .btn { background: #fff; color: #000; border-color: #fff; }
.viewer .close { position: absolute; right: 10px; top: 8px; z-index: 2; background: rgba(0,0,0,0.6); color: #fff; border: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; cursor: pointer; }
