/* Honed: warm stone neutrals, white cards, one green action color. */
:root {
  --ground: #F7F5F1;
  --card: #FFFFFF;
  --line: #DED8CE;
  --line-soft: #E4DFD6;
  --ink: #1C1A17;
  --muted: #5C574F;
  --action: #0E6655;
  --action-hover: #0A4D40;
  --action-tint: #E2F0EC;
  --new-bg: #FDF0DF;
  --new-ink: #8A4500;
  --blue-bg: #E6EEF8;
  --blue-ink: #1D4C85;
  --error: #9B1C12;
  --error-bg: #FBE9E7;
  --input-border: #8C857A;
  --neutral-badge: #EFECE6;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --radius-card: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.5; color: var(--ink); background: var(--ground); }
@media (min-width: 900px) { body { font-size: 16px; } }
img { max-width: 100%; height: auto; }
a { color: var(--action); text-underline-offset: 2px; }
a:hover { color: var(--action-hover); }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; font-weight: 750; }
h1 { font-size: 28px; letter-spacing: -0.01em; }
h2 { font-size: 21px; }
h3 { font-size: 17px; font-weight: 700; }
@media (min-width: 900px) { h1 { font-size: 40px; } h2 { font-size: 24px; } }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.meta { font-size: 14px; color: var(--muted); }
.mono { font-family: var(--mono); }
input.code-input { font-size: 28px; letter-spacing: 0.3em; max-width: 240px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -10000px; }

