@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Caslon+Display&display=swap');
:root{--wine:#642c38;--ink:#292b28;--muted:#74766f;--line:#deded5;--paper:#faf9f5;--cream:#f0eee6}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:'DM Sans',Arial,sans-serif;font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #af8061;outline-offset:3px}header{height:95px;border-bottom:1px solid var(--line);padding:20px 4%;display:flex;justify-content:space-between;align-items:center}.brand{font-size:25px;letter-spacing:4px;color:var(--ink);text-decoration:none}.brand span{color:var(--wine)}.brand small{display:block;font-size:9px;letter-spacing:4px;margin-top:5px}nav{display:flex;align-items:center;gap:30px}nav>span{color:var(--muted);font-size:13px}.outline{border:1px solid var(--line);border-radius:5px;background:transparent;padding:12px 18px}b#cartCount{background:var(--wine);color:white;padding:3px 7px;border-radius:100%;margin-left:10px}.intro{display:flex;justify-content:space-between;align-items:center;padding:34px 4%}.eyebrow{font-size:10px;letter-spacing:2px;font-weight:700;color:var(--wine);margin:0 0 9px}h1{font-family:'Libre Caslon Display',Georgia,serif;font-size:48px;font-weight:400;margin:0}.intro p:last-child{color:var(--muted);margin-bottom:0}.studio-note{border-left:1px solid var(--line);padding-left:25px;line-height:1.9;font-size:12px;color:var(--muted)}.studio-note strong{color:var(--ink);font-weight:500}.preview-notice{background:#eae5dc;padding:9px 4%;font-size:11px;color:#656052;letter-spacing:.3px}main{display:grid;grid-template-columns:330px minmax(0,1fr);max-width:1600px;margin:auto}.controls{border-right:1px solid var(--line);padding:12px 25px 35px}.controls section{padding:22px 0;border-bottom:1px solid var(--line)}h2{font-size:15px;font-weight:600;margin:0 0 18px}h2 em{font-size:11px;font-style:normal;color:#a2947f;margin-right:10px}.segmented{display:flex;gap:5px;margin-bottom:18px}.segmented button{width:50%;padding:12px 3px;border:1px solid var(--line);background:white;border-radius:5px;font-size:12px}.segmented .selected{background:var(--wine);color:white;border-color:var(--wine)}label{font-size:12px;font-weight:500;display:block;margin:12px 0 7px}select,input[type=number],textarea{background:white;border:1px solid #d3d4cd;border-radius:4px;padding:11px;width:100%;color:var(--ink)}textarea{resize:vertical}.hint{font-size:11px;color:var(--muted);line-height:1.6}.label-line{display:flex;align-items:center;justify-content:space-between}.text-button{background:none;border:0;padding:6px 0;font-size:11px;color:var(--wine);text-decoration:underline;text-underline-offset:3px}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}input[type=range]{width:100%;accent-color:var(--wine)}[hidden]{display:none!important}.workspace{padding:28px 36px}.preview-header{display:flex;justify-content:space-between;align-items:center}.preview-header h2{font-family:Georgia,serif;font-size:24px;font-weight:400;margin-bottom:22px}.pill{border:1px solid var(--line);border-radius:30px;padding:8px 13px;font-size:12px}.stage{height:500px;background:radial-gradient(ellipse at 40% 20%,#f6f4ef,#e7e4dc);position:relative;border:1px solid #e1dfd6;border-radius:6px;overflow:hidden;display:grid;place-items:center}.stage.dragover{outline:3px dashed var(--wine)}canvas{width:100%;height:100%;object-fit:contain}#emptyState{position:absolute;text-align:center;padding:24px}.upload-icon{font-size:37px;font-weight:400;color:#918b7d;margin-bottom:15px}h3{font-family:Georgia,serif;font-size:23px;font-weight:400;margin:0 0 12px}#emptyState>p{color:var(--muted)}.primary{background:var(--wine);color:white;border:0;border-radius:4px;padding:13px 22px;font-weight:500;font-size:12px}.primary:disabled{background:#aaa59b;cursor:not-allowed}.under-preview{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted);padding:10px 0;gap:10px}.under-preview span{overflow-wrap:anywhere}.quality{padding:13px 17px;border:1px solid #d6ddd0;background:#eef2eb;color:#4d6248;border-radius:5px;font-size:12px;line-height:1.6}.quality.warning{background:#fff3dc;border-color:#e6d0a0;color:#805d27}.quality.bad{background:#f7e8e5;border-color:#dcafa5;color:#8d3c2d}.measurements{display:grid;grid-template-columns:1fr 1fr 1fr;border-bottom:1px solid var(--line);padding:22px 0;gap:10px}.measurements span{font-size:10px;color:var(--muted);display:block;margin-bottom:6px}.measurements strong{font-size:14px;font-weight:500}.review-card{display:flex;gap:20px;padding:28px 0;align-items:center}.monogram{font:italic 42px Georgia;border:1px solid #d7c8b6;border-radius:50%;width:65px;height:65px;flex-shrink:0;display:grid;place-items:center;color:#9c866b}.review-card h3{font-size:19px;margin-bottom:6px}.review-card p{font-size:12px;color:var(--muted);line-height:1.7;margin:0;max-width:630px}.order-bar{display:flex;align-items:center;gap:18px;border-top:1px solid var(--line);padding-top:18px}.order-bar label{margin:0;width:70px}.order-bar input{margin-top:6px}.order-bar>div{flex:1}.order-bar strong{font-size:13px;font-weight:500;display:block}.order-bar small{display:block;color:var(--muted);font-size:10px;margin-top:5px}.error{color:#993c36;font-size:12px}footer{border-top:1px solid var(--line);padding:24px 4%;font-size:9px;letter-spacing:1px;display:flex;justify-content:space-between;color:var(--muted)}dialog{border:1px solid var(--line);border-radius:8px;max-width:660px;width:calc(100% - 30px);padding:28px;background:var(--paper)}dialog::backdrop{background:#27272388}.dialog-head{display:flex;justify-content:space-between}.dialog-head button{border:0;background:none}.cart-item{display:flex;gap:16px;border-block-start:1px solid var(--line);padding:18px 0}.cart-item img{width:80px;height:95px;object-fit:contain;background:var(--cream)}.cart-item p{font-size:12px;line-height:1.7;margin:3px 0}.cart-item strong{font-size:13px}.cart-item div{flex:1}@media(min-width:1500px){.stage{height:600px}}@media(max-width:900px){.intro{padding:25px 4%}h1{font-size:36px}.studio-note{display:none}main{grid-template-columns:285px minmax(0,1fr)}.controls{padding-inline:18px}.workspace{padding:24px 18px}.stage{height:420px}.order-bar{flex-wrap:wrap}.order-bar .primary{width:100%}}@media(max-width:650px){header{height:80px}.brand{font-size:20px}nav>span{display:none}nav{gap:0}.outline{padding:10px}.intro h1{font-size:35px}.intro p:last-child{font-size:12px;line-height:1.7}main{display:flex;flex-direction:column}.controls{border-right:0;display:grid;grid-template-columns:1fr;order:2}.workspace{padding:20px 16px}.stage{height:390px}.review-card{display:none}.controls section{padding:18px 0}.order-bar{position:static}.measurements strong{font-size:12px}footer{line-height:1.8;gap:15px}.preview-header h2{font-size:21px}.preview-notice{font-size:10px}dialog{padding:20px}}

/* A bounded canvas prevents its intrinsic height from stretching the grid row. */
.stage{display:block}.stage #preview{position:absolute;inset:0;width:100%;height:100%;min-width:0;min-height:0;display:block;touch-action:none}
#emptyState{inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.estimate{text-align:right;margin-bottom:18px}.estimate .pill{display:inline-block}.estimate strong{display:block;color:#b32d30;font-size:19px;margin-top:10px}.estimate small{display:block;font-size:9px;color:var(--muted);margin-top:5px}
.view-tabs{display:flex;gap:8px;margin:0 0 12px}.view-tabs button{border:1px solid var(--line);background:white;border-radius:5px;padding:9px 14px}.view-tabs .selected{background:var(--wine);color:white}.view-tabs button:disabled{opacity:.4;cursor:not-allowed}
#viewerControls>div{padding:0 0 15px;max-width:500px}#viewerControls label{margin-top:0}
@media(max-width:650px){.preview-header{align-items:flex-start;gap:10px}.estimate strong{font-size:16px}.estimate small{max-width:140px}.view-tabs button{padding:9px;font-size:12px}}

/* Frame Studio and touch-friendly controls */
.segmented{flex-wrap:wrap}.segmented button{flex:1 1 30%;min-height:44px;width:auto}.check-line{display:flex;gap:9px;align-items:center;font-size:13px}.check-line input{width:19px;height:19px;accent-color:var(--wine)}
.category-tabs{display:flex;gap:6px;margin:15px 0}.category-tabs button{flex:1;padding:12px 4px;border:1px solid var(--line);border-radius:5px;background:white}.category-tabs .selected{background:var(--wine);color:white}.category-tabs button:disabled{opacity:.4;cursor:not-allowed}
#categoryTitle{font-size:21px;line-height:1.25;margin:20px 0 12px}.frame-swatch{margin:16px 0;padding:12px;background:#f0eee7;border-radius:6px;display:flex;gap:12px;align-items:center}.frame-swatch img{width:85px;height:115px;object-fit:contain;background:white}.frame-swatch strong{font-size:12px;line-height:1.5;display:block}
.preview-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}.preview-actions button{min-height:44px;font-size:12px;padding:9px 15px}#shareStatus:empty{display:none}
.quote-breakdown{border:1px solid var(--line);background:#f0eee7;border-radius:6px;padding:18px;margin:20px 0}.quote-breakdown>div{display:flex;justify-content:space-between;gap:15px;padding:7px 0;font-size:13px}.quote-breakdown>div:last-of-type{border-top:1px solid #ccc;margin-top:6px;padding-top:12px}.quote-breakdown strong{font-weight:500}
.stage.fullscreen-fallback,.stage:fullscreen{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;z-index:1000;background:#e9e5dc;border:0;border-radius:0}
#exitFullScreen{position:absolute;right:20px;top:20px;z-index:1001;border:1px solid var(--line);border-radius:5px;background:white;padding:12px 18px;min-height:44px}
button:disabled{cursor:not-allowed}select,input[type=number]{min-height:44px}input[type=range]{min-height:32px}.view-tabs button{min-height:44px}button,a,input,select{-webkit-tap-highlight-color:transparent}
@media(min-width:651px) and (max-width:1100px){main{grid-template-columns:310px minmax(0,1fr)}.workspace{padding:22px 16px}.preview-header{align-items:flex-start;gap:10px}.preview-header h2{font-size:22px}.stage{height:440px}.view-tabs{flex-wrap:wrap}.view-tabs button{flex:1}.estimate small{max-width:150px}.preview-actions button{flex:1}.frame-swatch{flex-wrap:wrap}.frame-swatch img{width:70px;height:85px}}
@media(max-width:650px){main{display:flex;flex-direction:column}.controls{order:0;padding:12px 16px}.workspace{order:1}.controls section{padding:18px 0}.stage{height:min(110vw,480px)}select,input,textarea{font-size:16px}.preview-header{flex-wrap:wrap}.estimate{margin-left:auto}.preview-actions button{flex:1}.frame-swatch{flex-wrap:nowrap}.frame-swatch img{width:80px;height:100px}.intro{padding-block:22px}.view-tabs button{flex:1}.order-bar .primary{min-height:48px}}

header{height:72px;padding-block:12px}.intro{padding-block:18px}h1{font-size:40px}.intro .eyebrow{margin-bottom:6px}.intro p:last-child{margin-top:8px}#resizeControls{padding:14px 0}#resizeControls>strong{font-size:13px}.resize-buttons{display:flex;gap:8px;margin-top:8px}.resize-buttons button{min-height:44px;padding:10px 18px;border:1px solid var(--line);border-radius:5px;background:white}.resize-buttons button[aria-pressed=true]{background:var(--wine);color:white}@media(max-width:650px){header{height:64px}.intro{padding-block:14px}.intro h1{font-size:29px}.resize-buttons button{flex:1}}
.brand{font-family:Georgia,serif;font-size:25px;letter-spacing:.7px;white-space:nowrap}.brand small{font-family:'DM Sans',Arial,sans-serif;font-size:10px;letter-spacing:1.4px;margin-top:5px}@media(max-width:650px){.brand{font-size:19px;letter-spacing:0}.brand small{font-size:8px;letter-spacing:.7px}header{padding-inline:14px;gap:12px}header .outline{font-size:11px;padding:9px 8px}b#cartCount{margin-left:4px}}

#upscalePanel{padding:12px 0}#upscaleButton{min-height:44px}#upscaleButton[aria-pressed=true]{background:var(--wine);color:white;border-color:var(--wine)}
.resize-buttons{flex-wrap:wrap}.resize-buttons button{flex:1 1 auto}

/* Gallery return link, with a touch-friendly target on all screens. */
header{height:auto;min-height:72px}.header-brand{display:flex;align-items:center;gap:24px;min-width:0}.back-to-gallery{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:5px;color:var(--wine);text-decoration:none;font-size:12px;white-space:nowrap}.back-to-gallery:hover{background:#eee9e2}.back-to-gallery:focus-visible{outline:2px solid var(--wine);outline-offset:3px}@media(max-width:900px){.header-brand{flex-direction:column;align-items:flex-start;gap:6px}.back-to-gallery{padding:6px 10px}header{align-items:center}.header-brand .brand{white-space:normal}}
