: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 { 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,.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 { margin-bottom:20px; }
.panel-heading h2 { margin:0 0 6px; font-size:1.4rem; }
.panel-description { margin:0; }
.actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.upload-button { display:inline-flex; align-items:center; justify-content:center; }
.text-button { min-height:42px; padding:8px 12px; border:0; background:transparent; color:var(--accent-dark); font-weight:700; cursor:pointer; }
.inline-status { min-height:1.45em; margin:10px 0 0; color:var(--muted); font-size:.9rem; }
.quality-control { margin:18px 0 20px; padding:16px; background:#fbfbfc; border:1px solid var(--line); border-radius:8px; }
.quality-control label { display:flex; justify-content:space-between; gap:10px; font-weight:750; }
.quality-control output { color:var(--muted); font-weight:650; }
.quality-control input { width:100%; margin:14px 0 4px; accent-color:var(--accent); }
.range-labels { display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-size:.78rem; }
.quality-control p { margin:4px 0 0; color:var(--muted); font-size:.84rem; line-height:1.5; }
.image-list { display:grid; gap:12px; }
.image-card { min-width:0; padding:14px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px 16px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.preview-pair { min-width:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.preview-pair figure { min-width:0; margin:0; }
.preview-pair figcaption { margin-bottom:5px; color:var(--muted); font-size:.76rem; font-weight:700; }
.preview-pair img,.preview-placeholder { display:grid; width:100%; height:150px; place-items:center; object-fit:contain; color:var(--muted); background-color:#f1f2f4; background-image:linear-gradient(45deg,#e4e5e7 25%,transparent 25%),linear-gradient(-45deg,#e4e5e7 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e4e5e7 75%),linear-gradient(-45deg,transparent 75%,#e4e5e7 75%); background-size:16px 16px; background-position:0 0,0 8px,8px -8px,-8px 0; border-radius:5px; }
.preview-placeholder { padding:10px; text-align:center; font-size:.82rem; line-height:1.4; background-image:none; }
.image-details { min-width:0; display:grid; gap:5px; }
.image-name { overflow-wrap:anywhere; font-weight:700; }
.image-meta,.image-error { color:var(--muted); font-size:.83rem; line-height:1.45; }
.image-error { color:#a12828; }
.image-details { grid-column:1 / -1; }
.download-button { min-height:38px; padding:8px 12px; border:1px solid var(--accent); border-radius:6px; background:#fff; color:var(--accent-dark); font-weight:700; text-decoration:none; white-space:nowrap; }
.image-card > .download-button { grid-column:2; grid-row:1; align-self:center; }
.download-button:hover { background:#f4f1e9; }
.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; }
    .image-card { grid-template-columns:minmax(0,1fr); }
    .preview-pair img,.preview-placeholder { height:112px; }
    .image-card > .download-button { grid-column:1; grid-row:auto; justify-self:start; }
}
