/* Fynega brand tokens - see brand/BRAND.md */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(/static/fonts/Inter-Regular.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(/static/fonts/Inter-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url(/static/fonts/Inter-Bold.woff2) format("woff2"); }
:root {
  --bg: #F7F6F2; --panel: #FFFFFF; --ink: #13201B; --muted: #5E6B65; --line: #E2E4DF;
  --accent: #0B7A5C; --accent-ink: #FFFFFF; --accent-soft: #E3F1EB; --ember: #E8503A;
  --ok: #0B7A5C; --warn: #B7791F; --err: #C4352A; --info: #2B6CB0;
  --radius: 12px; --shadow: 0 1px 2px rgba(19,32,27,.05), 0 6px 20px rgba(19,32,27,.05);
  --logo: url(/static/brand/fynega-logo.svg);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0E1613; --panel: #15201C; --ink: #E9EFEC; --muted: #93A39C; --line: #26332E;
          --accent: #3FBF93; --accent-ink: #0E1613; --accent-soft: #17352B; --shadow: none;
          --logo: url(/static/brand/fynega-logo-reverse.svg); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 28px; margin: 0; letter-spacing: -.025em; font-weight: 700; } h2 { font-size: 18px; margin: 0 0 8px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 10px; }
h3:first-child { margin-top: 0; }
.muted { color: var(--muted); } .center { text-align: center; }
code { background: var(--line); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.top { display: flex; align-items: center; gap: 28px; padding: 12px 24px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.logo { display: block; width: 117px; height: 32px; background: var(--logo) left center / contain no-repeat; }
.logo.big { width: 205px; height: 56px; margin: 0 auto 6px; }
.logo span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tagline { text-align: center; color: var(--muted); margin: 0 0 22px; }
.gloss { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
.gloss em { color: var(--ink); font-style: normal; font-weight: 600; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; }
.top nav a.on, .top nav a:hover { color: var(--ink); background: var(--accent-soft); text-decoration: none; }
.logout { display: flex; align-items: center; gap: 12px; margin: 0; }
.optbox img, .noimg { max-height: 140px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
.narrow { max-width: 420px; margin: 0 auto; padding: 10vh 16px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); }
.card.empty { text-align: center; color: var(--muted); padding: 40px; }
.auth h1 { margin-bottom: 18px; text-align: center; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .top { flex-wrap: wrap; gap: 10px; } }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 14px; }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; font: inherit;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=color] { height: 40px; padding: 3px; }
textarea { resize: vertical; line-height: 1.55; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { width: auto; margin: 3px 0 0; }
fieldset { border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px 2px; margin: 0 0 14px; }
legend { font-size: 12px; color: var(--muted); padding: 0 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--err); }
.btn.wide { width: 100%; margin-top: 6px; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
button.link.danger { color: var(--err); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.actions form { margin: 0; }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; background: var(--accent-soft); color: var(--ink); }
.flash.err { background: #FBE7E3; color: #7A1E14; }
@media (prefers-color-scheme: dark) { .flash.err { background: #3A1A15; color: #F6C9C1; } }
pre.err { white-space: pre-wrap; font-size: 12px; max-height: 320px; overflow: auto; margin: 8px 0 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  color: var(--ink); display: block; box-shadow: var(--shadow); }
a.tile:hover { text-decoration: none; border-color: var(--muted); }
.thumb { position: relative; aspect-ratio: 16/9; background: #2a2825; display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.meta form { margin: 4px 0 0; }

.badge { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 3px 8px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; }
.head .badge { position: static; }
.badge.done { background: var(--ok); } .badge.processing { background: var(--ember); }
.badge.queued { background: var(--warn); } .badge.failed { background: var(--err); }
.badge.cancelled { background: #555; }
.pill { font-size: 11px; background: var(--line); padding: 1px 7px; border-radius: 99px; }

.player { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; display: block; }
.progress-box { padding: 30px 6px; text-align: center; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.bar div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--ember)); transition: width .6s ease; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
dt { color: var(--muted); } dd { margin: 0; }
.script { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 12px; font-size: 14px;
  max-height: 280px; overflow: auto; }

.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.opt { margin: 0; } .opt input { position: absolute; opacity: 0; width: 1px; }
.optbox { display: block; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer;
  font-weight: 600; font-size: 12px; }
.optbox img, .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; background: #2a2825; }
.optbox span { display: block; padding: 6px 8px; } .optbox small { display: block; color: var(--muted); font-weight: 400; }
.opt input:checked + .optbox { border-color: var(--accent); }
.opt input:focus-visible + .optbox { outline: 2px solid var(--accent); outline-offset: 2px; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--panel); }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list form { margin: 0; }
section > table.list { border: 1px solid var(--line); border-radius: var(--radius); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; background: #999; }
.status-dot.on { background: var(--ok); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat strong { display: block; font-size: 28px; }
.steps ol { margin: 0; padding-left: 20px; } .steps li { margin: 6px 0; }
.steps li.done { color: var(--muted); text-decoration: line-through; }
section + section { margin-top: 0; }
.split > section > .card + .card { margin-top: 16px; }

/* usage meter, account, legal */
.usage { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 24px; font-size: 14px; }
.usage span { flex: 0 1 auto; }
.meter { flex: 1; min-width: 120px; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter div { height: 100%; background: var(--accent); border-radius: 99px; }
.meter.big { height: 12px; margin: 12px 0 8px; }
.plan-now { font-size: 18px; margin: 0; } .plan-now strong { font-size: 24px; margin-right: 10px; }
.plans-table td:first-child { color: var(--muted); }
.small { font-size: 13px; }
form.inline { margin: 0; } form.inline select { margin: 0; padding: 5px 8px; width: auto; }
.logout a { color: var(--ink); font-weight: 600; }
.prose-wrap { max-width: 720px; margin: 0 auto; padding: 40px 24px 80px; }
.prose h1 { margin-bottom: 8px; } .prose h2 { margin-top: 32px; font-size: 20px; }
.prose p { line-height: 1.65; }
.draft { display: inline-block; background: #FBE7E3; color: #7A1E14; padding: 4px 10px; border-radius: 6px; font-size: 13px; }

.thumb.face img { object-position: center 25%; }
.noimg img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }

h2.sec { font-size: 17px; margin: 0 0 12px; }
section > h2.sec:not(:first-child) { margin-top: 32px; }
.sec-note { margin: -6px 0 14px; font-size: 14px; max-width: 60ch; }
.optbox .noimg { padding: 0; }
.pick { max-height: 440px; overflow-y: auto; padding: 2px; }

/* footer, legal pages */
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; }
.foot-inner { max-width: 1168px; margin: 0 auto; padding: 28px 24px 40px; display: flex; align-items: center;
  gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.neallus { display: block; flex: none; border-radius: 6px; }
.neallus img { display: block; width: 100px; height: auto; }
.foot-legal { margin: 0; flex: 1; min-width: 260px; line-height: 1.5; }
.foot-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.foot-copy { display: inline-block; margin-left: 4px; }
.site-foot nav { display: flex; gap: 18px; }
.site-foot nav a { color: var(--muted); }
.site-foot nav a:hover { color: var(--ink); }
.welsh { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 -24px; }

.legal-wrap { max-width: 1168px; margin: 0 auto; padding: 0 24px 40px; }
.legal-top { display: flex; align-items: center; gap: 24px; padding: 20px 0; }
.legal-top .logo { width: 132px; height: 36px; }
.legal-top nav { display: flex; gap: 20px; margin-left: auto; font-weight: 600; font-size: 14px; }
.legal-top nav a { color: var(--ink); } .legal-top nav a.on { color: var(--accent); }
.legal { max-width: 720px; margin: 24px auto 0; }
.legal h1 { font-size: 40px; letter-spacing: -.03em; margin: 16px 0 6px; }
.legal .updated { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.legal .lead { font-size: 17px; line-height: 1.65; }
.legal h2 { font-size: 21px; letter-spacing: -.015em; margin: 40px 0 10px; scroll-margin-top: 80px; }
.legal p, .legal li, .legal dd { line-height: 1.7; }
.legal ul { padding-left: 20px; } .legal li { margin: 6px 0; }
.legal .toc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px; margin: 28px 0; }
.legal .toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; font-size: 14px; }
.legal .toc li { margin: 3px 0; break-inside: avoid; }
.legal .summary { background: var(--accent-soft); border-radius: var(--radius); padding: 4px 22px 10px; margin: 24px 0; }
.legal .summary h2 { margin-top: 16px; font-size: 17px; }
.legal dl.defs { display: block; } .legal dl.defs dt { font-weight: 700; color: var(--ink); margin-top: 14px; }
.legal dl.defs dd { margin: 2px 0 0; }
.danger-zone { border-color: #E9B8B0; }
@media (max-width: 640px) { .legal .toc ol { columns: 1; } .legal h1 { font-size: 32px; } .legal-top nav { gap: 14px; } }
.legal-top nav a { white-space: nowrap; }
@media (max-width: 640px) { .legal-top nav a:not(:last-child) { display: none; } .legal-top .logo { width: 116px; height: 32px; } }
