/* Layerpop v0.5.0 - shared styles. The home page is bright ("Bright pop"); the editor stays dark. */
:root {
  /* Editor (dark) tokens. Layout: stage + timeline on the left, controls on the right */
  --bg: #0D0F14;
  --panel: #151821;
  --raised: #1D212C;
  --line: #272C39;
  --ink: #EEF0F5;
  --muted: #949BAA;
  --accent: #4C6BFF;
  --accent-ink: #FFFFFF;
  --ok: #3CCB8C;
  --cobalt: #2B4BFF;
  --coral: #FF5A4E;
  --sun: #FFC533;
  --mint: #1FC8A0;
  --paper: #F4F5F7;
  --night: #14161C;
  --display: 'Syne', 'Arial Black', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer; }
button:hover { border-color: #46506A; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.brand { text-decoration: none; font: 800 23px/1 var(--display); letter-spacing: -0.02em; }

/* ---------- Editor header ---------- */
.top { display: flex; align-items: center; gap: 18px; padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); }
.crumb { color: var(--muted); font-size: 14px; }
.crumb b { color: var(--ink); font-weight: 600; }

/* ---------- Home page (bright) ---------- */
/* Layout: centred column; hero with three tilted live previews; coloured category pills; outlined template cards */
body.home { background: var(--paper); color: var(--night); font-size: 17px; color-scheme: light; --edge: 2px solid var(--night); }
body.home :focus-visible { outline-color: var(--cobalt); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 26px; min-height: 84px; }
.nav nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; margin-left: auto; font-weight: 600; }
.nav nav a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav nav a:hover { color: var(--cobalt); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border: var(--edge); border-radius: 999px; font-weight: 700; text-decoration: none; background: #FFFFFF; color: var(--night); transition: transform .12s, box-shadow .12s; }
.btn.main { background: var(--cobalt); color: #FFFFFF; box-shadow: 4px 4px 0 var(--night); }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--night); color: var(--night); }
.btn.main:hover { color: #FFFFFF; }
.nav .btn { min-height: 46px; padding: 0 20px; box-shadow: none; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; padding: 36px 0 64px; }
.hero h1 { margin: 0; font: 800 clamp(44px, 7.4vw, 86px)/1 var(--display); letter-spacing: -0.03em; max-width: 12em; text-wrap: balance; }
.hero h1 span { display: inline-block; background: var(--sun); border: var(--edge); border-radius: 16px; padding: 0 0.18em; transform: rotate(-2deg); }
.hero p { margin: 0; font-size: clamp(17px, 1.6vw, 20px); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.trio { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; width: 100%; padding-top: 22px; }
.trio .tilt { flex: 1 1 280px; max-width: 380px; border: var(--edge); border-radius: 18px; overflow: hidden; box-shadow: 6px 6px 0 var(--night); background: var(--night); text-decoration: none; }
.trio .tilt:nth-child(1) { transform: rotate(-3deg); }
.trio .tilt:nth-child(2) { transform: translateY(18px); }
.trio .tilt:nth-child(3) { transform: rotate(3deg); }
.trio canvas, .card canvas { display: block; width: 100%; aspect-ratio: 16 / 9; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 34px 0 36px; }
.chip { min-height: 48px; padding: 0 20px; border: var(--edge); border-radius: 999px; font-weight: 700; font-size: 15px; color: var(--night); background: #FFFFFF; }
.chip span { margin-left: 8px; font-variant-numeric: tabular-nums; opacity: .75; }
.chip:hover { border-color: var(--night); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--night); }
.chip[aria-pressed=true] { background: var(--night); color: #FFFFFF; }
.chip:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; background: #FFFFFF; color: var(--night); }
.c0 { background: var(--cobalt); color: #FFFFFF; } .c1 { background: var(--sun); } .c2 { background: var(--coral); } .c3 { background: var(--mint); } .c4 { background: #FFFFFF; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; padding-bottom: 80px; }
.card { display: flex; flex-direction: column; background: #FFFFFF; border: var(--edge); border-radius: 20px; overflow: hidden; text-decoration: none; box-shadow: 6px 6px 0 var(--night); transition: transform .12s, box-shadow .12s; }
.card:hover, .card:focus-visible { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 var(--night); }
.card .shot { background: var(--night); border-bottom: var(--edge); }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px 17px; }
.card h3 { margin: 0; font: 700 18px/1.25 var(--body); }
.tag { border: var(--edge); border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.state { text-align: center; padding: 0 0 60px; margin: 0; }
.state:empty { display: none; }
.how { padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
.how h2 { margin: 0; font: 800 clamp(32px, 4vw, 46px)/1.05 var(--display); letter-spacing: -0.02em; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.step { border: var(--edge); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 8px; }
.step b { font: 800 44px/1 var(--display); }
.step h3 { margin: 0; font: 800 24px/1.1 var(--display); }
.step p { margin: 0; font-size: 16px; }
.foot { border-top: var(--edge); padding: 22px 0; font-size: 15px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .btn, .card, .chip { transition: none; } }

/* ---------- Editor ---------- */
body.editor { height: 100vh; display: flex; flex-direction: column; font-size: 14px; }
body.editor main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.left { padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stage-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#stage { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background-color: #20242E;
  background-image: linear-gradient(45deg, #2B303C 25%, transparent 25%, transparent 75%, #2B303C 75%), linear-gradient(45deg, #2B303C 25%, transparent 25%, transparent 75%, #2B303C 75%);
  background-size: 24px 24px; background-position: 0 0, 12px 12px; }
#stage.opaque { background: #000; }
#preview { display: block; width: 100%; height: 100%; }
#loadMsg { display: none; color: var(--muted); max-width: 46ch; text-align: center; }
body.editor.failed #stage, body.editor.failed .timeline, body.editor.failed aside > * { display: none; }
body.failed #loadMsg { display: block; }
body.editor:not(.ready):not(.failed) .timeline, body.editor:not(.ready):not(.failed) aside { visibility: hidden; }
.timeline { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.tl-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tl-bar button { padding: 5px 10px; font-size: 12.5px; }
.tl-bar .play { min-width: 68px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.check input { accent-color: var(--accent); }
#time { margin-left: auto; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: pre; }
.tl-track { position: relative; height: 70px; margin: 0 6px; user-select: none; touch-action: none; }
.tl-scrub { position: absolute; inset: 0 0 auto 0; height: 26px; cursor: pointer; border-bottom: 1px solid var(--line); }
#tlRuler { display: block; width: 100%; height: 26px; }
.tl-phases { position: absolute; left: 0; right: 0; top: 32px; height: 34px; }
.seg { position: absolute; top: 0; height: 100%; background: color-mix(in srgb, var(--c) 26%, #151821); border: 1px solid var(--c); border-radius: 4px; overflow: hidden; }
.seg + .seg { border-left-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.seg-name { position: absolute; left: 8px; right: 12px; top: 0; line-height: 32px; font-size: 12px; font-weight: 600; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.handle { position: absolute; right: 0; top: 0; width: 11px; height: 100%; cursor: ew-resize; background: var(--c); opacity: .9; }
.handle::after { content: ""; position: absolute; left: 4px; top: 9px; bottom: 9px; width: 3px; border-left: 1px solid #17100B; border-right: 1px solid #17100B; }
.handle:hover { opacity: 1; filter: brightness(1.2); }
.tl-end { position: absolute; top: 26px; bottom: 0; width: 0; border-left: 1px dashed #6B7684; pointer-events: none; }
.tl-head { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #fff; pointer-events: none; z-index: 3; }
.tl-head::before { content: ""; position: absolute; left: -7px; top: 0; border: 6px solid transparent; border-top: 8px solid #fff; }
.tl-fields-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.tl-fields { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.tl-field label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; margin-bottom: 3px; }
.tl-field label i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.tl-field input { width: 84px; padding: 5px 7px; }
.tl-field.total output { display: block; padding: 6px 0; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
#resetTiming { padding: 5px 10px; font-size: 12.5px; }
body.dragging, body.dragging * { cursor: ew-resize !important; }
body.busy .timeline { opacity: .5; pointer-events: none; }
aside { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 4px 18px 24px; }
aside section { padding: 16px 0; border-bottom: 1px solid var(--line); }
aside section:last-child { border-bottom: 0; }
aside h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
#fields { display: flex; flex-direction: column; gap: 10px; }
.field { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; gap: 10px; }
.field label { color: var(--muted); font-size: 13px; }
.field-table { grid-template-columns: 1fr; }
.field-color { grid-template-columns: 118px 44px 1fr; }
.hex { font-family: var(--mono); font-size: 12px; color: var(--muted); }
input[type=text], input[type=number], select, textarea { width: 100%; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
textarea { font: 12px/1.5 var(--mono); resize: vertical; white-space: pre; overflow-x: auto; }
input[type=color] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.formats button { text-align: left; padding: 9px 10px; }
.formats button b { display: block; font-weight: 600; font-size: 13px; }
.formats button span { display: block; color: var(--muted); font-size: 11.5px; }
.formats button[aria-pressed=true] { border-color: var(--accent); background: #1A2040; box-shadow: inset 0 0 0 1px var(--accent); }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.settings label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.settings [hidden] { display: none; }
.settings.three { margin: 0; }
.settings.three > :first-child { grid-column: 1 / -1; }
.primary { width: 100%; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; padding: 10px 12px; margin-top: 10px; }
.primary:hover { border-color: #AAB8FF; }
.progress { height: 4px; background: var(--bg); border-radius: 2px; margin: 14px 0 8px; overflow: hidden; }
#bar { height: 100%; width: 0; background: var(--ok); }
.statusline { display: flex; align-items: center; gap: 10px; min-height: 30px; }
#status { color: var(--muted); font-size: 12px; flex: 1; overflow-wrap: anywhere; }
#cancel { display: none; padding: 4px 10px; }
body.busy #cancel { display: inline-block; }
body.busy .primary, body.busy .formats button { opacity: .45; pointer-events: none; }
#log { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
#log li { font-family: var(--mono); font-size: 11.5px; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 4px; padding: 6px 8px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  body.editor { height: auto; }
  body.editor main { grid-template-columns: 1fr; }
  aside { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
}

/* ---------- Theme Studio (dark, same family as the editor) ---------- */
/* Layout: list of templates as a grid; one template = preview on the left, data and actions on the right */
body.studio { min-height: 100vh; font-size: 14px; }
body.studio [hidden] { display: none !important; }
body.studio label { display: block; color: var(--muted); font-size: 12px; margin: 0 0 4px; }
body.studio input[type=password] { width: 100%; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; font-family: var(--mono); }
.st-signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.st-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.st-card h1 { margin: 6px 0 0; font: 800 28px/1.1 var(--display); letter-spacing: -0.02em; }
.st-card .primary { margin-top: 6px; }
.st-msg { margin: 0; min-height: 18px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.st-msg.bad { color: #FF8A80; }
.st-msg.good { color: var(--ok); }
.st-tabs { display: flex; gap: 6px; margin-left: 12px; }
.st-tabs button[aria-pressed=true], .st-filters button[aria-pressed=true] { border-color: var(--accent); background: #1A2040; box-shadow: inset 0 0 0 1px var(--accent); }
.st-user { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.st-page { max-width: 1320px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 40px) 60px; }
.st-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.st-filters { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.st-filters button span { margin-left: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.primary.st-new { width: auto; margin: 0; padding: 8px 16px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.st-item { display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; background: var(--panel); border-radius: 8px; }
.st-item canvas { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0E1116; }
.st-item .info { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 6px; }
.st-item h3 { margin: 0; font: 600 15px/1.3 var(--body); }
.st-item .line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 12px; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); }
.pill.s-pending { color: #FFD466; border-color: #6B5519; background: #2A2310; }
.pill.s-approved { color: #6FE0B0; border-color: #1E5C45; background: #10261F; }
.pill.s-rejected { color: #FF9D94; border-color: #6E2A24; background: #2B1513; }
.st-empty { color: var(--muted); text-align: center; padding: 40px 0; margin: 0; }
.st-empty:empty { display: none; }
.st-edit { display: grid; grid-template-columns: minmax(0, 1fr) 460px; height: calc(100vh - 57px); }
.st-edit aside { padding-top: 0; }
.st-stage { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; max-width: 100%; max-height: 100%;
  background-color: #20242E;
  background-image: linear-gradient(45deg, #2B303C 25%, transparent 25%, transparent 75%, #2B303C 75%), linear-gradient(45deg, #2B303C 25%, transparent 25%, transparent 75%, #2B303C 75%);
  background-size: 24px 24px; background-position: 0 0, 12px 12px; }
.st-stage canvas { display: block; width: 100%; height: 100%; }
#stScrub { flex: 1; min-width: 120px; accent-color: var(--accent); }
#stTime { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 110px; text-align: right; }
select.st-small { width: auto; padding: 5px 8px; font-size: 12.5px; }
.st-status { margin: 12px 0 0; }
.st-note { margin: 10px 0 0; padding: 9px 11px; border: 1px solid #6E2A24; border-left-width: 3px; border-radius: 4px; background: #2B1513; font-size: 13px; overflow-wrap: anywhere; }
.st-note.plain { border-color: var(--line); background: var(--bg); }
.st-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.st-row.three { grid-template-columns: 1.2fr 1.4fr 0.8fr; margin-top: 0; }
#edJson { height: 42vh; min-height: 220px; tab-size: 2; }
.st-notebox { height: 70px; white-space: pre-wrap; font: inherit; }
.st-problems { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-height: 150px; overflow-y: auto; }
.st-problems li { font-size: 12.5px; padding: 5px 8px; border-radius: 4px; border-left: 3px solid; background: var(--bg); overflow-wrap: anywhere; }
.st-problems li.err { border-color: #FF6B5E; color: #FFB3AC; }
.st-problems li.warn { border-color: #E0B040; color: #EBD08C; }
.st-problems li.fine { border-color: var(--ok); color: var(--muted); }
.st-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.st-actions .primary { width: auto; margin: 0; padding: 7px 14px; }
button.danger { color: #FF9D94; }
button.danger:hover { border-color: #B5483F; }
button:disabled { opacity: .45; cursor: default; }
.st-help summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.st-help p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.st-help b { color: var(--ink); font-weight: 600; }
.st-totals { margin: 0; color: var(--muted); }
.st-totals b { color: var(--ink); font-variant-numeric: tabular-nums; }
.st-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.st-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.st-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.st-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.st-table tr:last-child td { border-bottom: 0; }
.st-table .who b { display: block; font-weight: 600; }
.st-table .who span { color: var(--muted); font-size: 12px; }
.st-keys { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.st-keys .key { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.st-keys .key.off { text-decoration: line-through; opacity: .6; }
.st-keys button { padding: 3px 9px; font-size: 12px; }
.st-keybox { border: 1px solid var(--accent); background: #141A33; border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.st-keybox p { margin: 0 0 10px; }
.st-keyline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-keyline code { font-family: var(--mono); font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; overflow-wrap: anywhere; flex: 1; min-width: 240px; user-select: all; }
.st-invite { margin-top: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.st-invite h2, .st-dialog h2 { margin: 0; font: 700 16px/1.2 var(--body); }
.st-invite .st-row { width: 100%; }
.st-dialog { width: min(440px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.st-dialog::backdrop { background: rgba(5, 7, 12, .7); }
.st-dialog form { display: flex; flex-direction: column; gap: 6px; }
.st-dialog label { margin-top: 8px; }
@media (max-width: 1000px) {
  .st-edit { grid-template-columns: 1fr; height: auto; }
  .st-edit .stage-wrap { min-height: 46vh; }
  .st-row.three { grid-template-columns: 1fr; }
}
.field-image { grid-template-columns: 118px minmax(0, 1fr) auto; }
.field-image input[type=file] { width: 100%; font-size: 12px; color: var(--muted); }
.field-image button { padding: 4px 9px; font-size: 12px; }

/* ---------- Editor: looks (v0.5.0) ---------- */
body.editor .looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
body.editor .look { padding: 0; overflow: hidden; display: flex; flex-direction: column; text-align: left; border-radius: 8px; }
body.editor .look canvas { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
body.editor .look span { padding: 4px 7px; font-size: 12px; }
body.editor .look[aria-pressed=true] { border-color: var(--sun); box-shadow: inset 0 0 0 1px var(--sun); }

/* v0.7.0: fonts in the editor */
.field-font { grid-template-columns: 118px minmax(0, 1fr) auto; }
.field-font label small { display: block; font-size: 11px; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; min-height: 38px; }
.font-btn span { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-btn::after { content: 'Change'; font: 600 11px/1 Figtree, system-ui, sans-serif; opacity: .6; flex: none; }
button.link { background: none; border: 0; padding: 2px 4px; text-decoration: underline; color: var(--muted); font-size: 12px; cursor: pointer; }
#fonts { display: grid; gap: 10px; }

/* ---------- v0.7.0: catalog search, filters, previews and the template page ---------- */
.find { display: flex; gap: 10px; width: min(640px, 100%); }
.find input { flex: 1; min-width: 0; min-height: 54px; padding: 0 22px; border: var(--edge); border-radius: 999px; font-size: 17px; background: #FFFFFF; color: var(--night); box-shadow: 4px 4px 0 var(--night); }
.find .btn { min-height: 54px; }
.lib .chips { padding: 26px 0 18px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 22px; padding-bottom: 30px; font-size: 15px; font-weight: 600; }
.kinds { display: inline-flex; border: var(--edge); border-radius: 999px; overflow: hidden; background: #FFFFFF; }
.kinds button { border: 0; border-radius: 0; background: none; color: var(--night); min-height: 42px; padding: 0 16px; font-weight: 700; }
.kinds button + button { border-left: var(--edge); }
.kinds button[aria-pressed=true] { background: var(--night); color: #FFFFFF; }
.sort { display: inline-flex; align-items: center; gap: 8px; }
.sort select { min-height: 42px; padding: 0 12px; border: var(--edge); border-radius: 999px; background: #FFFFFF; color: var(--night); font-weight: 700; }
.count { color: #5B6170; }
.media { position: relative; aspect-ratio: 16 / 9; background: var(--night); overflow: hidden; }
.media.overlay { background: linear-gradient(135deg, #3A4250, #1B1F27); }
.media img, .media video, .media canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media video { opacity: 0; transition: opacity .15s; }
.media.playing video { opacity: 1; }
.media.broken::after { content: 'Preview not available'; position: absolute; inset: 0; display: grid; place-items: center; color: #FFFFFF; font-size: 14px; }
.trio .tilt .media { border-radius: 0; }
.card .shot { position: relative; }
.card .badge { position: absolute; left: 10px; top: 10px; background: rgba(20, 22, 28, .78); color: #FFFFFF; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.tpl-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 36px; align-items: start; padding: 18px 0 60px; }
.tpl:not(.ready) .tpl-main, .tpl:not(.ready) .more { visibility: hidden; }
.tpl-stage { border: var(--edge); border-radius: 20px; overflow: hidden; box-shadow: 8px 8px 0 var(--night); }
.tpl-side { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.tpl-side h1 { margin: 0; font: 800 clamp(34px, 4.4vw, 52px)/1.02 var(--display); letter-spacing: -0.02em; }
.tpl-side p { margin: 0; }
.tpl-side h2, .more h2 { margin: 10px 0 0; font: 800 20px/1.2 var(--display); }
.tpl-side .tag { text-decoration: none; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.fact { border: var(--edge); border-radius: 14px; padding: 10px 12px; background: #FFFFFF; display: flex; flex-direction: column; gap: 2px; }
.fact span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #5B6170; }
.fact b { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.can { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.can li { border: var(--edge); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; background: #FFFFFF; }
.can.looks li { background: var(--sun); }
.tags { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.tagword { font-size: 14px; color: #5B6170; }
.more { padding-bottom: 30px; }
.more h2 { margin-bottom: 22px; }
@media (max-width: 900px) { .tpl-main { grid-template-columns: 1fr; } }
