:root { color-scheme: light; --ink:#20242b; --muted:#626a77; --line:#e2e5e9; --surface:#fff; --background:#f7f8fa; --accent:#9b7621; --accent-dark:#765a16; font-family:Raleway,"Segoe UI",system-ui,sans-serif; }
* { box-sizing:border-box; }
html { min-height:100%; background:var(--background); }
body { min-height:100vh; margin:0; display:flex; flex-direction:column; color:var(--ink); background:var(--background); }
a { color:inherit; }
button,input,select { font:inherit; }
:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.app-header { min-height:76px; padding:9px max(22px,calc((100vw - 1120px)/2)); display:flex; justify-content:space-between; align-items:center; gap:20px; background:#fff; border-bottom:1px solid var(--line); }
.brand { width:min(230px,52vw); display:block; }
.brand img { display:block; width:100%; height:auto; }
.app-header nav { display:flex; align-items:center; gap:18px; }
.app-header nav a,.back-link { color:var(--accent-dark); font-weight:700; text-decoration:none; }
.install-button,.primary-button,.secondary-button { min-height:42px; padding:9px 16px; border:1px solid var(--accent); border-radius:6px; cursor:pointer; font-weight:700; }
.install-button,.primary-button { background:var(--accent); color:#fff; }
.install-button:hover,.primary-button:hover { background:var(--accent-dark); }
.secondary-button { background:#fff; color:var(--accent-dark); }
.secondary-button:hover { background:#f4f1e9; }
.secondary-button:disabled { opacity:.5; cursor:not-allowed; }
.page { flex:1; width:min(100% - 36px,980px); margin:0 auto; padding:25px 0 60px; }
.back-link { display:inline-block; margin:0 0 24px; }
.intro { margin:0 0 30px; }
.eyebrow { margin:0 0 8px; color:var(--accent-dark); font-size:.74rem; font-weight:800; letter-spacing:.13em; text-transform:uppercase; }
h1,h2,p { margin-top:0; }
h1 { margin-bottom:10px; font-family:Cinzel,Georgia,serif; font-size:clamp(2rem,5vw,3.3rem); line-height:1.14; }
.intro>p:last-child,.panel-description,.note,.privacy-note { color:var(--muted); line-height:1.65; }
.intro>p:last-child { max-width:690px; margin-bottom:0; font-size:1.05rem; }
.panel { margin:0 0 18px; padding:clamp(18px,4vw,28px); background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 28px rgb(25 34 48 / 4%); }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:20px; }
.panel-heading h2 { margin:0 0 6px; font-size:1.4rem; }
.panel-description { margin:0; }
.image-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.upload-button { display:inline-flex; align-items:center; justify-content:center; }
.image-meta { color:var(--muted); font-size:.88rem; }
.inline-status { min-height:1.45em; margin:8px 0 0; color:var(--muted); font-size:.88rem; }
.preview-heading { margin:16px 0 -8px; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:4px 14px; color:var(--ink); font-size:.88rem; }
.preview-heading span { color:var(--muted); font-size:.82rem; }
.preview-frame { position:relative; min-height:260px; margin-top:16px; display:grid; place-items:center; overflow:hidden; background-color:#eceef1; background-image:linear-gradient(45deg,#e1e3e6 25%,transparent 25%),linear-gradient(-45deg,#e1e3e6 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e1e3e6 75%),linear-gradient(-45deg,transparent 75%,#e1e3e6 75%); background-size:24px 24px; background-position:0 0,0 12px,12px -12px,-12px 0; border:1px solid var(--line); border-radius:8px; }
.preview-frame.has-image { width:fit-content; max-width:100%; min-height:0; max-height:min(68vh,720px); margin-right:auto; margin-left:auto; }
.preview-frame img { display:block; width:auto; max-width:100%; max-height:min(68vh,720px); height:auto; object-fit:contain; }
.guide-overlay { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
.guide-overlay path,.guide-overlay line,.guide-overlay rect { fill:none; stroke:var(--guide-color,#fff); stroke-width:2.2; vector-effect:non-scaling-stroke; }
.guide-overlay .guide-soft { stroke-width:1.35; }
.empty-state { min-height:260px; padding:28px; display:grid; place-content:center; justify-items:center; gap:8px; text-align:center; color:var(--muted); }
.empty-state strong { color:var(--ink); font-size:1.05rem; }
.empty-mark { color:var(--accent); font-size:2.6rem; line-height:1; }
.note { margin:12px 0 0; font-size:.86rem; }
.guide-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr)); gap:10px; }
.guide-option { min-height:74px; padding:13px; display:flex; align-items:flex-start; gap:11px; background:#fbfbfc; border:1px solid var(--line); border-radius:8px; cursor:pointer; }
.guide-option input { width:18px; height:18px; margin:2px 0 0; accent-color:var(--accent); flex:none; }
.guide-option span { display:grid; gap:4px; }
.guide-option strong { font-size:.94rem; }
.guide-option small { color:var(--muted); font-size:.82rem; line-height:1.45; }
.guide-controls { margin-top:18px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.field { display:grid; align-content:start; gap:7px; color:#414854; font-size:.88rem; font-weight:700; }
.field select { width:100%; min-height:42px; padding:8px 10px; color:var(--ink); background:#fff; border:1px solid #cbd0d8; border-radius:6px; }
.field input[type=range] { width:100%; accent-color:var(--accent); }
.field output { float:right; color:var(--muted); font-weight:600; }
.privacy-note { margin:20px 0 0; text-align:center; font-size:.88rem; }
.toast { position:fixed; right:16px; bottom:16px; z-index:3; max-width:min(420px,calc(100vw - 32px)); padding:12px 16px; color:#fff; background:#252a32; border-radius:7px; opacity:0; pointer-events:none; transform:translateY(8px); transition:opacity .16s ease,transform .16s ease; }
.toast.visible { opacity:1; transform:translateY(0); }
[hidden] { display:none !important; }
@media(max-width:640px) {
    .app-header { min-height:66px; padding:8px 14px; gap:8px; }
    .brand { width:min(190px,47vw); }
    .app-header nav { gap:10px; }
    .app-header nav a { font-size:.84rem; }
    .app-header .install-button { min-height:38px; padding:7px 10px; font-size:.82rem; }
    .page { width:min(100% - 26px,980px); padding-top:18px; }
    .guide-controls { grid-template-columns:1fr; }
    .preview-frame { min-height:210px; }
    .preview-frame.has-image,.preview-frame img { max-height:min(68vh,620px); }
    .empty-state { min-height:210px; }
    .image-actions .secondary-button { width:100%; }
}
