.motif-guide {background:#f2ebde;color:#32261e;padding:clamp(2.3rem,5vw,5rem) 0;scroll-margin-top:.5rem;}
.motif-guide:focus {outline:0;}
.guide-wrap {max-width:1180px;}
.guide-heading h1,.guide-heading h2 {max-width:none;font:400 clamp(2.25rem,4.5vw,4.7rem)/1.06 var(--serif);letter-spacing:-.05em;color:#38291e;}
.guide-heading p {margin:.65rem 0 1.45rem;color:#655443;}
.guide-steps {display:flex;gap:.4rem;border-bottom:1px solid #cbbba6;scroll-margin-top:8px;}
.motif-guide button {font-family:var(--sans);color:inherit;letter-spacing:normal;text-transform:none;}
.guide-steps button {display:flex;align-items:center;justify-content:center;gap:.55rem;min-height:45px;padding:.2rem 1rem .55rem;border:0;border-bottom:3px solid transparent;background:none;color:#705e4e;font-size:.95rem;}
.guide-steps b {display:grid;place-items:center;width:1.55rem;height:1.55rem;border:1px solid #b6a18b;border-radius:50%;font:600 .8rem/1 var(--sans);}
.guide-steps [aria-current] {border-color:#784c29;color:#402e21;font-weight:650;}
.guide-steps [aria-current] b {color:white;border-color:#563923;background:#563923;}
.guide-work {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);align-items:start;gap:clamp(1.6rem,4vw,4.4rem);padding-top:1.5rem;}
.guide-preview {width:100%;max-width:490px;margin:0;min-width:0;}
.guide-preview .surface-scene,#zoom-art {background:radial-gradient(ellipse at 48% 38%,#e4c79e12,#21160f96),url('/assets/onizleme/studyo-ceviz.webp') center/cover #514034;}
.guide-preview .surface-scene {position:relative;overflow:hidden;isolation:isolate;width:100%;aspect-ratio:1.16;border-radius:6px;box-shadow:inset 0 0 0 1px #4f372244;}
.guide-preview .surface-scene:has(img:not([hidden])) {aspect-ratio:1;}
.guide-preview .surface-scene>img {position:absolute;width:100%;height:100%;inset:0;object-fit:cover;}
.guide-preview .surface-inlay {position:absolute;left:var(--inlay-x,50%);top:var(--inlay-y,50%);width:var(--inlay-size,84%);aspect-ratio:1;translate:-50% -50%;filter:drop-shadow(0 3px 4px #28180c66);}
.guide-preview .surface-inlay svg {display:block;width:100%;height:100%;}
.guide-preview figcaption {font:.87rem/1.45 var(--sans);color:#605142;margin-top:.45rem;}
.motif-guide .surface-inlay [data-piece] {cursor:default;}
.motif-guide .surface-inlay [data-piece]:hover {filter:none;}
.motif-guide[data-stage="2"][data-target="piece"] [data-piece] {cursor:crosshair;}
.motif-guide[data-stage="2"][data-target="piece"] [data-piece]:hover {filter:brightness(1.2);}
.guide-controls {min-width:0;background:#fbf8f1;padding:clamp(1.15rem,2.4vw,2.2rem);border:1px solid #dbceba;border-radius:6px;}
.guide-controls h3,.guide-dialog h3 {font:400 clamp(1.6rem,2.8vw,2.5rem)/1.1 var(--serif);letter-spacing:-.04em;color:#35271e;}
.guide-controls h3:focus {outline:0;}
.guide-controls p,.guide-dialog p {color:#635244;font:.97rem/1.5 var(--sans);margin:.55rem 0 .9rem;}
.guide-shapes,.wood-quick,.wood-library {display:grid;gap:.6rem;grid-template-columns:repeat(3,minmax(0,1fr));}
.guide-shapes {margin:1rem 0 1.4rem;}
.motif-guide .shape-card,.motif-guide .wood-card {position:relative;min-width:0;border:1px solid #caba9f;border-radius:5px;background:#fffcf5;overflow:hidden;}
.shape-card {display:grid;place-items:center;padding:.55rem .3rem .7rem;gap:.45rem;}
.shape-card span {display:block;background:#e9dfcd;width:100%;border-radius:3px;max-height:120px;}
.shape-card svg {margin:auto;display:block;width:100%;max-width:104px;height:auto;}
.shape-card strong,.wood-card strong {font:600 .94rem/1.28 var(--sans);}
.motif-guide [aria-pressed="true"].shape-card,.motif-guide [aria-pressed="true"].wood-card {border:2px solid #744b2c;box-shadow:0 0 0 1px #744b2c;}
.shape-card[aria-pressed="true"]:after,.wood-card[aria-pressed="true"]:after {content:'✓';position:absolute;right:4px;top:4px;border-radius:50%;background:#513925;color:white;width:1.32rem;line-height:1.32rem;font-size:.85rem;text-align:center;}
.guide-label,.guide-dialog label,.guide-fine label {display:block;font:600 .93rem/1.45 var(--sans);margin:.95rem 0 .4rem;}
.guide-tabs,.guide-actions,.part-row,.guide-chosen,.edit-feedback {display:flex;align-items:center;gap:.45rem;flex-wrap:wrap;}
.guide-tabs button,.guide-secondary,.guide-back,.part-row select,.part-row button,.edit-feedback button {min-height:44px;padding:.4rem .72rem;background:#fffdf8;border:1px solid #bca991;border-radius:4px;font:500 .9rem/1.25 var(--sans);}
.guide-tabs [aria-pressed="true"] {background:#59402e;color:#fff;border-color:#59402e;}
.motif-guide .guide-primary {display:inline-flex;gap:1.2rem;min-height:46px;align-items:center;justify-content:space-between;padding:.67rem 1.15rem;background:#4b3223;color:#fffaf0;border:1px solid #4b3223;border-radius:4px;font:600 .98rem/1.3 var(--sans);}
.guide-primary span {font-size:1.2em;}
.guide-actions {margin-top:1.05rem;justify-content:space-between;gap:.65rem;}
.guide-link {display:inline-block;min-height:42px;background:none;border:0;padding:.55rem 0;color:#654528;text-decoration:underline;text-underline-offset:4px;font:600 .9rem/1.5 var(--sans);}
.wood-card {padding:0 0 .55rem;display:flex;align-items:stretch;flex-direction:column;text-align:left;}
.wood-card img {width:100%;height:47px;object-fit:cover;margin-bottom:.38rem;}
.wood-card strong,.wood-card small {margin:0 .45rem;overflow-wrap:anywhere;}
.wood-card small {font:.78rem/1.45 var(--sans);color:#675341;}
.guide-chosen {font:.85rem/1.4 var(--sans);gap:.3rem .6rem;color:#5d4c3c;}
.guide-chosen .guide-link {font-size:.8rem;}
#piece-extra {margin:.4rem 0;}
#piece-extra details {margin:.4rem 0;}
.guide-controls summary {cursor:pointer;padding:.5rem 0;font:500 .9rem/1.5 var(--sans);color:#62452e;min-height:42px;}
.edit-feedback {min-height:42px;gap:.6rem;}
.edit-feedback button {background:transparent;}
.motif-guide button:disabled {cursor:default;opacity:.5;}
#piece-status {flex:1;min-width:9rem;font:.87rem/1.35 var(--sans);color:#5b493a;}
.guide-fine {margin-top:1rem;border-block:1px solid #ddceba;padding:.15rem 0;}
.guide-fine[open] {padding-bottom:.65rem;}
.guide-fine input {display:block;width:100%;height:42px;accent-color:#68492c;}
.guide-fine output {float:right;}
#paletteName {font-size:.85rem;color:#5d4d3d;}
.guide-dialog {width:min(94vw,650px);max-width:94vw;max-height:86vh;max-height:86dvh;overflow:auto;overscroll-behavior:contain;margin:auto;padding:clamp(1rem,3vw,1.7rem);border:1px solid #bca480;border-radius:7px;background:#fbf8f0;color:#36291e;box-shadow:0 18px 64px #291b194d;}
.guide-dialog::backdrop {background:#211a15ab;}
.guide-dialog .dialog-top {display:flex;align-items:center;justify-content:space-between;gap:1rem;}
.dialog-top [data-close] {width:44px;height:44px;line-height:1;background:transparent;border:1px solid #c9baa6;border-radius:50%;font-size:1.55rem;}
.guide-dialog input {width:100%;min-height:44px;margin:0 0 .8rem;padding:.55rem .65rem;box-sizing:border-box;font:1rem var(--sans);background:white;color:#36291e;border:1px solid #ab967d;border-radius:4px;}
.guide-dialog .wood-library {grid-template-columns:repeat(4,minmax(0,1fr));}
#zoom-art {width:min(100%,58vh);margin:.6rem auto 0;aspect-ratio:1;overflow:hidden;border-radius:4px;}
#zoom-art svg {width:100%;height:100%;}
.guide-controls #imageStatus:empty {display:none;}
@media(max-width:750px) {
 .motif-guide {padding:2rem 0;}
 .guide-wrap {width:min(94%,560px);}
 .guide-heading p {margin:.4rem 0 .85rem;}
 .guide-steps {gap:0;}
 .guide-steps button {flex:1;padding:.35rem .1rem;gap:.33rem;font-size:.87rem;}
 .guide-work {display:block;padding-top:.65rem;}
 .guide-preview {display:flex;align-items:center;gap:.75rem;max-width:100%;margin:0 0 .65rem;background:#e8ddcb;border:1px solid #d6c7b0;border-radius:5px;padding:.4rem;}
 .guide-preview .surface-scene,.guide-preview .surface-scene:has(img:not([hidden])) {aspect-ratio:1;flex:0 0 auto;width:clamp(108px,19vh,150px);}
 .guide-preview figcaption {max-width:22ch;font-size:.86rem;margin:0;}
 .motif-guide[data-stage="2"] .guide-preview {width:100%;z-index:2;}
 .motif-guide[data-stage="3"] .guide-preview .surface-scene {width:clamp(142px,26vh,195px);}
 .guide-controls {padding:1.05rem;}
 .guide-shapes {margin:.75rem 0 1rem;}
 .shape-card span {max-height:84px;}
 .shape-card svg {max-width:78px;}
 .guide-tabs button {padding:.42rem .57rem;}
 .guide-dialog .wood-library {grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(max-width:750px) and (min-height:650px) {
 .motif-guide[data-stage="2"] .guide-preview {position:sticky;top:4px;box-shadow:0 3px 8px #42312625;}
}
@media(max-width:390px) {
 .guide-controls {padding:.85rem;}
 .guide-dialog .wood-library {grid-template-columns:repeat(2,minmax(0,1fr));}
 .guide-shapes,.wood-quick {gap:.38rem;}
 .wood-card strong {font-size:.84rem;}
}
.motif-guide .guide-dialog[open] {display:block;}
.motif-file-box {border:1px dashed #aa9276;background:#f7f0e4;border-radius:6px;padding:.85rem 1rem;margin:.5rem 0 1rem;}
.motif-file-row {display:flex;align-items:center;gap:1rem;flex-wrap:wrap;}
.guide-controls .motif-file-box p {font-size:.91rem;margin:.45rem 0 0;}
.motif-file-box #upload-status:empty {display:none;}
#select-upload {display:flex;align-items:center;gap:.6rem;max-width:100%;margin-top:.65rem;padding:.28rem .6rem .28rem .28rem;border:1px solid #bba78a;border-radius:4px;background:white;}
#select-upload[aria-pressed="true"] {border:2px solid #704a30;}
#select-upload span {overflow-wrap:anywhere;text-align:left;}
#select-upload img {width:46px;height:46px;object-fit:contain;}
#upload-preview {margin-right:.55rem;margin-bottom:.4rem;}
#choose-veneer.upload-alternate {color:#4b3223;background:transparent;border-color:#baa68c;}
.surface-category {width:100%;min-height:46px;border:1px solid #a88f72;border-radius:4px;padding:.5rem .85rem;background:#fffcf6;color:#372a1e;font:1rem var(--sans);}
.guide-surface-picks {display:grid;grid-template-columns:repeat(auto-fit,minmax(85px,1fr));gap:.5rem;margin-top:.7rem;}
.surface-pick {border:1px solid #baa88f;background:#fffaf2;padding:.35rem;border-radius:5px;min-width:0;font:600 .91rem/1.3 var(--sans);text-align:left;}
.surface-pick img {width:100%;height:clamp(62px,9vw,104px);object-fit:cover;border-radius:3px;margin-bottom:.3rem;}
.surface-pick[aria-pressed="true"] {outline:2px solid #795131;outline-offset:-2px;}
.upload-note {color:inherit;margin-bottom:1rem;}
.motif-assistant {border:1px solid #ac9271;border-radius:6px;background:#f7f0e3;margin:.75rem 0;}
.guide-controls .motif-assistant summary {min-height:46px;padding:.7rem .85rem;font:650 1rem/1.45 var(--sans);color:#4d3524;}
.assistant-body {border-top:1px solid #d8c8b0;padding:.8rem;}
.assistant-body label {font:600 1rem/1.45 var(--sans);}
.guide-controls .assistant-body p {margin:.4rem 0 .65rem;font-size:.92rem;}
.assistant-body textarea {box-sizing:border-box;width:100%;min-height:66px;resize:vertical;border:1px solid #ac967a;border-radius:4px;padding:.62rem;color:#36291e;background:#fffcf6;font:1rem/1.45 var(--sans);}
.prompt-examples {display:flex;flex-wrap:wrap;gap:.4rem;margin:.5rem 0 .75rem;}
.prompt-examples button {min-height:38px;border:1px solid #c4ac8a;border-radius:20px;background:transparent;color:#503b29;padding:.3rem .65rem;font:.9rem/1.3 var(--sans);}
.draft-options {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem;}
.draft-card {min-width:0;border:1px solid #bca78b;border-radius:4px;background:#fffaf1;color:#463222;padding:.35rem;font:600 .91rem/1.45 var(--sans);}
.draft-card span {display:block;aspect-ratio:1;}
.draft-card svg {width:100%;height:100%;}
.draft-card[aria-pressed="true"],#current-draft[aria-pressed="true"] {outline:2px solid #694627;outline-offset:-2px;}
#draft-heading {display:block;margin:.6rem 0 .4rem;}#assistant-status:empty,.draft-options:empty {display:none;}
