/* Good Measure app. Brand pack v06 tokens (assets/tokens.css). Phone first: one column, big touch targets. */
@font-face { font-family: "Lato"; src: url(/assets/fonts/Lato-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url(/assets/fonts/Lato-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lato"; src: url(/assets/fonts/Lato-Black.ttf); font-weight: 900; font-display: swap; }
@font-face { font-family: "Liberation Mono"; src: url(/assets/fonts/LiberationMono-Regular.ttf); font-display: swap; }
@font-face { font-family: "TAY Birdie"; src: url(/assets/fonts/TAYBirdie.otf); font-display: swap; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--gm-cream); color: var(--gm-off-black); font: 400 16px/1.5 var(--gm-font-sans); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
a { color: var(--gm-cobalt); }
h1 { font: 400 clamp(34px, 9vw, 52px)/1.02 var(--gm-font-display); color: var(--gm-cobalt); margin: 4px 0 18px; overflow-wrap: anywhere; }
h2 { font: 700 12px/1 var(--gm-font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gm-cobalt); border-bottom: var(--gm-line-structure); padding-bottom: 8px; margin: 32px 0 12px; }
h3 { font-weight: 900; color: var(--gm-cobalt); margin: 2px 0 6px; font-size: 19px; }
.eyebrow, .crumbs { font: 400 11px/1.4 var(--gm-font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gm-cobalt); margin: 0; }
.crumbs { color: var(--gm-text-muted); margin-bottom: 4px; }
.crumbs a { color: var(--gm-text-muted); text-decoration: none; }
.crumbs span { margin: 0 6px; opacity: .5; }
.mono { font-family: var(--gm-font-mono); }
.muted { color: var(--gm-text-muted); }
.small { font-size: 13px; }
.break { word-break: break-all; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--gm-cream); border-bottom: var(--gm-line-structure); }
.brand img { height: 22px; display: block; }
.back { font-size: 34px; line-height: 1; text-decoration: none; padding: 0 8px; margin-left: -8px; }
.sync { margin-left: auto; font: 11px var(--gm-font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gm-text-muted); }
.sync.wait { color: var(--gm-stamp-red); }
.me { text-decoration: none; }
.av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--gm-cobalt); color: var(--gm-paper); font: 900 13px var(--gm-font-sans); object-fit: cover; }
.avbig { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avbig .av { width: 80px; height: 80px; font-size: 28px; }

.sheet { max-width: 640px; margin: 0 auto; padding: 18px 16px 32px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--gm-paper); border-top: var(--gm-line-structure); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs a { flex: 1; text-align: center; padding: 16px 4px; font: 700 12px var(--gm-font-mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--gm-text-muted); }
.tabs a.on { color: var(--gm-cobalt); box-shadow: inset 0 3px 0 var(--gm-cobalt); }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.form label small { font-weight: 400; color: var(--gm-text-muted); }
input, select, textarea { font: inherit; font-size: 17px; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--gm-rule-row); border-radius: var(--gm-radius-control); background: var(--gm-paper); color: var(--gm-off-black); }
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gm-cobalt); outline-offset: 1px; }
input:disabled { background: transparent; color: var(--gm-text-muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form.inline { grid-template-columns: 1fr auto; margin-top: 12px; }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px !important; font-weight: 400 !important; min-height: 44px; }
.check input { width: 24px; min-height: 24px; height: 24px; accent-color: var(--gm-cobalt); }
.ticks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
fieldset { border: var(--gm-line-row); border-radius: var(--gm-radius-tile); padding: 12px; margin: 0; display: grid; gap: 10px; }
legend { font: 700 11px var(--gm-font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gm-cobalt); padding: 0 6px; }
.cm { position: relative; display: block; }
.cm input { font-family: var(--gm-font-mono); padding-right: 44px; }
.cm i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: normal 13px var(--gm-font-mono); color: var(--gm-text-muted); }
.mrow { display: grid; grid-template-columns: 1fr 112px; gap: 8px; align-items: end; border-bottom: var(--gm-line-row); padding-bottom: 12px; }
.mrow select { font-size: 13px; min-height: 48px; padding: 6px; }
.seg { display: grid; grid-template-columns: 28px 1fr 1fr 1fr; gap: 8px; align-items: end; }
.seg label { font-size: 12px !important; }
.search input { border-radius: 24px; padding-left: 18px; margin-bottom: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 1px solid var(--gm-cobalt); border-radius: var(--gm-radius-control); background: var(--gm-cobalt); color: var(--gm-paper); font: 700 16px var(--gm-font-sans); text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--gm-cobalt); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.danger { border-color: var(--gm-stamp-red); color: var(--gm-stamp-red); }
.btn:active { transform: translateY(1px); }

