/* Measure and quote: the tool's own styles. Uses the site's colour and type variables, with fallbacks. */
.mq { --mq-ink: var(--ink, #1f2023); --mq-line: var(--line, #ddd5c9); --mq-accent: var(--orange, #f37121); --mq-accent-ink: var(--orange-ink, #a3440a);
  display: grid; gap: 1.1rem; grid-template-areas: "types" "draw" "dims" "answer" "extras" "send"; }
.mq-types { grid-area: types; }
.mq-draw { grid-area: draw; }
.mq-dims { grid-area: dims; }
.mq-answer { grid-area: answer; }
.mq-extras { grid-area: extras; }
.mq-send { grid-area: send; }
@media (min-width: 60rem) {
  .mq { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); grid-template-areas: "draw types" "draw dims" "draw answer" "draw extras" "draw send"; column-gap: 3rem; align-items: start; }
  .mq-draw { position: sticky; top: calc(var(--cb-h-stuck, 3.4rem) + 1.5rem); }
}
.mq fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.mq legend, .mq-label { display: block; margin: 0 0 .55rem; font: 600 .8rem/1.2 var(--head, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--grey-ink, #626366); }

/* door types: a row to swipe on a phone */
.mq-type-row { display: flex; gap: .45rem; overflow-x: auto; padding: .15rem var(--pad, 1rem) .5rem; margin: 0 calc(var(--pad, 1rem) * -1); scrollbar-width: none; }
@media (min-width: 60rem) { .mq-type-row { flex-wrap: wrap; overflow: visible; padding: 0; margin: 0; } }
.mq-type-row label { position: relative; flex: none; display: inline-flex; align-items: center; min-height: 2.9rem; padding: 0 1.05rem; border-radius: 999px; border: 1px solid #c9c0b2; background: var(--card, #fff); color: var(--mq-ink); font-weight: 600; font-size: .97rem; cursor: pointer; white-space: nowrap; transition: background-color .2s, color .2s, border-color .2s; }
.mq-type-row input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mq-type-row label:has(input:checked) { background: var(--char, #1f2023); border-color: var(--char, #1f2023); color: #fff; }
.mq-type-row label:has(input:focus-visible) { outline: 3px solid var(--mq-accent); outline-offset: 2px; }

/* the drawing */
.mq-draw { margin: 0; }
.mq-canvas { border-radius: 14px; overflow: hidden; background: #ebe6de; border: 1px solid var(--mq-line); }
.mq-canvas svg { display: block; width: 100%; height: clamp(15rem, 68vw, 30rem); }
.mq-cap { margin: .55rem 0 0; font-size: .84rem; line-height: 1.4; color: var(--grey-ink, #626366); }
.mq-wall { fill: #ece7df; }
.mq-frame { fill: #2a2b2f; }
.mq-void { fill: #d4dde0; }
.mq-floor { stroke: #8a8378; }
.mq-door { fill: #a35d2b; }
.mq-edge { fill: none; stroke: #3a2110; }
.mq-door.is-fixed { opacity: .82; }
.mq-glass { stroke: #3a2110; }
.mq-inset { fill: none; stroke: rgb(40 20 8 / .45); }
.mq-handle { fill: #c9ced3; stroke: #6f7377; stroke-width: 3; }
.mq-tag { font-family: var(--head, sans-serif); font-weight: 600; fill: rgb(255 255 255 / .85); letter-spacing: .1em; }
.mq-dim { stroke: var(--mq-accent-ink); }
.mq-num { font-family: var(--head, sans-serif); font-weight: 600; fill: var(--mq-accent-ink); letter-spacing: .02em; }
.mq-leaf { stroke: #7a4320; stroke-linecap: round; fill: none; }
.mq-leaf.is-fixed { stroke: #4b3424; }
.mq-swing { stroke: #8a8378; stroke-dasharray: 18 14; fill: none; }
.mq-arrow { stroke: var(--mq-accent-ink); stroke-linecap: round; stroke-linejoin: round; }

/* width and height */
.mq-dims { display: grid; gap: .9rem; }
.mq-dim { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .3rem .8rem; }
.mq-dim .mq-label { grid-column: 1 / -1; margin: 0; }
.mq-dim input[type="range"] { width: 100%; height: 2.75rem; margin: 0; accent-color: var(--mq-accent-ink); background: transparent; }
.mq-num-box { display: inline-flex; align-items: center; gap: .35rem; }
.mq-num-box input { width: 5.6rem; min-height: 2.75rem; padding: .4rem .6rem; border: 1px solid #b9b1a4; border-radius: 10px; font: 600 1.15rem/1 var(--head, sans-serif); letter-spacing: .03em; color: var(--mq-ink); text-align: right; background: #fff; }
.mq-num-box span { font-size: .85rem; color: var(--grey-ink, #626366); }
.mq-how { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--grey-ink, #626366); }

/* the answer */
.mq-answer { padding: 1.15rem 1.15rem 1.2rem; border-radius: 14px; background: var(--char, #1f2023); color: var(--on-dark-2, #b9b7b2); }
.mq-answer .mq-label { color: var(--orange, #f37121); }
.mq-big { margin: 0 0 .45rem; font: 700 clamp(2.2rem, 10vw, 3.2rem)/1 var(--head, sans-serif); text-transform: uppercase; color: #fff; letter-spacing: .01em; }
.mq-detail { margin: 0 0 .5rem; color: var(--on-dark, #f1ede6); font-size: 1rem; line-height: 1.5; }
.mq-notes { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; font-size: .92rem; line-height: 1.45; }
.mq-notes li { padding-left: 1rem; position: relative; }
.mq-notes li::before { content: ""; position: absolute; left: 0; top: .55em; width: .4rem; height: .4rem; background: var(--orange, #f37121); }
.mq-opts { display: grid; gap: .7rem; margin-top: .9rem; }
.mq-opts[hidden] { display: none; }
.mq-group-t { margin: 0 0 .35rem; font-size: .8rem; color: var(--on-dark-2, #b9b7b2); }
.mq-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.mq-chip { min-height: 2.6rem; padding: 0 .9rem; border-radius: 999px; border: 1px solid rgb(255 255 255 / .3); background: transparent; color: #fff; font: 600 .9rem/1 var(--body, sans-serif); cursor: pointer; }
.mq-chip[aria-pressed="true"] { background: var(--orange, #f37121); border-color: var(--orange, #f37121); color: #1a1a1c; }
.mq-chip:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* extras */
.mq-extra-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.mq-extra-row label { position: relative; display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: 0 1rem 0 .8rem; border-radius: 999px; border: 1px solid #c9c0b2; background: var(--card, #fff); font-weight: 600; font-size: .95rem; cursor: pointer; }
.mq-extra-row input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--mq-accent-ink); }
.mq-send .btn { width: 100%; }
@media (min-width: 60rem) { .mq-send .btn { width: auto; } }
.mq-send p { margin: .6rem 0 0; font-size: .88rem; color: var(--grey-ink, #626366); }

/* before the script runs (or without it) the answer box explains itself */
.mq:not(.mq-ready) .mq-big::after { content: "Choose a door"; }
@media (prefers-reduced-motion: no-preference) { .mq-type-row label, .mq-chip { transition: background-color .2s, color .2s, border-color .2s; } }
