// App shell + Tweaks const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "accent": "brass", "grain": 0.08, "palette": "ink", "fontPair": "fraunces-inter" }/*EDITMODE-END*/; const PALETTES = { ink: { bg: '#0a0f1a', bgRaise: '#0e1422', ink: '#f0ece4', ink2: '#c9cdd6', mute: '#7a8599', mute2: '#4a5366' }, forest: { bg: '#0a120f', bgRaise: '#0e1814', ink: '#ece8de', ink2: '#c3ccc0', mute: '#7a8a80', mute2: '#485248' }, obsidian: { bg: '#0a0a0c', bgRaise: '#121214', ink: '#f2efe8', ink2: '#cacbd0', mute: '#7c7e85', mute2: '#484950' }, }; const ACCENTS = { brass: 'oklch(0.82 0.085 78)', sage: 'oklch(0.80 0.07 150)', amber: 'oklch(0.80 0.12 60)', slate: 'oklch(0.80 0.04 240)', }; const FONT_PAIRS = { 'fraunces-inter': { serif: "'Fraunces', 'Iowan Old Style', Georgia, serif", sans: "'Inter Tight', -apple-system, sans-serif" }, 'fraunces-mono': { serif: "'Fraunces', Georgia, serif", sans: "'JetBrains Mono', ui-monospace, monospace" }, }; function applyTweaks(t) { const r = document.documentElement; const p = PALETTES[t.palette] || PALETTES.ink; r.style.setProperty('--bg', p.bg); r.style.setProperty('--bg-raise', p.bgRaise); r.style.setProperty('--ink', p.ink); r.style.setProperty('--ink-2', p.ink2); r.style.setProperty('--mute', p.mute); r.style.setProperty('--mute-2', p.mute2); r.style.setProperty('--accent', ACCENTS[t.accent] || ACCENTS.brass); const f = FONT_PAIRS[t.fontPair] || FONT_PAIRS['fraunces-inter']; r.style.setProperty('--serif', f.serif); r.style.setProperty('--sans', f.sans); r.style.setProperty('--grain-opacity', String(t.grain)); } function TweaksPanel({ tweaks, setTweaks, onClose }) { const update = (k, v) => { const next = { ...tweaks, [k]: v }; setTweaks(next); applyTweaks(next); try { window.parent.postMessage({ type: '__edit_mode_set_keys', edits: { [k]: v } }, '*'); } catch {} }; const box = { position: 'fixed', bottom: 24, right: 24, zIndex: 10001, width: 320, background: 'rgba(14, 20, 34, 0.96)', backdropFilter: 'blur(16px)', border: '1px solid var(--rule-2)', padding: 20, fontFamily: 'var(--sans)', color: 'var(--ink)', boxShadow: '0 20px 60px rgba(0,0,0,0.5)', }; const label = { fontFamily: 'var(--mono)', fontSize: 10, letterSpacing: '0.14em', color: 'var(--mute)', textTransform: 'uppercase', marginBottom: 10, display: 'block' }; const chipRow = { display: 'flex', gap: 6, flexWrap: 'wrap', marginBottom: 18 }; const chip = (active) => ({ padding: '6px 10px', fontSize: 11, fontFamily: 'var(--mono)', border: `1px solid ${active ? 'var(--accent)' : 'var(--rule-2)'}`, color: active ? 'var(--accent)' : 'var(--ink-2)', cursor: 'pointer', letterSpacing: '0.05em', }); return (