/* Midah virtual measurements. Mobile first. */
.measure-page { background: var(--cream); }
.measure-page .wa-float, .measure-page .announce { display: none; }

.mz-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 12px; border-bottom: 1px solid var(--line); background: var(--cream); }
.mz-top .logo { transform: scale(.82); transform-origin: left center; }
.mz-help { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; color: var(--ink); border: 1px solid var(--line); padding: .8em 1.1em; border-radius: 40px; white-space: nowrap; }
.mz-help:hover { border-color: var(--ink); }

.mz { max-width: 1060px; margin: 0 auto; padding: 26px 18px calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--ink); }
.mz [hidden] { display: none !important; }

/* Intro */
.mz-kicker { margin: 0 0 6px; font-size: .9rem; color: var(--ink-soft); }
.mz-kicker:empty { display: none; }
.mz-title { font-family: var(--serif); font-weight: 500; font-size: clamp(2.1rem, 8vw, 3.2rem); line-height: 1.05; margin: 0 0 12px; }
.mz-lead { font-size: 1.02rem; line-height: 1.6; color: var(--ink-soft); margin: 0 0 18px; max-width: 46ch; }
.mz-note { margin: 0 0 18px; padding: 14px 16px; border-left: 3px solid var(--gold); background: var(--white); font-size: .98rem; line-height: 1.55; white-space: pre-line; }
.mz-tips { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 8px; }
.mz-tips li { position: relative; padding: 12px 14px 12px 40px; background: var(--white); border: 1px solid var(--line); font-size: .93rem; line-height: 1.45; color: var(--ink-soft); }
.mz-tips li::before { content: ""; position: absolute; left: 16px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.mz-tips strong { color: var(--ink); font-weight: 500; }

/* Layout */
.mz-shell { display: block; }
.mz-figure { display: none; }
.mz-has-fig .mz-figure {
	display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 5;
	margin: 0 -18px 14px; padding: 8px 18px; background: rgba(248, 244, 238, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.mz-svg { width: 72px; height: 158px; flex: none; }
.mz-figure-label { margin: 0; font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; }

.mz-body > * { fill: var(--sand-deep); }
.mz-floor { stroke: var(--line); stroke-width: 1.5; }
.mz-lines > * { fill: none; stroke: var(--gold-soft); stroke-width: 1.6; opacity: .45; stroke-linecap: round; stroke-linejoin: round; transition: opacity .2s, stroke .2s, stroke-width .2s; }
.mz-lines > .on { stroke: var(--ink); stroke-width: 3; opacity: 1; stroke-dasharray: 6 3; animation: mz-dash 1s linear infinite; }
@keyframes mz-dash { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: reduce) { .mz-lines > .on { animation: none; } }

/* Form */
.mz-form { background: var(--white); border: 1px solid var(--line); padding: 20px 16px 18px; }
.mz-progress { height: 3px; background: var(--sand); margin: -20px -16px 16px; }
.mz-progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .35s; }
.mz-stepcount { margin: 0 0 4px; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.mz-step { border: 0; padding: 0; margin: 0; min-width: 0; }
.mz-step-title { padding: 0; font-family: var(--serif); font-size: 1.9rem; font-weight: 500; line-height: 1.1; margin: 0 0 4px; }
.mz-step-sub { margin: 0 0 6px; color: var(--ink-soft); font-size: .95rem; }

.mz-field { margin: 18px 0 0; }
.mz-field > label, .mz-label { display: block; font-size: .95rem; font-weight: 500; margin: 0 0 7px; }
.mz-opt { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.mz-field input[type=text], .mz-field input[type=tel], .mz-field input[type=email], .mz-field input[type=number], .mz-field textarea {
	width: 100%; box-sizing: border-box; min-height: 50px; padding: 12px 14px; font: 16px/1.4 var(--sans); color: var(--ink);
	background: var(--cream); border: 1px solid var(--line); border-radius: 4px; -webkit-appearance: none; appearance: none;
}
.mz-field textarea { min-height: 110px; resize: vertical; }
.mz-field input:focus, .mz-field textarea:focus { outline: none; border-color: var(--ink); background: var(--white); box-shadow: 0 0 0 3px rgba(176, 141, 87, .25); }
.mz-num { position: relative; max-width: 220px; }
.mz-num input { padding-right: 50px !important; font-size: 1.15rem !important; }
.mz-u { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-size: .95rem; pointer-events: none; }
.mz-num input::-webkit-outer-spin-button, .mz-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mz-num input[type=number] { -moz-appearance: textfield; }
.mz-hint { margin: 7px 0 0; font-size: .88rem; line-height: 1.5; color: var(--ink-soft); }
.mz-msg { margin: 6px 0 0; font-size: .86rem; line-height: 1.4; }
.mz-msg:empty { display: none; }
.mz-msg.is-err { color: #a3261b; }
.mz-msg.is-warn { color: #8a5a00; }
.mz-m:has(.is-err) input { border-color: #a3261b; }
.mz-m:has(.is-warn) input { border-color: #c99a3b; }
.mz-small { font-size: .85rem; line-height: 1.5; color: var(--ink-soft); margin: 10px 0 0; }

/* Units toggle */
.mz-units { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 0; }
.mz-units > span { font-size: .95rem; font-weight: 500; margin-right: 4px; width: 100%; }
.mz-units label { flex: 1 1 0; min-width: 120px; }
.mz-units input { position: absolute; opacity: 0; pointer-events: none; }
.mz-units label span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line); border-radius: 4px; font-size: .95rem; cursor: pointer; background: var(--cream); }
.mz-units input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.mz-units input:focus-visible + span { box-shadow: 0 0 0 3px rgba(176, 141, 87, .4); }

/* Choices */
.mz-choices { display: grid; gap: 8px; }
.mz-choice { position: relative; display: block; cursor: pointer; }
.mz-choice input { position: absolute; opacity: 0; }
.mz-choice span { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--cream); font-size: .96rem; }
.mz-choice span::before { content: ""; width: 18px; height: 18px; flex: none; border: 1.5px solid var(--ink-soft); border-radius: 50%; }
.mz-choice input:checked + span { border-color: var(--ink); background: var(--white); }
.mz-choice input:checked + span::before { border: 6px solid var(--ink); }
.mz-choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(176, 141, 87, .4); }

/* Photos */
.mz-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mz-photo { cursor: pointer; display: block; }
.mz-photo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mz-photo-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; aspect-ratio: 3 / 4; border: 1.5px dashed var(--gold-soft); border-radius: 4px; background: var(--cream) center / cover no-repeat; font-size: .9rem; color: var(--ink-soft); text-align: center; padding: 8px; }
.mz-photo-box svg { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.5; }
.mz-photo-box.has-img { border-style: solid; border-color: var(--ink); color: transparent; }
.mz-photo-box.has-img svg { display: none; }
.mz-photo input:focus-visible + .mz-photo-box { box-shadow: 0 0 0 3px rgba(176, 141, 87, .4); }

/* Review */
.mz-rv-group { border-top: 1px solid var(--line); padding: 14px 0 6px; margin-top: 14px; }
.mz-rv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mz-rv-head h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.mz-rv-head a { font-size: .85rem; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 8px 0 8px 12px; }
.mz-review dl { margin: 6px 0 0; }
.mz-review dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px dotted var(--line); font-size: .95rem; }
.mz-review dt { color: var(--ink-soft); }
.mz-review dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* Buttons */
.mz-error { margin: 16px 0 0; padding: 12px 14px; background: #fbeeee; color: #8a1f16; font-size: .93rem; border-radius: 4px; }
.mz-nav { display: flex; gap: 10px; margin: 22px 0 0; position: sticky; bottom: 0; z-index: 4; background: var(--white); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.mz-nav .btn { flex: 1; min-height: 52px; padding: 1em 1.2em; }
.mz-nav [data-mz-back] { flex: 0 0 auto; }
.mz-nav .btn[disabled] { opacity: .6; cursor: progress; }
.mz-saved { margin: 10px 0 0; font-size: .82rem; color: var(--ink-soft); text-align: center; }
.mz-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; }

/* Done */
.mz-done { text-align: center; max-width: 520px; margin: 30px auto; background: var(--white); border: 1px solid var(--line); padding: 36px 22px; }
.mz-tick { width: 60px; height: 60px; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.mz-done h2 { font-family: var(--serif); font-weight: 500; font-size: 2.1rem; margin: 12px 0 8px; }
.mz-done p { color: var(--ink-soft); line-height: 1.6; }
.mz-done-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.mz-keep { font-size: .88rem; overflow-wrap: anywhere; }
.mz-keep a { color: var(--ink); text-decoration: underline; }

/* Tablet and up */
@media (min-width: 760px) {
	.mz { padding: 44px 32px 70px; }
	.mz-top { padding-left: 32px; padding-right: 32px; }
	.mz-top .logo { transform: none; }
	.mz-tips { grid-template-columns: 1fr 1fr; }
	.mz-form { padding: 34px 36px 24px; }
	.mz-progress { margin: -34px -36px 22px; }
	.mz-done-actions { flex-direction: row; justify-content: center; }
	.mz-photos { max-width: 360px; }
	.mz-choices { grid-template-columns: repeat(3, 1fr); }
	.mz-nav { position: static; border-top: 0; padding-bottom: 0; }
	.mz-nav .btn { flex: 0 0 auto; }
	.mz-nav [data-mz-next] { margin-left: auto; min-width: 220px; }
}
@media (min-width: 960px) {
	.mz-shell { display: grid; grid-template-columns: 260px 1fr; gap: 34px; align-items: start; }
	.mz-figure, .mz-has-fig .mz-figure { display: flex; flex-direction: column; align-items: center; position: sticky; top: 24px; margin: 0; padding: 24px 16px; background: var(--white); border: 1px solid var(--line); backdrop-filter: none; }
	.mz-svg { width: 190px; height: 418px; }
	.mz-figure-label { text-align: center; margin-top: 10px; font-size: 1.3rem; min-height: 2.4em; }
	.mz-on-review .mz-figure { opacity: .5; }
}
