/* The email composer (demos/composer.js): a small email app that opens from any
   [data-compose] button and sends to /api/enquiry. Used on the homepage and /base.
   Uses the site tokens (--ink, --line, --orange…), which index.html and demos/site.css define. */
dialog#composer { padding: 0; border: 0; background: transparent; width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: visible; }
dialog#composer::backdrop { background: rgba(11, 11, 11, .55); backdrop-filter: blur(3px); }
.mail { position: relative; background: #fff; border-radius: 14px; overflow: clip; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); display: flex; flex-direction: column; max-height: calc(100dvh - 24px); font-family: var(--sans); }
.mail-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.lights { display: flex; gap: 7px; }
.light { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; display: inline-block; }
.l-close { background: #ff5f57; cursor: pointer; } .l-min { background: #febc2e; } .l-max { background: #28c840; }
.mail-title { flex: 1; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.mail-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.mail-grid { display: grid; overflow-y: auto; min-height: 0; }
.mail-main { display: flex; flex-direction: column; min-width: 0; }
.field { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); min-height: 46px; }
.field > label { width: 58px; flex: none; font-size: 13.5px; color: var(--muted); }
.field input, .from input { flex: 1; min-width: 0; border: 0; outline: 0; font: 15px var(--sans); padding: 12px 0; background: transparent; color: var(--ink); }
.from { flex: 1; display: flex; gap: 10px; min-width: 0; flex-wrap: wrap; }
.from input { flex: 1 1 140px; }
.field:focus-within { background: #fffaf5; }
.to-chip { font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.body-wrap { padding: 16px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.body-wrap textarea { width: 100%; min-height: 230px; flex: 1; border: 0; outline: 0; resize: vertical; font: 15.5px/1.6 var(--serif); color: var(--ink); background: transparent; padding: 0; }
.added { white-space: pre-wrap; font: 14.5px/1.6 var(--serif); border-left: 3px solid var(--orange); background: #fff7ef; border-radius: 0 10px 10px 0; padding: 10px 14px; margin-top: 10px; }
.sig { white-space: pre-wrap; font: 15.5px/1.6 var(--serif); margin-top: 12px; }
.hp { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mail-side { background: var(--surface); border-top: 1px solid var(--line); padding: 18px; }
.side-h { font-weight: 600; font-size: 15px; margin: 0; }
.side-note { font-size: 13px; color: var(--muted); margin: 2px 0 12px; }
.picks { border: 0; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.picks legend { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 8px; }
.pick { cursor: pointer; position: relative; }
.pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.pick span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--line); transition: background .12s, border-color .12s; }
.pick span::before { content: "+"; color: var(--muted); font-weight: 600; }
.pick:hover span { border-color: var(--ink); }
.pick input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pick input:checked + span::before { content: "✓"; color: var(--orange); }
.pick input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.budget { border-top: 1px solid var(--line); padding-top: 12px; }
.budget summary { cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.budget summary::-webkit-details-marker { display: none; }
.budget summary span { font-weight: 500; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.budget summary::after { content: "+"; color: var(--muted); margin-left: 10px; }
.budget[open] summary::after { content: "−"; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin: 12px 0 16px; }
.seg label { cursor: pointer; position: relative; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; font-size: 13px; padding: 7px 4px; border-radius: 7px; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--orange); }
#c-range { --fill: 0%; width: 100%; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--orange) var(--fill), #dcd8d1 var(--fill)); outline: none; }
#c-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); cursor: pointer; }
#c-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); cursor: pointer; }
.range-out { margin-top: 10px; font-size: 14px; }
.range-out b { display: block; font-size: 16px; }
.range-out span { color: var(--muted); font-size: 12.5px; }
.mail-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fff; }
.mail-foot .btn { padding: 10px 20px; cursor: pointer; }
.send { border: 0; }
.send:disabled { opacity: .6; cursor: wait; }
.status { margin: 0; font-size: 13.5px; color: var(--orange-text); flex: 1 1 200px; }
.status a { color: inherit; }
.fine { margin: 0 0 0 auto; font-size: 12.5px; color: var(--muted); }
.sent { position: absolute; inset: 0; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; }
.sent[hidden] { display: none; }
.sent h3 { font-size: 24px; margin: 14px 0 6px; }
.sent p { color: var(--muted); margin: 0 0 20px; font-family: var(--serif); }
.sent-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; }
.sent-ico svg { width: 28px; height: 28px; color: var(--ink); stroke-width: 2.6; }
button.btn { font-family: var(--sans); }
@media (min-width: 760px) {
  .mail-grid { grid-template-columns: 1fr 320px; overflow: hidden; height: min(640px, calc(100dvh - 140px)); }
  .mail-main { overflow-y: auto; }
  .mail-side { overflow-y: auto; border-top: 0; border-left: 1px solid var(--line); }
}
/* The homepage's look, which these rules shared with its old inline demo (same class names);
   kept so the composer looks the same on every page. */
.mail { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 14.5px; line-height: 1.5; transition: opacity .4s, transform .4s; }
.mail p { margin: 0 0 8px; }
.mail p:last-child { margin: 0; color: var(--muted); }
.mail.done { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; font: 14px var(--sans); }
@media (prefers-reduced-motion: reduce) { .mail { transition: none; } }