/* Layout */
.wrap { max-width: 1184px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 900px) { .wrap { padding: 0 32px; } }
.narrow { max-width: 720px; }
main { padding: 20px 0 48px; }
@media (min-width: 900px) { main { padding: 32px 0 64px; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.stack-tight { gap: 8px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 16px; }
.page-head h1 { margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .split > aside { position: sticky; top: 24px; }
  .narrow-only { display: none; }
}
.section { margin-top: 32px; }

/* Header and footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.mark { display: inline-flex; align-items: center; min-height: 44px; }
.mark img { display: block; height: 30px; width: auto; }
.site-nav { display: flex; gap: 20px; font-weight: 600; font-size: 15px; }
.site-nav a { color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { color: var(--action); }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.site-footer a { color: var(--muted); }

/* Buttons */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius);
  font: 600 16px/1.1 var(--sans); text-decoration: none; text-align: center; cursor: pointer;
  background: var(--action); color: #fff; border: 1.5px solid transparent;
}
button:hover, .btn:hover { background: var(--action-hover); color: #fff; }
.btn-s { background: var(--card); color: var(--ink); border-color: var(--ink); }
.btn-s:hover { background: var(--ground); color: var(--ink); }
.btn-d { background: var(--card); color: var(--error); border-color: var(--error); }
.btn-d:hover { background: var(--error-bg); color: var(--error); }
.btn-link { background: none; color: var(--action); border: 0; padding: 0; min-height: 44px; text-decoration: underline; }
.btn-link:hover { background: none; color: var(--action-hover); }
.btn-w { width: 100%; }
.btn-lg { min-height: 56px; font-size: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn, .btn-row > button { flex: 1 1 140px; }
.btn-row > .btn-lead { flex-basis: 100%; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Forms */
label { display: block; font-weight: 600; margin: 0 0 6px; }
input:not([type=radio]):not([type=checkbox]):not([type=color]):not([type=file]), select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 0 12px;
  border: 1.5px solid var(--input-border); border-radius: 8px; background: var(--card);
  font: inherit; font-size: 16px; color: var(--ink);
}
textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--action); margin: 0; }
input[type=color] { width: 72px; height: 48px; padding: 2px; border: 1.5px solid var(--input-border); border-radius: 8px; background: var(--card); }
input[type=file] { font: inherit; font-size: 15px; }
form > div, .field { margin-bottom: 18px; }
.helptext, [id$=_helptext] { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
ul.errorlist { list-style: none; margin: 0 0 6px; padding: 0; color: var(--error); font-size: 14px; font-weight: 600; }
ul.errorlist.nonfield { padding: 12px 14px; background: var(--error-bg); border-radius: 8px; }
.error { color: var(--error); font-weight: 600; }
fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
legend { display: block; padding: 0; margin: 0 0 8px; font-weight: 600; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 44px; }

/* Radio answers as chips. Wrap a RadioSelect field group in .chips. */
.chips fieldset > div:not(.helptext) { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label {
  display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-size: 15px; font-weight: 500;
}
.chips label:has(input:checked) { border-color: var(--action); background: var(--action-tint); font-weight: 600; }

/* Edge picture tiles */
.edge-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 900px) { .edge-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
label.edge {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0;
  padding: 10px 4px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card);
  font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2;
}
label.edge input { position: absolute; opacity: 0; }
label.edge:has(input:checked) { border-color: var(--action); background: var(--action-tint); box-shadow: inset 0 0 0 1px var(--action); }
label.edge:has(input:focus-visible) { outline: 3px solid var(--action); outline-offset: 2px; }
.edge-icon path { fill: #D9D3C8; stroke: var(--ink); stroke-width: 1.5; }
.edge-icon text { fill: var(--ink); font-family: var(--sans); font-weight: 700; }

/* Cards, badges, banners */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; }
@media (min-width: 900px) { .card { padding: 24px; } }
.card > :last-child { margin-bottom: 0; }
.card-accent { border: 2px solid var(--action); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.card-head h2 { margin: 0; }
h3.piece-title { margin: 12px 0 4px; }
.gap-top { margin-top: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.4; white-space: nowrap; background: var(--neutral-badge); color: #3D3A34; }
.b-acc { background: var(--action-tint); color: var(--action-hover); }
.b-new { background: var(--new-bg); color: var(--new-ink); }
.b-blue { background: var(--blue-bg); color: var(--blue-ink); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.banner { padding: 12px 14px; border-radius: var(--radius); margin: 0 0 16px; font-weight: 600; }
.banner-warn { background: var(--new-bg); color: var(--new-ink); }
.banner-error { background: var(--error-bg); color: var(--error); }
.banner-info { background: var(--blue-bg); color: var(--blue-ink); }
.banner-ok { background: var(--action-tint); color: var(--action-hover); }
ul.messages { list-style: none; margin: 16px 0 0; padding: 0; }
ul.messages li { padding: 12px 14px; border-radius: var(--radius); background: var(--action-tint); color: var(--action-hover); font-weight: 600; }
ul.messages li.error { background: var(--error-bg); color: var(--error); }

/* Request form sections and the error summary */
.form-section { display: flex; flex-direction: column; gap: 18px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 21px; margin: 0; }
.section-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.piece { border-top: 1px solid var(--line); padding-top: 16px; }
.piece:first-child { border-top: 0; padding-top: 0; }
.piece h3 { margin: 0; }
details > .stack { margin-top: 12px; }
.error-summary { border: 2px solid var(--error); background: var(--error-bg); border-radius: var(--radius-card); padding: 16px; margin: 0 0 20px; }
.error-summary h2 { color: var(--error); font-size: 19px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--error); font-weight: 600; }
.drop { border: 2px dashed #BDB5A8; border-radius: 12px; padding: 16px; background: #FBFAF7; }
details > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }

/* Search */
form.search { display: flex; gap: 8px; flex-wrap: wrap; }
form.search input { flex: 1 1 220px; }
form.search select { flex: 1 1 180px; width: auto; }
form.search button { flex: 0 0 auto; }

/* Shop and stone cards */
ul.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.shop-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; }
.shop-card h3 { margin: 0 0 4px; }
.shop-card h3 a { color: var(--ink); text-decoration: none; }
.shop-card h3 a:hover { color: var(--action); }
.shop-thumb { width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; background: var(--ground); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.shop-thumb img { width: 100%; height: 100%; object-fit: contain; }
.shop-thumb .swatch { width: 100%; height: 100%; }
.shop-card .card-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 900px) {
  .shop-card { grid-template-columns: 80px minmax(0, 1fr) auto; }
  .shop-thumb { width: 80px; height: 80px; }
  .shop-card .card-actions { grid-column: auto; flex-direction: column; }
}
.distance { font-weight: 700; font-variant-numeric: tabular-nums; }
ul.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.stone-card { display: block; color: var(--ink); text-decoration: none; }
.stone-card:hover { color: var(--action); }
.stone-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
.stone-row > .stack { grid-column: 2; }
.stone-thumb { border-radius: 8px; aspect-ratio: 1; object-fit: cover; }
.stone-card img, .stone-card .swatch { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); display: block; margin-bottom: 8px; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.swatch { display: block; }
.listing-hero { border-radius: var(--radius-card); overflow: hidden; aspect-ratio: 16 / 7; max-height: 320px; width: 100%; background: var(--line); margin: 0 0 20px; }
.listing-hero img, .listing-hero .swatch { width: 100%; height: 100%; object-fit: cover; }
.listing-head { display: flex; gap: 14px; align-items: center; margin: 0 0 8px; }
.listing-head h1 { margin: 0; }
.split > aside.stack > p { margin: 0; }
.more { margin-top: 16px; }
.stone-hero { aspect-ratio: 4 / 3; max-height: none; }
.item-title { font-size: 28px; }
.price-lg { font-size: 24px; }
.listing-logo { width: 64px; height: 64px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); object-fit: contain; flex: none; }
.photos { display: grid; gap: 8px; }
.photos img { border-radius: var(--radius); width: 100%; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 16px; margin: 0; }
dl.facts dt, dl.facts dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line-soft); }
dl.facts dt { color: var(--muted); }
dl.facts dd { font-weight: 600; }

