:root{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN",sans-serif;color:#62535a;background:#faf7f3;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.4;cursor:default}button:focus-visible,canvas:focus-visible{outline:3px solid #a65371;outline-offset:4px}.stitch-app{width:min(100%,470px);margin:auto;padding:6px 8px calc(14px + env(safe-area-inset-bottom))}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px}.cast-button{display:flex;align-items:center;gap:9px;background:none;border:0;padding:0;font-size:13px}.cast-button img{object-fit:contain;border-radius:50%;background:#f0e4df}.icon-button{display:flex;align-items:center;gap:6px;border:0;background:none;padding:8px;font-size:12px}.icon-button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.5}.progress-row{display:flex;align-items:center;gap:12px;margin:9px 3px 0}progress{appearance:none;border:0;border-radius:4px;height:4px;flex:1;background:#eae2dd;overflow:hidden}progress::-webkit-progress-bar{background:#eae2dd}progress::-webkit-progress-value{background:#ad7e89;border-radius:4px}progress::-moz-progress-bar{background:#ad7e89}output{font-size:11px;min-width:32px;text-align:right;font-variant-numeric:tabular-nums}.hoop-wrap{position:relative;margin:24px auto 10px;width:min(100%,53svh,420px);aspect-ratio:1}.hoop-wrap:before{content:"";position:absolute;top:-12px;left:calc(50% - 19px);width:38px;height:24px;background:linear-gradient(90deg,#b79873,#e0c59c 35%,#b79873);border:1px solid #b39470;border-radius:4px}.hoop{position:absolute;inset:0;border:8px solid #c9a77f;border-radius:50%;background:#faf4e9;box-shadow:inset 0 0 0 3px #e4c9a3,0 3px 0 #b6916c,0 9px 20px #856e4a12;overflow:hidden}canvas#cloth{display:block;width:100%;height:100%;touch-action:none;transform-origin:0 0}.loading{position:absolute;inset:0;display:grid;place-content:center;font-size:13px;pointer-events:none;background:#faf4e9d9;border-radius:50%;margin:12px}.loading[hidden]{display:none}.status{text-align:center;font-size:12px;min-height:18px;margin:12px 0;color:#8f7780}.threads{display:flex;justify-content:center;flex-wrap:wrap;gap:7px;max-width:400px;margin:auto}.thread{position:relative;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:2px solid transparent;border-radius:11px;background:transparent;padding:4px}.thread[aria-pressed=true]{border-color:#ad7e89;background:#f0e4e5}.thread:before{content:"";position:absolute;inset:6px 9px;border-radius:4px;background:var(--thread);box-shadow:0 -3px 0 #d8bda1,0 3px 0 #d8bda1}.thread span{position:relative;font-size:14px;font-weight:700;color:var(--ink)}.thread.done{opacity:.4}.bottom-tools{display:flex;justify-content:center;gap:12px;margin:15px 0 0}.tool{border:1px solid #e4dad5;border-radius:22px;background:#fffaf6;padding:10px 16px;font-size:12px;min-height:44px}.tool[aria-pressed=true]{background:#eee1e5;border-color:#bd99a5}.storage-note,.album-note{font-size:11px;line-height:1.7;color:#967c85;text-align:center}dialog{width:min(calc(100% - 32px),420px);max-height:80svh;border:0;border-radius:24px;padding:20px;background:#fffaf6;color:#62535a;box-shadow:0 20px 80px #4b303330}dialog::backdrop{background:#42323a66;backdrop-filter:blur(4px)}.dialog-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}h2{font-size:17px;margin:0;font-weight:600}.close{border:0;background:none;font-size:26px;width:40px;height:40px}.cast-list{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.cast-choice{border:1px solid #eadfd7;background:#faf4ef;border-radius:16px;padding:10px 4px;display:grid;justify-items:center;gap:5px;font-size:11px}.cast-choice[aria-pressed=true]{border:2px solid #b98d9a}.cast-choice img{width:74px;height:74px;max-width:100%;object-fit:contain}.works{display:grid;grid-template-columns:1fr 1fr;gap:14px}.work-card{border:0;background:#f5eee5;border-radius:18px;padding:12px 7px;font-size:12px;display:grid;gap:9px;justify-items:center}.work-card canvas{width:100%;height:auto;border:5px solid #c9a77f;border-radius:50%}.empty{grid-column:1/-1;text-align:center;font-size:13px;padding:25px 0}#completed{text-align:center;padding:22px 20px 30px}.result-close{position:absolute;right:9px;top:7px}.result-mark{font-size:42px;color:#b58d74;margin:4px}.result-actions{display:flex;justify-content:center;gap:12px;margin-top:24px}.primary{background:#a77485;color:white;border:0;border-radius:22px;padding:11px 22px;font-size:13px}@media(max-height:700px){.hoop-wrap{width:min(100%,48svh);margin-top:19px}.thread{height:44px;width:44px}.bottom-tools{margin-top:10px}.status{margin:8px 0}}@media(prefers-reduced-motion:no-preference){.thread{transition:border-color .15s,background .15s}.hoop{animation:arrive .35s ease-out}@keyframes arrive{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}}

.zoom-button{position:absolute;right:0;bottom:0;display:grid;place-items:center;width:44px;height:44px;border:1px solid #e4dad5;border-radius:50%;background:#fffaf6;color:#826470}.zoom-button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6}.zoom-button[aria-pressed=true]{background:#eee1e5;border-color:#bd99a5}#completed-art{display:block;width:min(100%,44svh);height:auto;aspect-ratio:1;margin:16px auto 0;border:9px solid #c9a77f;border-radius:50%}.threads{gap:4px}.bottom-tools{flex-wrap:wrap}

/* Quiet craft table: material, thread progress and tools stay beside the hoop. */
.hoop{border-color:#c8a079;box-shadow:inset 0 0 0 3px #ecd4ae,0 2px 0 2px #b88d65,0 9px 22px #78583c16}
.brush-button{left:0;right:auto}.brush-button[aria-pressed=true]{background:#eee1e5;border-color:#a77485;box-shadow:0 0 0 2px #fffaf6}
.material-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;max-width:374px;margin:0 auto 6px}.thread-status{display:flex;gap:7px;align-items:center;font-size:12px;color:#80626c;font-variant-numeric:tabular-nums}#thread-dot{width:10px;height:10px;border-radius:50%;box-shadow:inset 0 0 0 1px #0001}.fabrics{display:flex;gap:2px}.fabric-choice{position:relative;width:40px;height:40px;border:0;background:none;border-radius:50%;padding:7px}.fabric-choice:before{content:"";display:block;width:26px;height:26px;border-radius:50%;background:repeating-linear-gradient(0deg,#967c6618 0 1px,transparent 1px 4px),var(--fabric);border:1px solid #bba59566}.fabric-choice[aria-pressed=true]{box-shadow:inset 0 0 0 1.5px #a77485}.fabric-choice[aria-pressed=true]:after{content:"✓";position:absolute;inset:0;display:grid;place-items:center;font-size:13px;color:#775161}.thread:after{content:"";position:absolute;bottom:0;left:8px;right:8px;height:2px;border-radius:2px;background:linear-gradient(to right,#a77485 var(--filled),#ded1cb var(--filled))}.thread.done:after{background:#a77485}.work-card{background:linear-gradient(145deg,#fffaf5,#f2e8de);border:1px solid #e8d9cb}.status{margin:8px 0 2px}#completed .result-mark{font-size:26px;margin:0}#completed-art{box-shadow:0 2px 0 #b88d65,0 8px 18px #78583c12}

@media(max-height:720px){.hoop-wrap{width:min(100%,42svh);margin-top:16px}.material-bar{margin-bottom:2px}.bottom-tools{margin-top:8px}.status{margin:6px 0 0}}
@media(max-height:660px){.stitch-app{padding-top:2px}.hoop-wrap{width:min(100%,38svh);margin-top:14px}}

#difficulty{font:inherit;font-size:11px;min-height:44px;max-width:135px;border:1px solid #e4dad5;border-radius:12px;background:#fffaf6;color:inherit;padding:4px}.toolbar{gap:6px}.cast-button{min-width:0;gap:5px}.cast-button #cast-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cast-button img{flex-shrink:0}.pan-button{top:0;bottom:auto;left:0;right:auto;font-size:11px}.zoom-button{font-size:14px;font-weight:600}#difficulty:focus-visible{outline:3px solid #a65371;outline-offset:2px}

/* Four thumb-sized tools sit in the unused corners around the hoop. */
.zoom-out-button{top:0;bottom:auto;font-size:24px;font-weight:400}
#zoom{font-size:12px;font-variant-numeric:tabular-nums}
.zoom-button{box-shadow:0 2px 7px #78583c0c}
.pan-button[aria-pressed=true]{background:#a77485;border-color:#a77485;color:#fff;box-shadow:0 0 0 3px #fffaf6,0 2px 8px #a7748530}
.cast-progress{font-size:10px;color:#9a6e7e;font-weight:500;line-height:1.4}
.completed-detail{display:inline-block;font-size:11px;color:#916b78;border:1px solid #e7d7d9;border-radius:20px;margin:0;padding:5px 12px}
#completed-name{margin:10px 0 7px}
.cast-button{min-height:44px;flex:1}.icon-button{flex-shrink:0;min-height:44px}.toolbar select{flex-shrink:0}
@media(prefers-reduced-motion:no-preference){.zoom-button{transition:background .15s,border-color .15s,box-shadow .15s}}


/* Spend the height freed by material controls on the embroidery itself. */
.hoop-wrap{width:min(100%,var(--hoop-size,max(260px,calc(100svh - 290px))),420px);margin-top:16px;margin-bottom:6px}
.material-bar{justify-content:center;margin:2px auto 6px;min-height:18px}
.thread-status{white-space:nowrap}
.bottom-tools{gap:6px;margin-top:8px}
.bottom-tools .tool{padding:10px;min-width:44px}
#fabric-picker{width:min(calc(100% - 32px),280px)}
#fabric-picker .fabrics{justify-content:center;gap:16px}
#fabric-picker .fabric-choice{width:48px;height:48px;padding:11px}
#threads[data-changed=true] .thread[aria-pressed=true]{outline:2px solid #a77485;outline-offset:1px;background:#eee1e5}
.hoop-wrap[data-moving=true] .hoop{border-color:#a77485}
@media(max-width:350px){.bottom-tools{gap:4px}.bottom-tools .tool{padding-inline:8px}}
