/* MF Trim Order App, base layer (structure, sizes, print). mf.css is the brand skin on top, account.css after it.
   Phone rules: body 16px, nothing read on screen under 15px, controls 44px or taller (primary 48-56px).
   Print tickets and submittal sheets keep their own small sizes on paper. */
:root {
  --blue: #0B6FAE; --blue-d: #095C91; --blue-l: #E1F3FC;
  --ink: #0b0b0c; --ink2: #3a3d44; --mute: #5a6069; --line: #c9ced6; --bg: #f4f5f7; --card: #fff;
  --ok: #0E7A4A; --ok-l: #e3f5ea; --bad: #C62E22; --bad-l: #fdecec; --warn: #8A5F00; --warn-l: #fff4e0;
  --r: 12px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
.hidden { display: none !important; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .02em; }
.brand .mk { width: 34px; height: 34px; border-radius: 8px; background: var(--blue); display: grid; place-items: center; font-weight: 900; font-size: 15px; }
.brand small { display: block; font-weight: 500; color: #b9bdc6; font-size: 15px; letter-spacing: 0; }
.top .sp { flex: 1; }
.top .tb { background: transparent; border: 1px solid #6b707a; color: #fff; padding: 0 12px; min-height: 44px; border-radius: 8px; font-size: 15px; }

/* steps (sticky under the header; JS sets --hdr-h on :root) */
.steps { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: var(--hdr-h, 65px); z-index: 15; }
.steps button { flex: 1; border: 0; background: none; min-height: 48px; padding: 12px 4px 10px; font-size: 15px; font-weight: 600; color: var(--mute); border-bottom: 3px solid transparent; }
.steps button.on { color: var(--ink); border-color: var(--blue); }
.steps .ct { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 11px; background: var(--bad); color: #fff; font-size: 15px; line-height: 22px; }
.steps .ct.ok { background: var(--ok); }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(120px + env(safe-area-inset-bottom)); }
h1 { font-size: 26px; margin: 4px 0 12px; }
h2 { font-size: 20px; margin: 20px 0 10px; }
h3 { font-size: 17px; margin: 14px 0 8px; }
.sub { color: var(--mute); font-size: 15px; margin: -6px 0 14px; }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; border: 1px solid #eceef2; }

/* fields */
.fld { margin-bottom: 14px; }
.fld > label, .fld > .lbl { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.fld .req { color: var(--bad); margin-left: 2px; }
.fld .help { font-size: 15px; color: var(--mute); margin-top: 5px; }
.fld.missing > label, .fld.missing > .lbl { color: var(--bad); }
.fld.missing input, .fld.missing select, .fld.missing textarea { border-color: var(--bad); background: #fffafa; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=number], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; border: 1.5px solid #7a8591; border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 16px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-l); }
.unit-wrap { position: relative; }
.unit-wrap .u { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--mute); font-size: 15px; pointer-events: none; }
.unit-wrap input { padding-right: 48px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.seg { display: flex; gap: 8px; }
.seg button { flex: 1; min-height: 48px; border: 1.5px solid #7a8591; background: #fff; border-radius: 10px; font-weight: 700; }
.seg button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.seg button:disabled { opacity: .5; }
.fld.missing .seg button { border-color: #f1b6b6; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 16px; border-radius: 10px; border: 1.5px solid var(--ink); background: #fff; font-weight: 700; font-size: 16px; text-decoration: none; color: var(--ink); cursor: pointer; }
.btn.pri { background: var(--blue); border-color: var(--blue); color: #fff; min-height: 56px; }
.btn.pri:disabled { background: #b8c9d6; border-color: #b8c9d6; color: #4a5a66; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { border-color: var(--line); }
.btn.sm { min-height: 44px; padding: 6px 14px; font-size: 15px; }
.btn.danger { color: var(--bad); border-color: #f1b6b6; }
.btn.block { width: 100%; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* item list */
.item { display: flex; gap: 14px; align-items: center; cursor: pointer; }
.item .thumb { width: 112px; height: 80px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; display: grid; place-items: center; font-size: 28px; }
.item .thumb svg { width: 100%; height: 100%; }
.item .meta { flex: 1; min-width: 0; }
.item .t { font-weight: 700; }
.item .s { font-size: 15px; color: var(--mute); }
.badge { display: inline-block; font-size: 15px; font-weight: 700; padding: 5px 10px; border-radius: 20px; white-space: nowrap; }
.badge.bad { background: var(--bad-l); color: var(--bad); }
.badge.ok { background: var(--ok-l); color: var(--ok); }
.badge.warn { background: var(--warn-l); color: var(--warn); }
.badge.blue { background: var(--blue-l); color: var(--blue-d); }

.types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.types button { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; min-height: 76px; }
.types button b { display: block; }
.types button span { font-size: 15px; color: var(--mute); }
.types button .ic { font-size: 22px; color: var(--blue); display: block; }

/* bottom bar */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; }
.bar .msg { flex: 1; font-size: 15px; color: var(--mute); line-height: 1.25; }
.bar .msg b { color: var(--ink); }

/* sheet (item editor) */
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .shd { position: sticky; top: 0; z-index: 5; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
.sheet .shd b { flex: 1; font-size: 16px; }
.sheet .shd button { background: transparent; color: #fff; border: 1px solid #777; border-radius: 8px; min-height: 44px; padding: 0 12px; font-size: 15px; }

/* profile drawer */
.prof { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.prof.missing { border-color: var(--bad); }
.prof .canvas { background: #fafbfc; border-bottom: 1px solid var(--line); position: relative; }
.prof .canvas svg { display: block; width: 100%; height: auto; }
.prof .cut { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--ink); color: #fff; }
.prof .cut b { font-size: 24px; }
.prof .cut span { font-size: 15px; color: #b9bdc6; }
.prof .legs { padding: 8px 10px; }
.leg { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.leg .n { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-l); color: var(--blue-d); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.bend { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; margin: 2px 0; }
.bend .bi { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bend .bi input { width: 92px; min-height: 48px; padding: 6px 8px; }
.bend .lbl2 { font-size: 15px; color: var(--mute); }
.chip { border: 1.5px solid #7a8591; background: #fff; border-radius: 22px; padding: 0 14px; font-size: 15px; font-weight: 600; min-height: 44px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.prof .tools { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 10px 12px; }
.prof .hems { display: flex; gap: 8px; padding: 0 10px 10px; flex-wrap: wrap; }
.presets { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.presets button { flex: none; min-height: 48px; border: 1.5px solid #7a8591; background: #fff; border-radius: 10px; padding: 6px 12px; font-size: 15px; font-weight: 600; max-width: 200px; text-align: left; }
.presets button small { display: block; color: var(--mute); font-weight: 500; font-size: 15px; }

.prof-svg .prof-line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.prof-svg .prof-hem { stroke: var(--blue); }
.prof-svg .prof-rect { fill: #eef1f7; stroke: var(--ink); stroke-width: 2; }
.prof-svg .prof-wall { stroke: #9aa0aa; stroke-width: 2; stroke-dasharray: 4 3; }
.prof-svg .prof-dim { fill: var(--blue-d); font-weight: 700; }
.prof-svg .prof-ang { fill: var(--mute); }
.prof-svg line.prof-scale { stroke: var(--mute); stroke-width: 1.5; }
.prof-svg text.prof-scale { fill: var(--mute); }
.prof-svg .prof-joint { fill: var(--blue); }
.prof-svg .prof-empty { fill: var(--mute); font-size: 15px; }

.misslist { background: var(--bad-l); color: var(--bad); border-radius: 10px; padding: 12px; font-size: 15px; }
.misslist ul { margin: 6px 0 0; padding-left: 18px; }
.oklist { background: var(--ok-l); color: var(--ok); border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 600; }
.note { background: var(--warn-l); color: #6b3d00; border-radius: 10px; padding: 12px; font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 22px; z-index: 60; font-size: 15px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: calc(100% - 32px); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid #eceef2; text-align: left; vertical-align: top; }
.tbl th { font-size: 15px; color: var(--mute); }
.tbl td.r, .tbl th.r { text-align: right; white-space: nowrap; }
.tbl tr.tbd td { background: var(--warn-l); }
.tbl input { min-height: 44px; padding: 4px 8px; font-size: 16px; width: 92px; text-align: right; }
.tbl select { min-height: 44px; padding: 4px 8px; font-size: 16px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tot { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; justify-content: end; font-size: 16px; margin-top: 10px; }
.tot .g { font-weight: 800; font-size: 19px; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; font-size: 15px; }
.kv dt { color: var(--mute); font-size: 15px; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* office tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 10px; }
.tabs button { flex: none; border: 1.5px solid #7a8591; background: #fff; border-radius: 22px; padding: 0 16px; min-height: 44px; font-weight: 700; font-size: 15px; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.status { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.status span { font-size: 15px; font-weight: 700; padding: 5px 10px; border-radius: 14px; background: #eceef2; color: var(--mute); }
.status span.on { background: var(--blue); color: #fff; }
.status span.done { background: var(--ok-l); color: var(--ok); }

/* shear plan bars */
.sheetbar { display: flex; height: 40px; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; margin: 4px 0; background: repeating-linear-gradient(45deg, #f3f3f3 0 6px, #e2e2e2 6px 12px); }
.sheetbar div { border-right: 2px solid var(--ink); display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff; background: var(--blue); overflow: hidden; white-space: nowrap; }
.sheetbar div:nth-child(2n) { background: #1b2a5e; }
.sheetbar div:nth-child(3n) { background: #4a4f5a; }
.big { font-size: 28px; font-weight: 800; }
.stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat > div { background: #f6f7f9; border-radius: 10px; padding: 10px; }
.stat small { display: block; color: var(--mute); font-size: 15px; }

@media (min-width: 640px) {
  .types { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 380px) {
  .row3 { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .item .thumb { width: 96px; height: 68px; }
}

/* ---------- print: shop tickets ---------- */
.print-only { display: none; }
@media print {
  @page { size: letter portrait; margin: 0.35in; }
  body { background: #fff; }
  .no-print, .top, .steps, .bar, .tabs, .toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .print-only { display: block; }
  .card { box-shadow: none; border: 0; padding: 0; }
  body.printing #main { display: none !important; }
  body.printing #printArea { display: block !important; }
}
#printArea { display: none; }
.ticket { background: #fff; color: #000; font-size: 11px; page-break-after: always; break-after: page; border: 2px solid #000; padding: 6px; margin-bottom: 16px; }
.ticket:last-child { page-break-after: auto; break-after: auto; }
.ticket .th { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0; border: 1.5px solid #000; }
.ticket .th > div { padding: 3px 5px; border-right: 1px solid #000; border-bottom: 1px solid #000; min-height: 22px; }
.ticket .th > div:nth-child(3n) { border-right: 0; }
.ticket .th b { font-size: 9px; text-transform: uppercase; display: block; color: #333; }
.ticket .ttl { display: flex; justify-content: space-between; align-items: center; padding: 2px 2px 6px; }
.ticket .ttl .nm { font-weight: 900; font-size: 15px; letter-spacing: .04em; }
.ticket .ttl .nm i { color: #0B6FAE; font-style: normal; }
.ticket .boxes { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; margin-top: 6px; }
.tbox { border: 1.5px solid #000; min-height: 300px; display: flex; flex-direction: column; }
.tbox.empty { background: repeating-linear-gradient(135deg, #fff 0 10px, #f3f3f3 10px 11px); }
.tbox .hdr { display: grid; grid-template-columns: 2.2fr 1.3fr .8fr .9fr; border-bottom: 1.5px solid #000; }
.tbox .hdr > div { padding: 2px 4px; border-right: 1px solid #000; overflow-wrap: anywhere; }
.tbox .hdr > div:last-child { border-right: 0; }
.tbox .hdr b { display: block; font-size: 8px; text-transform: uppercase; color: #333; }
.tbox .hdr span { font-weight: 800; font-size: 11px; }
.tbox .drw { flex: 1; padding: 4px; display: grid; place-items: center; min-height: 150px; }
.tbox .drw svg { width: 100%; max-height: 170px; }
.tbox .nts { border-top: 1px solid #000; padding: 3px 5px; min-height: 40px; }
.tbox .seq { border-top: 1px solid #000; padding: 3px 5px; font-size: 9px; line-height: 1.3; font-weight: 700; }
.tbox .seq b { font-size: 8px; color: #333; margin-right: 4px; }
.tbox .mat { border-top: 1px solid #000; padding: 3px 5px; font-weight: 700; }
.tbox .nts b, .tbox .mat b { font-size: 8px; text-transform: uppercase; color: #333; margin-right: 4px; }
.ticket .tnotes { border: 1.5px solid #000; border-top: 0; padding: 3px 6px; font-weight: 700; text-transform: uppercase; }
.ticket .tnotes > b { font-size: 9px; display: block; color: #333; }
.ticket .tnotes .sb { color: #c62828; font-size: 12px; }
.ticket .th > div, .tbox .hdr span, .tbox .nts, .tbox .mat, .ticket .bottom { text-transform: uppercase; }
.ticket .bottom { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid #000; margin-top: 6px; }
.ticket .bottom > div { padding: 4px 6px; min-height: 60px; }
.ticket .bottom > div:first-child { border-right: 1px solid #000; }
.ticket .bottom b { font-size: 9px; text-transform: uppercase; display: block; }
.ticket .foot { text-align: center; font-weight: 700; padding-top: 5px; font-size: 11px; }
.ticket .prof-svg .prof-line { stroke: #000; stroke-width: 2.5; }
.ticket .prof-svg .prof-dim { fill: #000; }

/* estimate table becomes stacked cards on phones */
@media (max-width: 640px) {
  .tbl.est thead { display: none; }
  .tbl.est tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid #eceef2; }
  .tbl.est td { border: 0; padding: 0; }
  .tbl.est td:nth-child(1) { grid-column: 1 / -1; }
  .tbl.est td:nth-child(1) select { width: 100%; }
  .tbl.est td:nth-child(2) { grid-column: 1 / -1; font-size: 15px; color: var(--ink2); }
  .tbl.est td.r { text-align: left; }
  .tbl.est td[data-l]::before { content: attr(data-l); display: block; font-size: 15px; color: var(--mute); }
  .tbl.est td[data-l="Amount"] { font-weight: 800; text-align: right; }
  .tbl.est input { width: 84px; text-align: left; }
}

.card.preview svg { display: block; width: 100%; max-width: 420px; margin: 0 auto; height: auto; }

/* photos */
.badge.blue { background: var(--blue-l); color: var(--blue-d); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photos .ph { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f2f4f7; padding: 0; cursor: pointer; display: grid; place-items: center; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 15px; line-height: 1.2; padding: 3px 5px; background: rgba(0,0,0,.7); color: #fff; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photos .ph.gone::after { content: 'Photo not on this device'; font-size: 15px; color: var(--mute); padding: 6px; text-align: center; }
.photos .ph.add { border-style: dashed; color: var(--blue); flex-direction: column; align-content: center; gap: 2px; }
.photos .ph.add b { font-size: 28px; line-height: 1; }
.photos .ph.add span { position: static; background: none; color: inherit; font-size: 15px; font-weight: 600; text-align: center; white-space: normal; }
.pm main { padding-bottom: 90px; }
.pmwrap { background: #111; border-radius: 10px; overflow: hidden; touch-action: none; }
.pmwrap canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.pmtools { display: flex; gap: 10px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.pmtools .sw { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #ccc; padding: 0; cursor: pointer; }
.pmtools .sw.on { border-color: #000; box-shadow: 0 0 0 2px #fff inset; }
.tphotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px; }
.tphotos figure { margin: 0; border: 1px solid #000; break-inside: avoid; }
.tphotos img { width: 100%; height: 2.3in; object-fit: cover; display: block; }
.tphotos figcaption { font-size: 10px; padding: 3px 5px; text-transform: uppercase; font-weight: 700; }
.kithead { margin: 18px -4px 8px; padding: 10px 12px; border-radius: 10px; background: var(--blue-l); }
.kithead b { display: block; color: var(--blue-d); }
.kithead span { font-size: 15px; color: var(--mute); }
.pmwrap canvas { max-height: 62vh; width: auto; max-width: 100%; margin: 0 auto; }
.tphotos img { object-fit: contain; background: #f4f4f4; }
.plan { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.plan .ph { width: 92px; height: 92px; flex: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; padding: 0; background: #f2f4f7; cursor: pointer; }
.plan .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plz canvas { max-width: none !important; cursor: crosshair; }
.run { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.run select { flex: 1; min-height: 44px; }
.run .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.tko { padding: 10px; }
.tkrow { display: grid; grid-template-columns: 24px 1fr 1fr 44px; gap: 6px; align-items: center; margin: 6px 0; }
.tkrow input { min-height: 48px; min-width: 0; }
.tkrow.tkh { font-size: 15px; color: var(--mute); margin-bottom: 0; }
.pinno { width: 24px; height: 24px; border-radius: 50%; background: var(--bad); color: #fff; font-weight: 800; font-size: 15px; display: grid; place-items: center; flex: none; }

.disc { font-size: 15px; line-height: 1.45; }
.disc .ack { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; cursor: pointer; min-height: 44px; }
.disc .ack input { width: 28px; height: 28px; flex: none; margin: 0; }
.discp { font-size: 11px; color: #444; border-top: 1px solid #ccc; margin-top: 10px; padding-top: 6px; }

.buhint { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: -4px 0 14px; }
.buhint .sub { flex: 1; min-width: 160px; font-size: 15px; }
.bul { display: grid; grid-template-columns: 1fr 68px 68px auto; gap: 6px; margin-bottom: 8px; align-items: center; }
.bul input[data-f="name"] { grid-column: 1 / -1; order: 9; }
.bul select, .bul input { min-height: 48px; min-width: 0; }
.tout { display: grid; gap: 0; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tout > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 15px; }
.tout > div:first-child { border-top: 0; }
.tout b { text-align: right; }
.meter .mview { position: relative; background: #111; height: 46vh; overflow: hidden; }
.meter video { width: 100%; height: 100%; object-fit: cover; display: block; }
.meter .mline { position: absolute; left: -10%; right: -10%; top: 50%; height: 0; border-top: 3px solid #ffd400; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.meter .mread { position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.65); color: #fff; padding: 8px 12px; border-radius: 10px; display: flex; flex-direction: column; }
.meter .mread b { font-size: 34px; line-height: 1.05; }
.meter .mread span { font-size: 16px; opacity: .9; }
.meter .mhint { position: absolute; left: 12px; right: 12px; bottom: 10px; color: #fff; font-size: 15px; text-shadow: 0 1px 2px #000; }
.subm h3 { margin: 12px 0 4px; font-size: 14px; }
.subm p { margin: 4px 0; font-size: 12px; line-height: 1.45; }
.stbl { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.stbl th { text-align: left; width: 120px; vertical-align: top; padding: 6px 8px; border: 1px solid #000; background: #f2f2f2; }
.stbl td { padding: 6px 8px; border: 1px solid #000; }
.stamp { border: 2px solid #000; padding: 10px; margin-top: 16px; font-size: 13px; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.scard { border: 1px solid #000; padding: 6px; font-size: 11px; display: grid; gap: 4px; break-inside: avoid; }
.scard .sdr svg { width: 100%; height: auto; max-height: 170px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches div { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.swatches span { width: 34px; height: 22px; border: 1px solid #000; display: inline-block; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.subprev .ticket { margin-bottom: 16px; }
.top { gap: 6px; }
@media (max-width: 440px) {
  .brand { font-size: 15px; gap: 7px; } .brand small { display: none; } .brand .mk { width: 30px; height: 30px; font-size: 15px; }
}

.board { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.bcol h3 { margin: 0 0 8px; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.bcard { padding: 10px; font-size: 15px; }
@media (max-width: 700px) { .board { grid-template-columns: repeat(6, 78vw); } }
@media (min-width: 701px) { .board { width: calc(100vw - 40px); margin-left: calc(50% - 50vw + 20px); grid-template-columns: repeat(6, minmax(180px, 1fr)); } }

.swb { display: flex; align-items: center; gap: 8px; border: 1.5px solid #7a8591; background: #fff; border-radius: 22px; padding: 4px 14px 4px 6px; min-height: 44px; font-size: 15px; font-weight: 600; }
.swb span { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.3); }
.swb.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.bcard b { display: block; line-height: 1.3; margin-bottom: 2px; }
/* cleat calculator */
.cf-svg { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.cf-svg .cf-cap { fill: none; stroke: var(--ink, #111); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.cf-svg .cf-cleat { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.cf-svg .cf-key { fill: #6b7280; }
.cf-ok { background: #e9f7ef; color: #14532d; border-radius: 10px; padding: 10px 12px; font-size: 15px; margin-top: 8px; }
.cf-svg.cf-zoom .cf-cap, .cf-svg.cf-zoom .cf-cleat { stroke-width: 3.2; }
.cf-quick { background: var(--bg, #f6f7f9); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin-bottom: 14px; }
.cf-quick > b { display: block; margin-bottom: 8px; }
.ul-draw { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
.ul-draw > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.ul-draw .lbl { font-size: 15px; color: var(--mute); }
.ul-draw svg { width: 100%; height: auto; }
@media (min-width: 640px) { .ul-draw { grid-template-columns: 1fr 1fr; } }

/* tested details: 3D cards like the website viewer */
.types .u3c { background: #111317; border-color: #2a2f36; color: #e8edf2; padding: 0 0 10px; overflow: hidden; text-align: left; }
.types .u3c b, .types .u3c span { padding: 0 10px; }
.types .u3c > span:last-child { color: #a9b3be; display: block; }
.u3c .u3i { position: relative; display: block; padding: 0 !important; aspect-ratio: 3 / 2; margin-bottom: 8px; border-bottom: 1px solid #2a2f36; }
.u3c .u3i img { width: 100%; height: 100%; object-fit: cover; display: block; }
.u3c .u3i i { position: absolute; top: 6px; right: 6px; font: 700 15px/1 ui-monospace, Menlo, monospace; color: #5fd4ff; border: 1px solid #5fd4ff; padding: 4px 6px; font-style: normal; }
.types .u3c:hover { border-color: #5fd4ff; }
.u3f { background: #111317; border-radius: 10px; overflow: hidden; border: 1px solid #2a2f36; }
.u3f iframe { display: block; width: 100%; height: min(90vh, 790px); border: 0; }

.sysin { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sysin .fld { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.sysin .fld input, .sysin .fld select { padding: 10px; border: 1.5px solid #7a8591; border-radius: 10px; font: inherit; background: #fff; }
.sysin .fld small { color: var(--mute); font-size: 15px; }
@media (min-width: 640px) { .sysin { grid-template-columns: 1fr 1fr 1fr; } }
/* coping slider tool */
.cpw { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 12px; }
@media (max-width: 820px) { .cpw { grid-template-columns: 1fr; } }
.cpw svg { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.cpc { display: grid; grid-template-columns: 110px minmax(0,1fr) 70px; align-items: center; gap: 8px; margin: 8px 0; }
.cpc label { font-weight: 700; font-size: 15px; } .cpc small { display: block; font-weight: 400; color: var(--mute); font-size: 15px; }
.cpc input[type=range] { width: 100%; accent-color: var(--blue); height: 44px; } .cpc output { font-weight: 700; font-size: 16px; text-align: right; }
.cpo { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 15px; margin-top: 6px; } .cpo label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.cpr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cpb { border: 2px solid var(--blue); border-radius: 10px; padding: 8px; text-align: center; background: #fff; }
.cpb .k { font-size: 15px; color: var(--mute); } .cpb .v { font-size: 26px; font-weight: 700; } .cpb .s { font-size: 15px; color: var(--ink2); }
.cpb.red { border-color: var(--bad); } .cpb.red .v { color: var(--bad); }
.cpt { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 10px; } .cpt td, .cpt th { border: 1px solid var(--line); padding: 6px; text-align: left; } .cpt th { background: var(--blue-l); } .cpt td + td { text-align: right; font-weight: 700; }

/* real MF logo in the top bar */
.brand { flex-direction: column; align-items: flex-start; gap: 2px; }
.brand .lg { height: 26px; width: auto; display: block; }
.brand small { margin-left: 2px; }
.brand .mki { display: none; height: 28px; width: auto; }
@media (max-width: 560px) { .brand .lg { display: none; } .brand .mki { display: block; } }
/* ===== Coping top tool: "the flat blank" ===== */
.cpx { --g:#ECEEF1; --r:#FFFFFF; --i:#15171A; --i2:#464C55; --i3:#5B6270; --ru:#D2D6DB; --ac:var(--blue); --onac:#fff;
  --fd: -apple-system,"SF Pro Display","Segoe UI",Roboto,Arial,sans-serif; --fn: tabular-nums;
  background: var(--g); color: var(--i); margin: -14px; padding: 20px 20px 28px; border-radius: inherit;
  display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 32px; }
@media (max-width: 820px) { .cpx { grid-template-columns: 1fr; gap: 24px; padding: 16px 16px 24px; } }
.cph-k { font-size: 15px; color: var(--i2); }
.cph-n { font-family: var(--fd); font-weight: 800; font-size: 84px; line-height: .95; letter-spacing: -.045em; font-variant-numeric: var(--fn); margin: 2px 0 6px; }
.cph-n i { font-style: normal; font-size: .55em; vertical-align: .62em; margin-left: 2px; color: var(--i2); }
.cph-s { font-size: 15px; color: var(--i2); }
.cph-b { display: flex; gap: 32px; margin-top: 20px; }
.cph-b b { display: block; font-family: var(--fd); font-stretch: condensed; font-size: 48px; line-height: 1; color: var(--ac); font-variant-numeric: var(--fn); letter-spacing: -.02em; }
.cph-b span { display: block; font-size: 15px; color: var(--i2); margin-top: 4px; line-height: 1.35; }
.cpf { margin: 24px 0 8px; }
.cpf svg, .cpx [data-cpic] { width: 100%; height: auto; display: block; }
.cpf .bl { fill: var(--r); stroke: var(--i); stroke-width: 1.5; }
.cpf .tk { stroke: var(--i3); stroke-width: 1; }
.cpf .bd { stroke: var(--ac); stroke-width: 2.5; } .cpf .hm { stroke: var(--i2); stroke-width: 1.5; stroke-dasharray: 4 3; }
.cpf text { font: 12px/1 Arial, sans-serif; text-anchor: middle; font-variant-numeric: tabular-nums; }
.cpf .t1 { fill: var(--i); font-weight: 700; } .cpf .t2 { fill: var(--ac); font-weight: 700; font-size: 13px; } .cpf .t3 { fill: var(--i3); font-size: 11px; }
.cpx [data-cpic] { background: var(--r); border-radius: 12px; margin-top: 12px; }
.cpx [data-cpic] .cv { stroke: var(--i); } .cpx [data-cpic] .cvt { fill: var(--i); }
.cpx [data-cpic] .cl { stroke: #8A929C; fill: none; } .cpx [data-cpic] .clt { fill: #6B727C; }
.cpx [data-cpic] .ac { fill: var(--blue); }
.cpk .cpc { display: grid; grid-template-columns: 92px minmax(0,1fr) 78px; gap: 12px; align-items: center; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--ru); }
.cpk .cpc:first-child { border-top: 1px solid var(--ru); }
.cpk .cpc label { font-size: 15px; font-weight: 700; color: var(--i); } .cpk .cpc small { color: var(--i3); font-size: 15px; font-weight: 400; }
.cpk .cpc output { font-family: var(--fd); font-stretch: condensed; font-size: 24px; font-weight: 700; text-align: right; font-variant-numeric: var(--fn); color: var(--i); }
.cpk input[type=range] { -webkit-appearance: none; appearance: none; height: 44px; background: transparent; width: 100%; }
.cpk input[type=range]::-webkit-slider-runnable-track { height: 14px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--i3) 0 1px, transparent 1px 8px) bottom/100% 6px no-repeat, var(--r); border: 1px solid var(--ru); }
.cpk input[type=range]::-moz-range-track { height: 14px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--i3) 0 1px, transparent 1px 8px) bottom/100% 6px no-repeat, var(--r); border: 1px solid var(--ru); }
.cpk input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -8px; border-radius: 50%; background: var(--i); border: 3px solid var(--r); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.cpk input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--i); border: 3px solid var(--r); }
.cpx .cpo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 16px; font-size: 15px; color: var(--i2); }
.cpx .cpo label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.cpx .cpo select { font-size: 16px; padding: 9px 8px; border-radius: 8px; border: 1px solid var(--ru); background: var(--r); color: var(--i); min-height: 48px; }
.cpx .cpo label:has(input[type=checkbox]) { flex-direction: row; align-items: center; min-height: 44px; }
.cpm { margin-top: 16px; border-top: 1px solid var(--ru); } .cpm summary { padding: 14px 0; font-weight: 700; cursor: pointer; min-height: 48px; }
.cpd { margin-top: 24px; } .cpd h4 { margin: 24px 0 4px; font-size: 15px; color: var(--i2); font-weight: 700; }
.cpl { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ru); }
.cpl b { display: block; font-size: 16px; } .cpl small { display: block; font-size: 15px; color: var(--i3); margin-top: 2px; line-height: 1.35; }
.cpl > span { font-family: var(--fd); font-stretch: condensed; font-size: 22px; font-weight: 700; font-variant-numeric: var(--fn); white-space: nowrap; }
.cpx .help { color: var(--i3); font-size: 15px; margin-top: 16px; }
.cpx .dsh { margin: 0 -.08em; }
.cpk .cpc { grid-template-columns: 92px minmax(0,1fr) 84px; } .cpk .cpc output { white-space: nowrap; }
.cpx .cpo label:first-child { grid-column: 1 / -1; }
@media (max-width: 520px) { .cpx .cpo { grid-template-columns: 1fr; } }
/* coping tool, round 2: answer stays in view, strip is the widest thing, thumb-size steppers */
.cpx { grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-areas: "bar bar" "hero ctl" "strip strip" "pic det"; align-items: start; }
.cpx > .cpsb { grid-area: bar; } .cpx > .cph { grid-area: hero; } .cpx > .cpf { grid-area: strip; margin: 0; } .cpx > .cpk { grid-area: ctl; } .cpx > [data-cpic] { grid-area: pic; margin: 0; } .cpx > [data-cout] { grid-area: det; }
.cpx > [data-cout] .cpd { margin-top: 0; } .cpx > [data-cout] .cpd h4:first-child { margin-top: 0; }
@media (max-width: 820px) { .cpx { grid-template-columns: 1fr; grid-template-areas: "bar" "hero" "strip" "ctl" "pic" "det"; }
  .cpx > .cpf { margin: 0 -16px; padding: 12px 6px; background: var(--r); border-block: 1px solid var(--ru); } }
.cpf-k { font-size: 15px; color: var(--i2); margin: 0 0 4px 4px; }
.cpf .t1, .cpf .t2 { font-size: 14px; } .cpf .t3 { font-size: 12px; }
.cpsb { position: sticky; top: 0; z-index: 4; display: flex; gap: 20px; align-items: baseline; margin: -20px -20px 0; padding: 0 20px; height: 0; overflow: hidden; background: var(--i); color: #fff; transition: height .18s ease-out, padding .18s ease-out; }
.sheet .cpsb { top: var(--hdr-h, 65px); }
.cpsb.on { height: 56px; padding-top: 10px; }
.cpsb b { font-family: var(--fd); font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cpsb span { font-family: var(--fd); font-size: 24px; font-weight: 800; color: #9DB2FF; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .cpsb { margin: -16px -16px 0; padding: 0 16px; } }
@media (prefers-reduced-motion: reduce) { .cpsb { transition: none; } }
.cpseg { display: inline-flex; margin-top: 16px; border: 1px solid var(--ru); border-radius: 10px; overflow: hidden; background: var(--r); }
.cpseg button { min-height: 48px; padding: 0 16px; border: 0; background: transparent; font-size: 15px; font-weight: 700; color: var(--i2); }
.cpseg button.on { background: var(--i); color: #fff; }
.cpk .cpc { grid-template-columns: 84px minmax(0,1fr); grid-template-areas: "lab val" "rng rng"; row-gap: 2px; }
.cpk .cpc label { grid-area: lab; } .cpk .cpc input[type=range] { grid-area: rng; } .cpk .cps { grid-area: val; justify-self: end; display: flex; align-items: center; gap: 6px; }
.cpn { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--i3); background: var(--r); color: var(--i); font-size: 22px; font-weight: 700; line-height: 1; }
.cpv { width: 104px; height: 48px; border: 0; background: transparent; text-align: center; font-family: var(--fd); font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--i); font-variant-numeric: tabular-nums; border-bottom: 2px solid var(--i3); border-radius: 0; }
.cpv:focus { outline: none; border-bottom-color: var(--ac); }
.cpk input[type=range]::-webkit-slider-thumb { width: 32px; height: 32px; margin-top: -10px; }
.cpl > span { align-self: center; }
.cph-b span { white-space: nowrap; }
.cph-b .dsh { display: inline; margin: 0 -.08em; }
.cpx { grid-template-areas: "bar bar" "hero ctl" "strip ctl" "pic ctl" "det det"; grid-template-rows: auto auto auto auto 1fr; }
.cpx > .cpk { align-self: start; }
.cpk .cpo { grid-template-columns: 1fr; }
@media (max-width: 820px) { .cpx { grid-template-areas: "bar" "hero" "strip" "ctl" "pic" "det"; grid-template-rows: none; } }
/* coping tool, round 3 */
.cpx { grid-template-areas: "bar bar" "l ctl" "det det"; grid-template-rows: none; }
.cpx > .cpx-l { grid-area: l; position: sticky; top: 16px; align-self: start; display: grid; gap: 24px; }
.sheet .cpx > .cpx-l { top: calc(var(--hdr-h, 65px) + 16px); }
.cpx-l > .cpf { margin: 0; } .cpx-l > [data-cpic] { margin: 0; }
@media (max-width: 820px) { .cpx { grid-template-areas: "bar" "hero" "strip" "ctl" "pic" "det"; }
  .cpx > .cpx-l { display: contents; } .cpx-l > .cph { grid-area: hero; } .cpx-l > .cpf { grid-area: strip; margin: 0 -16px; } .cpx-l > [data-cpic] { grid-area: pic; } }
.cpx-l > .cph { grid-area: auto; }
@media (min-width: 821px) { .cpx-l > .cph, .cpx-l > .cpf, .cpx-l > [data-cpic] { grid-area: auto; } }
.cpsb { background: var(--r); color: var(--i); border-bottom: 1px solid var(--ru); gap: 8px; }
.cpsb small { font-size: 15px; color: var(--i2); margin-left: 8px; } .cpsb small:first-child { margin-left: 0; }
.cpsb span { color: var(--ac); } .cpsb em { font-style: normal; font-size: 15px; color: var(--i2); margin-left: auto; }
.cpf .t1, .cpf .t2 { font-size: 16px; } .cpf .t3 { font-size: 13px; }
.cpx [data-cpic] text { font-size: 15px; }
.cpk .cpc small { font-size: 15px; color: #5B6270; white-space: nowrap; }
.cpk-h { margin: 24px 0 0; font-size: 15px; color: var(--i2); }
.sheet main:has(.cpx) { max-width: 1180px; }
@media (max-width: 820px) { .cpx-l > .cpf { background: var(--r); padding: 12px 6px; border-block: 1px solid var(--ru); } }
.cpn { flex: none; min-width: 48px; padding: 0; }
.cpsb, .cpsb.on { margin-left: 0; margin-right: 0; }
@media (max-width: 820px) { .cpsb { margin: -16px 0 0; } }
.cpx [data-cpic] text { font-size: 17px; }
.cpx > *, .cpx-l > * { min-width: 0; }
.cph-n { font-size: clamp(54px, 18vw, 84px); white-space: nowrap; }
@media (max-width: 420px) { .cpsb em { display: none; } .cpsb b { font-size: 24px; } .cpsb span { font-size: 21px; } }