/* Tabs and lists of links */
nav.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
nav.tabs a { padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
nav.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--action); }
ul.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
ul.links a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 600; }
ul.links a:hover { border-color: var(--action); color: var(--action); }
ul.links .tile { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px; border-radius: var(--radius); }
ol.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: how; }
@media (min-width: 900px) { ol.how { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
ol.how li { counter-increment: how; }
ol.how.how-list { grid-template-columns: minmax(0, 1fr); }
ol.how h2 { font-size: 17px; margin: 0 0 4px; }
ol.how li::before { content: counter(how); display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 750; align-items: center; justify-content: center; margin-bottom: 8px; }

/* Photo textures from a real quartzite vanity. Decorative only, so every <img> gets alt="". */
.texture { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero { display: grid; gap: 20px; }
.hero-media { border-radius: var(--radius-card); overflow: hidden; height: 120px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) 400px; align-items: stretch; }
  .hero-media { height: auto; min-height: 380px; }
}
.band-stone { background: #E9E4DA url("../img/quartzite-band-800.192fa3de0c2c.jpg") center / cover; border-radius: var(--radius-card); padding: 24px 16px; }
@media (min-width: 900px) { .band-stone { background-image: url("../img/quartzite-band.37f4c715cd71.jpg"); padding: 40px; } }
.band-stone > .card { max-width: 560px; }

/* Buyer progress */
ol.steps { list-style: none; margin: 0 0 20px; padding: 0; }
ol.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; position: relative; }
ol.steps li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: #C8E0D9; }
ol.steps li.todo:not(:last-child)::before { background: var(--line); }
ol.steps .dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
ol.steps li.done .dot { background: var(--action); }
ol.steps li.done .dot svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
ol.steps li.now .dot { background: var(--card); border: 3px solid var(--action); }
ol.steps li.todo .dot { background: var(--card); border: 2px solid var(--line); }
ol.steps li.todo { color: var(--muted); }
ol.steps li.done, ol.steps li.now { font-weight: 600; }

/* Messages */
ol.thread { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
ol.thread li { max-width: 88%; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; align-self: flex-start; }
ol.thread li.mine { align-self: flex-end; background: var(--action-tint); border-color: transparent; border-radius: 14px 14px 4px 14px; }

/* Quotes */
.quote-lines { margin: 0 0 12px; }
.ql { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.ql-total { border-bottom: 0; font-size: 20px; font-weight: 750; padding-top: 12px; }
fieldset.line { border: 2px solid var(--ink); border-radius: 6px; background: var(--card); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
fieldset.line > div { margin: 0; }

/* Ticket, borrowed from the work-order direction */
.ticket { background: var(--card); border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; margin: 0 0 20px; }
.thead { background: var(--ink); color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 8px 14px; display: flex; justify-content: space-between; gap: 12px; }
.tsec { padding: 12px 14px; border-bottom: 2px solid var(--ink); }
.tsec:last-child { border-bottom: 0; }
.ttl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 6px; }
.ttl b { font-size: 18px; }
.ttl span { font-family: var(--mono); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
dl.tl { display: grid; grid-template-columns: 118px minmax(0, 1fr); margin: 0; }
dl.tl dt, dl.tl dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--line-soft); }
dl.tl dt { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); padding-top: 9px; }
dl.tl dd { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tnote { margin: 10px 0 0; }
.ticket-photos { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.ticket-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }

/* Owner layout */
.owner-layout { display: grid; gap: 24px; }
@media (min-width: 900px) { .owner-layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; } }
.owner-nav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.owner-nav a { padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; border-radius: 8px; }
.owner-nav a[aria-current] { background: var(--action-tint); color: var(--action-hover); }
.owner-nav .owner-name { display: none; }
.owner-title { font-weight: 750; margin: 0 0 4px; }
@media (min-width: 900px) {
  .owner-nav { flex-direction: column; border-bottom: 0; position: sticky; top: 24px; }
  .owner-nav .owner-name { display: block; font-weight: 750; padding: 0 12px 8px; }
  .owner-title { display: none; }
}
ul.inbox { list-style: none; margin: 0 0 24px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); }
ul.inbox li + li { border-top: 1px solid var(--line); }
ul.inbox a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
ul.inbox a:hover { background: var(--ground); }
ul.inbox .who { font-weight: 700; }
ul.inbox .what { grid-column: 1 / -1; color: var(--muted); font-size: 15px; }

/* QR card and print */
.qr-card { text-align: center; border: 2px solid var(--ink); border-radius: 12px; padding: 24px; max-width: 420px; background: var(--card); }
.qr-card svg { width: 100%; height: auto; max-width: 320px; }
pre { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-x: auto; font-family: var(--mono); font-size: 14px; white-space: pre-wrap; word-break: break-all; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line-soft); }
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .no-print, ul.messages, .owner-nav { display: none; }
  .owner-layout { display: block; }
}

/* Utilities. They come last so they win over component margins. */
.flush { margin: 0; }
.tight { margin: 4px 0 0; }
