/* KynWorks free tools with a 3D view: stand configurator + packaging folding (loaded after blog.css + tools.css) */

/* layout: narrow controls, wide viewer; viewer first on phones */
.tool--3d { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); }
.tool--3d .tool__out { align-content: start; }
.v3d-sticky { position: sticky; top: 14px; display: grid; gap: 12px; }
@media (max-width: 900px) {
  .tool--3d { grid-template-columns: minmax(0, 1fr); }
  .tool--3d .tool__out { order: -1; border-bottom: 1px solid var(--line); }
  .tool--3d .tool__in { border-inline-end: 0; border-bottom: 0; }
  .v3d-sticky { position: static; }
}

/* 3D viewport */
.v3d { position: relative; width: 100%; aspect-ratio: 16 / 11; min-height: 300px; max-height: 72vh; border-radius: 18px; overflow: hidden; background: #EFEBE5; box-shadow: inset 0 0 0 1px var(--line); }
.v3d canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.v3d canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--red); }
.v3d.s3d--drag canvas { cursor: grabbing; }
.v3d > .msg { position: absolute; inset: auto 12px 12px; }
.v3d--fold { aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 40%, #fff, #EDE8E1); }
@media (max-width: 700px) { .v3d { aspect-ratio: 4 / 3.4; min-height: 260px; border-radius: 14px; } }
.v3d__bar { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; pointer-events: none; }
.v3d__bar > * { pointer-events: auto; }
.v3d__bar .seg button { min-height: 36px; padding: 6px 12px; font-size: 13px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.v3d__bar .seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.v3d__hint { position: absolute; bottom: 10px; inset-inline-end: 12px; margin: 0; font-size: 12px; color: #6E6862; background: rgba(255, 255, 255, .85); padding: 4px 10px; border-radius: 999px; pointer-events: none; }
@media (max-width: 520px) { .v3d__hint { display: none; } }
.v3d__load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.v3d canvas + .v3d__load, .v3d--ok .v3d__load { display: none; }

/* selection bar (stand) */
.ssel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; background: #fff; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); min-height: 64px; }
.ssel__hint { margin: 0; font-size: 14px; color: var(--muted); }
.ssel__n { font-size: 15px; }
.ssel__g { display: flex; align-items: center; gap: 6px; }
.ssel__r { min-width: 42px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.ssel__s { display: grid; gap: 2px; flex: 1 1 180px; font-size: 13px; color: var(--muted); }
.ssel__s b { color: var(--ink); }
.ssel input[type="range"], .fctl input[type="range"] { width: 100%; accent-color: var(--red); min-height: 32px; }
.ssel .icbtn { width: 40px; height: 40px; font-size: 20px; }

/* add-element grid + placed list */
.kadd { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kadd button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 14px; border: 0; background: #F1EEE9; font-size: 13.5px; font-weight: 600; text-align: start; cursor: pointer; line-height: 1.25; transition: background .2s, color .2s; }
.kadd button svg { flex: none; color: var(--red); }
.kadd button:hover:not(:disabled) { background: var(--ink); color: #fff; }
.kadd button:hover:not(:disabled) svg { color: #fff; }
.kadd button:disabled { opacity: .45; cursor: not-allowed; }
.cnt { font-size: 12.5px; font-weight: 700; color: var(--muted); background: #F1EEE9; padding: 2px 10px; border-radius: 999px; letter-spacing: 0; text-transform: none; }
.slist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.slist li { display: flex; gap: 6px; }
.slist__b { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 42px; padding: 6px 12px; border-radius: 12px; border: 0; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 600; cursor: pointer; text-align: start; }
.slist__b small { color: var(--muted); font-weight: 500; }
.slist__b.on { box-shadow: inset 0 0 0 2px var(--red); }
.slist__x { width: 42px; border-radius: 12px; border: 0; background: #F1EEE9; font-size: 20px; cursor: pointer; }
.slist__x:hover { background: var(--red); color: #fff; }
.slist__none { font-size: 14px; color: var(--muted); }

/* colour swatches */
.sws { display: flex; flex-wrap: wrap; gap: 8px; }
.sw2 { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.sw2[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.seg--sm button { min-height: 38px; padding: 6px 12px; font-size: 13.5px; }
.colrow { display: flex; align-items: center; gap: 10px; }
.colrow .inp[type="color"] { width: 64px; flex: none; }

/* quote step (stand) */
.squote { margin-top: clamp(22px, 3vw, 34px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); background: #fff; border-radius: 24px; box-shadow: 0 0 0 2px var(--red), 0 30px 70px -45px rgba(227, 0, 0, .45); overflow: hidden; }
.squote__l { padding: clamp(20px, 3vw, 36px); background: var(--ink); color: #fff; display: grid; gap: 14px; align-content: start; }
.squote__l h2 { margin: 0; font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; line-height: 1.15; }
.squote__l p { margin: 0; color: rgba(255, 255, 255, .8); }
.squote__l ul { margin: 0; padding-inline-start: 1.1em; display: grid; gap: 6px; color: rgba(255, 255, 255, .88); font-size: 14.5px; }
.squote__l li::marker { color: var(--red); }
.squote__l .stats .stat { background: rgba(255, 255, 255, .07); box-shadow: none; color: #fff; }
.squote__l .stats .stat span { color: rgba(255, 255, 255, .7); }
.squote__l .stats .stat--red { background: var(--red); }
.squote__r { padding: clamp(20px, 3vw, 36px); display: grid; gap: 14px; align-content: start; }
.sform { display: grid; gap: 12px; }
.sform .row--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .sform .row--2 { grid-template-columns: 1fr; } }
.req { color: var(--red); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.sdone .msg { font-size: 15.5px; padding: 16px 18px; }
@media (max-width: 860px) { .squote { grid-template-columns: minmax(0, 1fr); } }

/* packaging: model cards, locked models, legend, locked exports */
.mcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mcard { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 4px 10px; padding: 10px 12px; min-height: 64px; border-radius: 14px; border: 0; background: #F1EEE9; text-align: start; cursor: pointer; transition: background .2s, color .2s; }
.mcard svg { grid-row: span 2; color: var(--red); }
.mcard b { font-size: 13.5px; line-height: 1.2; }
.mcard small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.mcard:hover { background: #E6E1DA; }
.mcard[aria-pressed="true"] { background: var(--ink); color: #fff; }
.mcard[aria-pressed="true"] svg, .mcard[aria-pressed="true"] small { color: #fff; }
.locks { display: flex; flex-wrap: wrap; gap: 6px; }
.lock { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fff; box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; }
.lock svg { flex: none; }
.lock:hover { color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.lock--more { color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }
.fctl { display: flex; align-items: center; gap: 12px; }
.fctl .tbtn { flex: none; min-width: 104px; }
.fctl output { min-width: 48px; text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.fsvg { background: #fff; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); padding: 8px; }
.fsvg svg { display: block; width: 100%; height: auto; max-height: 520px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 26px; height: 0; vertical-align: middle; margin-inline-end: 6px; border-top: 2px solid #111; }
.legend i.cr { border-top: 2px dashed var(--red); }
.legend i.gl { height: 10px; border: 0; background: repeating-linear-gradient(45deg, rgba(227, 0, 0, .25) 0 3px, transparent 3px 8px); }
.lockbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.lockbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: #8b847c; background: #F1EEE9; text-decoration: none; }
.lockbtn:hover { color: #fff; background: var(--red); }
.upsell { display: grid; gap: 10px; padding: 16px 18px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--red); }
.upsell p { margin: 0; font-size: 14.5px; }
.upsell ul { margin: 0; padding-inline-start: 1.1em; font-size: 14px; color: #3a3631; display: grid; gap: 3px; }
.upsell li::marker { color: var(--red); }
.upsell__t { font-weight: 800; font-size: 16px !important; }
@media (prefers-reduced-motion: reduce) { .kadd button, .mcard { transition: none; } }
#fStats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
#fStats .stat b { font-size: clamp(18px, 1.8vw, 22px); }

/* stand: 3D view + side palette of elements (2026-11-21) */
.sstage { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 10px; align-items: stretch; }
.spal { display: flex; flex-direction: column; gap: 6px; min-height: 0; max-height: 72vh; padding: 10px; background: #fff; border-radius: 18px; box-shadow: 0 0 0 1px var(--line); }
.spal__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.spal__t { margin: 0; font-weight: 800; font-size: 14px; }
.spal__h { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.35; }
.kadd--side { grid-template-columns: 1fr; overflow-y: auto; padding-inline-end: 2px; flex: 1 1 auto; min-height: 0; }
.kadd--side button { min-height: 44px; padding: 6px 10px; font-size: 12.5px; gap: 8px; cursor: grab; }
.kadd--side button:active { cursor: grabbing; }
.v3d.s3d--drop { box-shadow: inset 0 0 0 3px var(--red); }
.v3d__tip { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 3; margin: 0; max-width: min(92%, 520px); padding: 9px 14px;
  border-radius: 14px; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4; text-align: center; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
  pointer-events: none; animation: tipIn .5s ease both; }
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 1100px) {
  .sstage { grid-template-columns: minmax(0, 1fr); }
  .spal { max-height: none; }
  .kadd--side { grid-auto-flow: column; grid-auto-columns: 150px; grid-template-columns: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) { .v3d__tip { animation: none; } }

/* model search (fold-search.js, 2026-11-24): rectangular field, results as rows, no pills */
.msearch { position: relative; display: flex; align-items: center; margin: 2px 0 0; }
.msearch > svg { position: absolute; inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.msearch__in { width: 100%; min-height: 44px; padding: 10px 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14.5px; color: var(--ink); -webkit-appearance: none; appearance: none; }
.msearch__in::-webkit-search-cancel-button { display: none; }
.msearch__in:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 17, .08); }
.msearch__x { position: absolute; inset-inline-end: 6px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.msearch__x:hover { background: #F1EEE9; color: var(--ink); }
.msearch__msg { margin: 0; font-size: 12.5px; color: var(--muted); min-height: 0; }
.msearch__msg:empty { display: none; }
.mcard[hidden], .locks[hidden], .mcards[hidden], #fSoft[hidden], .note[hidden], .msearch__empty[hidden] { display: none; }
#fSoft { display: grid; gap: 8px; }
#fSoft .note { margin: 0; }
.mres { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mres__i { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.mres__i svg { flex: none; color: var(--muted); }
.mres__i span { display: grid; min-width: 0; }
.mres__i b { font-size: 13px; font-weight: 600; line-height: 1.25; }
.mres__i small { font-size: 11.5px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mres__i:hover, .mres__i:focus-visible { box-shadow: inset 0 0 0 1.5px var(--red); }
.mres__i:hover svg, .mres__i:focus-visible svg { color: var(--red); }
.mres__more { grid-column: 1 / -1; padding: 8px 2px 0; font-size: 13px; font-weight: 600; color: var(--red); text-decoration: none; }
.mres__more:hover { text-decoration: underline; }
.msearch__empty { margin: 0; padding: 14px; border-radius: 10px; background: #F1EEE9; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.msearch__empty a { color: var(--red); font-weight: 600; }
@media (max-width: 520px) { .mres { grid-template-columns: 1fr; } }
.msearch__x[hidden] { display: none; }
.msearch__msg--sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