.list { list-style: none; padding: 0; margin: 0; background: var(--gm-paper); border: 1px solid var(--gm-border-card); border-radius: var(--gm-radius-card); box-shadow: var(--gm-lift-sm); overflow: hidden; }
.list li { border-bottom: var(--gm-line-row); }
.list li:last-child { border-bottom: 0; }
.list li > a, .list li > span { display: grid; gap: 2px; padding: 14px 16px; text-decoration: none; color: inherit; min-height: 56px; }
.list b { color: var(--gm-cobalt); font-weight: 700; font-size: 17px; }
.list li > a span, .list li > span > span { font-size: 13px; color: var(--gm-text-muted); }
.list .empty { padding: 16px; color: var(--gm-text-muted); }
.list .row { display: flex; align-items: center; }
.list .row > a, .list .row > span:first-child { flex: 1; min-width: 0; }
.move { display: flex; gap: 4px; padding-right: 8px; }
.move button { min-width: 40px; min-height: 40px; border: 1px solid var(--gm-rule-row); background: transparent; border-radius: var(--gm-radius-control); color: var(--gm-cobalt); font: 700 14px var(--gm-font-sans); padding: 0 8px; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
.facts dt { font: 11px var(--gm-font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gm-text-muted); padding-top: 4px; }
.facts dd { margin: 0; }
details { margin-top: 28px; border-top: var(--gm-line-row); padding-top: 12px; }
details summary { cursor: pointer; color: var(--gm-cobalt); font-weight: 700; min-height: 40px; }
details .form { margin: 12px 0; }

.job { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; background: var(--gm-surface-card); border: 1px solid var(--gm-border-card); border-radius: var(--gm-radius-card); padding: 16px; box-shadow: var(--gm-lift-sm); }
.job .mono { font-size: 22px; color: var(--gm-off-black); }
.job i { color: var(--gm-cobalt); font-style: normal; }
.stamp { font: 700 11px var(--gm-font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gm-stamp-red); border: 1.5px solid var(--gm-stamp-red); background: var(--gm-surface-status); border-radius: var(--gm-radius-stamp); padding: 4px 8px; transform: rotate(-2deg); }
.stamp.wait { color: var(--gm-text-muted); border-color: var(--gm-rule-row); background: transparent; transform: none; }
.warn { list-style: none; margin: 14px 0 0; padding: 12px 14px; background: var(--gm-surface-peach); border-left: 3px solid var(--gm-stamp-red); border-radius: var(--gm-radius-control); display: grid; gap: 6px; font-size: 14px; }
.note { background: var(--gm-surface-note); border: 1px solid var(--gm-border-card); border-radius: var(--gm-radius-tile); padding: 12px 14px; margin: 12px 0; }
.note.peach { background: var(--gm-surface-peach); }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; background: var(--gm-surface-quiet); border-radius: var(--gm-radius-control); overflow: hidden; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(37,36,33,.7); color: #fff; font-size: 18px; }
.cards { display: grid; gap: 14px; }
.card { background: var(--gm-paper); border: 1px solid var(--gm-border-card); border-radius: var(--gm-radius-card); padding: 14px 16px; box-shadow: var(--gm-lift-sm); }
.card p { margin: 4px 0; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px !important; }
.hist b { font-size: 15px; }

#toast { position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: var(--gm-radius-tile); background: var(--gm-off-black); color: var(--gm-paper); font-size: 15px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; z-index: 10; }
#toast.show { opacity: 1; transform: none; }
#toast.bad { background: var(--gm-stamp-red); }

/* cutting planner */
.cut { display: grid; gap: 8px; }
.cut h2:first-child { margin-top: 8px; }
.tick { display: flex !important; gap: 12px !important; align-items: flex-start; font-weight: 400 !important; min-height: 44px; }
.tick input { width: 24px; min-height: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--gm-cobalt); }
.tick span { display: grid; gap: 2px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { border: 1px solid var(--gm-rule-row); background: var(--gm-paper); color: var(--gm-cobalt); border-radius: 20px; padding: 8px 12px; font: 700 13px var(--gm-font-sans); min-height: 40px; cursor: pointer; }
.piece { padding: 12px 0; border-bottom: var(--gm-line-row); display: grid; gap: 8px; }
.ph { display: grid; grid-template-columns: 24px 1fr 40px; gap: 8px; align-items: center; }
.pf { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pf label:has(select) { grid-column: span 2; }
.piece label { display: grid; gap: 4px; align-content: end; font: 400 11px var(--gm-font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gm-text-muted); }
.piece input, .piece select { font-family: var(--gm-font-mono); font-size: 16px; padding: 8px; }
.piece .tag, .cuts .tag { font: 900 15px var(--gm-font-sans); color: var(--gm-cobalt); align-self: center; }
.piece .x { width: 40px; height: 40px; border: 1px solid var(--gm-rule-row); border-radius: var(--gm-radius-control); background: transparent; color: var(--gm-stamp-red); font-size: 20px; align-self: center; cursor: pointer; }
.job.big .order { font-size: 44px !important; line-height: 1.05; margin: 2px 0 4px; color: var(--gm-cobalt) !important; }
.job.big p { margin: 0; }
.opts em { font: normal 13px var(--gm-font-mono); margin-left: 6px; }
.opts em.up { color: var(--gm-stamp-red); } .opts em.down { color: #2e7d4f; }
.cuts { width: 100%; border-collapse: collapse; background: var(--gm-paper); border: 1px solid var(--gm-border-card); border-radius: var(--gm-radius-card); font-size: 14px; }
.cuts th { text-align: left; font: 400 11px var(--gm-font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gm-text-muted); padding: 10px 8px; border-bottom: var(--gm-line-row); }
.cuts td { padding: 10px 8px; border-bottom: var(--gm-line-row); vertical-align: top; }
.cuts td small { display: block; color: var(--gm-text-muted); font-size: 12px; }
.cuts td.mono { white-space: nowrap; }
.roll { width: 100%; height: auto; display: block; background: transparent; }
.roll .bg { fill: var(--gm-paper); stroke: var(--gm-off-black); stroke-width: .4; }
.roll .g { stroke: var(--gm-cobalt); stroke-width: .25; stroke-dasharray: 1.5 1.5; opacity: .5; }
.roll .pr, .roll .pc, .roll .pt { fill: rgba(60, 43, 245, .08); stroke: var(--gm-cobalt); stroke-width: .5; }
.roll .ps.piping { fill: var(--gm-cobalt); opacity: .55; }
.roll .ps.gusset { fill: var(--gm-surface-peach); stroke: var(--gm-stamp-red); stroke-width: .3; }
.roll .pb { fill: rgba(60, 43, 245, .2); stroke: var(--gm-cobalt); stroke-width: .5; stroke-dasharray: 2 1; }
.roll .pl { font: 900 5px var(--gm-font-sans); fill: var(--gm-cobalt); text-anchor: middle; }
.roll .t { stroke: var(--gm-text-muted); stroke-width: .3; }
.roll .tl { font: 3.4px var(--gm-font-mono); fill: var(--gm-text-muted); text-anchor: end; }
.roll .end { stroke: var(--gm-stamp-red); stroke-width: .6; stroke-dasharray: 2 1.2; }
@media (min-width: 1000px) { body:has(.cut) .sheet { max-width: 1120px; } .cut { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; } .cut-out { position: sticky; top: 72px; } }
/* on the cloth: paper outputs and camera overlay */
.cloth li { display: flex; align-items: center; gap: 10px; padding-right: 14px; }
.cloth li > span:first-child { flex: 1; }
.cloth li > .two-b { display: flex; gap: 6px; padding: 0; min-height: 0; }
.cloth .btn { flex: none; }
html.ar-open, html.ar-open body { overflow: hidden; }
.ar { position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.ar video, .ar .ar-c { position: absolute; inset: 0; width: 100%; height: 100%; }
.ar video { object-fit: cover; }
.ar-top, .ar-bot { position: absolute; left: 0; right: 0; display: flex; gap: 10px; padding: 12px; background: linear-gradient(rgba(0,0,0,.65), rgba(0,0,0,0)); }
.ar-top { top: 0; align-items: center; padding-top: max(12px, env(safe-area-inset-top)); }
.ar-bot { bottom: 0; flex-direction: column; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.75)); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.ar-t { flex: 1; display: grid; line-height: 1.25; min-width: 0; }
.ar-t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-t span { font: 12px var(--gm-font-mono); opacity: .85; }
.ar-bot p { margin: 0; font-size: 15px; line-height: 1.35; text-shadow: 0 1px 3px #000; }
.ar-row { display: flex; gap: 10px; }
.ar-row .ar-b { flex: 1; }
.ar-b { min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(20,20,26,.6); color: #fff; font: 600 15px var(--gm-font-sans, system-ui); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ar-b.hot { background: rgba(60,43,245,.85); border-color: transparent; }
.ar-b.on { background: #ff5a3c; border-color: transparent; }
@media print { .bar, .tabs, .cut-in, .acts, .cloth-box { display: none !important; } .cut { display: block; } }

@media (min-width: 720px) { .sheet { padding-top: 32px; } .cards { grid-template-columns: 1fr 1fr; } }

/* quotes */
h3 { font: 600 15px/1.3 var(--gm-font-sans, inherit); margin: 16px 0 6px; }
.qtot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin: 12px 0; background: var(--gm-paper); border: 1px solid var(--gm-rule-row); border-radius: 10px; }
.qtot > div { display: grid; }
.qtot b { font-size: 24px; }
.qtot.sticky { position: sticky; top: 56px; z-index: 4; }
.qwin > li { display: block; padding: 10px 12px; }
.qw { display: grid; margin-bottom: 4px; }
.qopt { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--gm-rule-row); }
.qopt a { flex: 1; display: flex !important; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 !important; text-decoration: none; color: inherit; }
.qopt a > span { display: grid; }
.qopt.alt { opacity: .6; }
.need { color: var(--gm-stamp-red); font-size: 13px; text-align: right; max-width: 45%; }
.money dd { text-align: right; }
.bd td:last-child { text-align: right; white-space: nowrap; vertical-align: top; }
.gridwrap { overflow-x: auto; margin: 8px 0 12px; -webkit-overflow-scrolling: touch; }
.pgrid { border-collapse: collapse; font-size: 13px; background: var(--gm-paper); }
.pgrid th, .pgrid td { border: 1px solid var(--gm-rule-row); padding: 4px; text-align: left; white-space: nowrap; font-weight: 500; }
.pgrid input { width: 68px; font: inherit; font-family: var(--gm-font-mono); padding: 6px; border: 1px solid transparent; background: transparent; text-align: right; }
.pgrid input:focus { border-color: var(--gm-cobalt, #3c2bf5); background: #fff; outline: none; }
.stamp.off { opacity: .55; }
button[disabled] { opacity: .45; }

/* keep the last item clear of the fixed tab bar and the iPhone home bar */
.sheet { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---- Workroom > Your quote: live letterhead preview in the creator's own colour and type */
.qlook { --qa: #2f4f4f; background: #fff; color: #1d1d1f; border: 1px solid var(--gm-rule, #dcd7cc); padding: 18px 18px 14px; margin: 8px 0 18px; font-family: Helvetica, Arial, sans-serif; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.qlook.serif { font-family: 'Times New Roman', Times, serif; }
.qlook .qh { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.qlook .qh img { max-width: 55%; max-height: 64px; object-fit: contain; }
.qlook .qn { color: var(--qa); font-size: 20px; line-height: 1.1; }
.qlook .qd { display: flex; flex-direction: column; align-items: flex-end; font-size: 10px; color: #6e6e73; text-align: right; }
.qlook .qd b { color: #1d1d1f; font-size: 11px; }
.qlook hr { border: 0; height: 2px; background: var(--qa); margin: 12px 0; }
.qlook .qt { color: var(--qa); font-size: 20px; font-weight: 700; }
.qlook .qs { color: var(--qa); font-weight: 700; margin-top: 10px; font-size: 13px; border-bottom: 1px solid var(--qa); padding-bottom: 3px; }
.qlook .qr { display: flex; justify-content: space-between; font-size: 11px; padding: 6px 0; border-bottom: 1px solid #d9d9de; }
.logo-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.swatches .sw { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; cursor: pointer; border: 2px solid transparent; }
.swatches .sw input { opacity: 0; width: 0; height: 0; }
.swatches .sw:has(input:checked) { border-color: var(--gm-ink, #14141a); box-shadow: inset 0 0 0 3px #fff; }
.swatches input[type=color] { width: 40px; height: 34px; padding: 0; border: 0; background: none; }
.pgrid input.bad, [data-p].bad { outline: 2px solid var(--gm-stamp-red, #d23c2a); }

/* mouse and trackpad: compact price grids (phones keep the 48 px tap size) */
@media (pointer: fine) { .pgrid input { min-height: 0; height: 32px; } }

/* first-login checklist */
.checklist { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.checklist .box { width: 22px; height: 22px; border: 2px solid var(--gm-border-card); border-radius: 6px; display: grid; place-items: center; font-weight: 700; background: #fff; }
.checklist li.done .box { background: var(--gm-ink, #1d1d1b); color: #fff; border-color: transparent; }
.checklist li.done b { text-decoration: line-through; opacity: .6; }
.checklist .btn.small { margin-top: 6px; }

/* edit clash warning, pinned above the tab bar */
#clashes { position: fixed; left: 12px; right: 12px; bottom: 76px; z-index: 50; display: grid; gap: 8px; max-width: 560px; margin: 0 auto; }
#clashes .clash { background: var(--gm-surface-peach); border: 1px solid var(--gm-stamp-red); border-radius: var(--gm-radius-tile); padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
#clashes .clash p { margin: 0 0 6px; }

/* footer links */
.foot { display: flex; gap: 18px; justify-content: center; margin: 40px 0 8px; padding-top: 14px; border-top: 1px solid var(--gm-border-card); font-size: 13px; }
.foot a { color: inherit; opacity: .7; }

/* legal pages (/legal/privacy, /legal/terms) and the accept-terms tick box */
.legal { max-width: 42rem; line-height: 1.6; }
.legal h2 { font: 700 17px/1.3 var(--gm-font-sans); letter-spacing: 0; text-transform: none; margin: 28px 0 8px; }
.legal p { margin: .5rem 0; }
.legal .draft { background: var(--gm-surface-peach); padding: .6rem .8rem; border-radius: 8px; font-weight: 600; }
.check.accept { align-items: flex-start; gap: .5rem; line-height: 1.4; }
