/* Content module: entity pages (about, factory, quality, terms, shipping, returns, contact,
   legal), service-page additions, apply-page additions and form results.
   Same tokens and components as site.css / pages.css (DESIGN.md, "Precision Manufacturing"). */

/* ---------- Forms (shared) ---------- */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-err { padding: 12px 14px; border-radius: var(--r-sm); background: var(--error-soft); color: var(--error); font-size: 14px; font-weight: 500; }
.field.has-err .err { display: block; }

/* ---------- Entity page head ---------- */
.ent-head { background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.ent-head-in { display: grid; gap: 14px; padding-block: 4px 32px; }
.ent-head .crumbs { margin-bottom: 4px; }
.ent-kicker { font: 500 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); }
.ent-head .h1 { max-width: 22ch; }
.ent-summary { max-width: 70ch; font-size: 16.5px; line-height: 1.62; color: var(--text); }
.ent-summary p { display: inline; }
.ent-summary strong { font-weight: 700; }
.ent-summary .ph-tag { margin-left: 8px; vertical-align: 2px; }
.ent-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 880px; margin-top: 6px; }
.ent-stats li { position: relative; display: grid; gap: 4px; align-content: start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.ent-stats b { font: 700 24px/1.05 var(--font-display); letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ent-stats span { font-size: 13px; line-height: 1.35; }
.ent-stats .ph-tag { justify-self: start; margin-top: 2px; }
.ent-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--text-tertiary); }
.ent-meta span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 12px 2px -8px; border-radius: 50%; background: var(--border-hover); vertical-align: middle; }
@media (min-width: 640px) { .ent-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) { .ent-meta { flex-direction: column; gap: 2px; } .ent-meta span + span::before { display: none; } }
@media (min-width: 900px) { .ent-head-in { padding-block: 8px 40px; gap: 16px; } .ent-summary { font-size: 17.5px; } .ent-stats b { font-size: 28px; } }

/* ---------- Entity layout ---------- */
.ent-layout { display: grid; gap: 40px; padding-block: 28px 64px; }
.ent-main { min-width: 0; }
.ent-aside { display: grid; gap: 20px; align-content: start; }
@media (min-width: 1024px) {
  .ent-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; padding-block: 40px 88px; }
  .ent-aside { position: sticky; top: calc(var(--header-h) + 20px); }
  .ent-toc-m { display: none; }
}
@media (max-width: 1023px) { .ent-toc { display: none; } }
.ent-aside-h { font: 600 12px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 10px; }
.ent-toc ol { display: grid; border-left: 1px solid var(--border); }
.ent-toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; color: var(--text-secondary); text-decoration: none; line-height: 1.35; }
.ent-toc a:hover { color: var(--text); border-left-color: var(--text); }
.ent-help { display: grid; gap: 10px; padding: 18px; border-radius: var(--r-md); background: var(--surface-alt); font-size: 14px; }
.ent-help .ent-aside-h { margin-bottom: 0; }
.ent-help-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ent-help-btns .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ent-rel ul { display: grid; border-top: 1px solid var(--border); }
.ent-rel a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); text-decoration: none; font-size: 13.5px; color: var(--text-tertiary); }
.ent-rel a b { display: block; color: var(--text); font-size: 14.5px; font-weight: 600; }
.ent-rel a:hover b { color: var(--accent); }
.ent-rel svg.i { width: 16px; height: 16px; color: var(--text-tertiary); }

/* mobile "On this page" */
.ent-toc-m { margin-bottom: 28px; border: 1px solid var(--border); border-radius: var(--r-md); }
.ent-toc-m summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; }
.ent-toc-m summary::-webkit-details-marker { display: none; }
.ent-toc-m summary::after { content: ""; width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .15s; }
.ent-toc-m[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.ent-toc-m ol { display: grid; padding: 0 16px 10px; }
.ent-toc-m a { display: block; padding: 9px 0; border-top: 1px solid var(--border-soft); font-size: 14.5px; color: var(--text-secondary); text-decoration: none; }

/* ---------- Structured sections ---------- */
.ent-sec { scroll-margin-top: calc(var(--header-h) + 16px); }
.ent-sec + .ent-sec { margin-top: 40px; }
.ent-h2 { font: 700 21px/1.25 var(--font-display); letter-spacing: -.01em; color: var(--text); }
.ent-sub { margin-top: 6px; font-size: 14px; color: var(--text-tertiary); max-width: 64ch; }
.ent-sec > .ftable-wrap, .ent-sec > .table-wrap, .ent-sec > ul, .ent-sec > ol, .ent-sec > dl, .ent-sec > form, .ent-sec > a, .ent-sec > p:not(.ent-sub), .ent-sec > .acc { margin-top: 16px; }
.ent-main > .ent-prose + .ent-sec { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
@media (min-width: 900px) { .ent-h2 { font-size: 23px; } .ent-sec + .ent-sec { margin-top: 52px; } }

.ftable-wrap { border-top: 1px solid var(--text); }
.ftable { font-size: 14.5px; }
.ftable th, .ftable td { padding: 12px 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ftable th { width: 34%; padding-right: 20px; font-weight: 500; color: var(--text-tertiary); }
.ftable td { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.ftable td small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--text-tertiary); }
.ftable td .ph-tag { margin-left: 8px; vertical-align: 1px; }
@media (max-width: 639px) { .ftable th { width: 40%; padding-right: 12px; font-size: 13.5px; } }

.qtable td .ph-tag { margin-left: 8px; vertical-align: 1px; }
.qtable-std td:nth-child(2) { font-weight: 600; }
.inh { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--success); }
.inh svg.i { width: 14px; height: 14px; stroke-width: 2.2; }

/* equipment */
.eq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.eq-grid.is-ph { overflow: visible; }
.eq-grid li { display: grid; gap: 4px; align-content: start; padding: 16px; background: var(--surface); }
.eq-grid b { font: 700 24px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.eq-grid span { font-size: 13px; line-height: 1.35; }
@media (min-width: 640px) { .eq-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* photos */
.ent-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ent-photos li:first-child { grid-column: 1 / -1; }
.ent-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); background: var(--tile); }
.ent-photos li:first-child img { aspect-ratio: 16 / 9; }
.ent-photos figcaption { margin-top: 6px; font-size: 12.5px; color: var(--text-tertiary); }
@media (min-width: 900px) { .ent-photos { grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; } .ent-photos li:first-child { grid-column: 1; grid-row: 1 / span 2; } .ent-photos li:first-child img { aspect-ratio: auto; height: calc(100% - 26px); } }

/* certificates */
.certs { display: grid; gap: 8px; }
.cert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.cert b { display: block; color: var(--text); font-size: 14.5px; }
.cert p { margin-top: 2px; color: var(--text-tertiary); }
.cert-type { display: grid; place-items: center; min-width: 64px; height: 40px; padding: 0 8px; border-radius: var(--r-sm); background: var(--surface-ink); color: #fff; font: 600 12px/1 var(--font-mono); letter-spacing: .02em; }
@media (max-width: 639px) { .cert { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px 12px; } .cert-type { justify-self: start; min-width: 52px; height: 32px; } .cert > div { grid-column: 1 / -1; grid-row: 2; } .cert .btn { grid-column: 2; grid-row: 1; } }

.ent-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--r-md); text-decoration: none; color: var(--text-secondary); font-size: 14px; transition: border-color .15s; }
.ent-card:hover { border-color: var(--text); }
.ent-card b { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.ent-card-ic { width: 40px !important; height: 40px !important; padding: 9px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }

/* GRA lookup */
.gra-look { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; max-width: 620px; }
.gra-look .input { font-family: var(--font-mono); letter-spacing: .02em; }
.gra-res { margin-top: 16px; }
.gra-res th small { display: block; margin-top: 2px; font-weight: 400; font-size: 12.5px; }
.gra-none { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-md); background: var(--warning-soft); color: var(--warning); font-size: 14px; max-width: 620px; }

/* terms summary */
.tsum { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--text); }
.tsum > div { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.tsum dt { font-size: 13.5px; color: var(--text-tertiary); padding-top: 2px; }
.tsum dd b { color: var(--text); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.tsum dd span { display: block; margin-top: 2px; font-size: 13px; color: var(--text-tertiary); }
.tsum dd .ph-tag { display: inline-flex; margin: 0 0 0 8px; vertical-align: 1px; }
@media (min-width: 900px) {
  .tsum { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--border); gap: 1px; }
  .tsum > div { grid-template-columns: 1fr; gap: 6px; padding: 18px 20px; border: 0; background: var(--surface); }
  .tsum dt { padding: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
  .tsum dd b { font-size: 17px; }
}

/* steps */
.ent-steps { margin-top: 18px; }

/* contact */
.c-cards { display: grid; gap: 1px; grid-template-columns: minmax(0, 1fr); background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.c-cards li { display: grid; gap: 4px; align-content: start; padding: 16px 18px; background: var(--surface); }
.c-l { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); }
.c-v { color: var(--text); font-weight: 600; font-size: 15.5px; overflow-wrap: anywhere; text-decoration: none; }
a.c-v { color: var(--accent); }
a.c-v:hover { text-decoration: underline; text-underline-offset: 3px; }
.c-cards small { font-size: 13px; color: var(--text-tertiary); }
.c-cards .ph-tag { justify-self: start; }
@media (min-width: 640px) { .c-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.c-form { padding: 20px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
@media (min-width: 900px) { .c-form { padding: 28px; } }

/* links list (about) */
.ent-links { display: grid; gap: 8px; }
.ent-links.is-ph { padding: 14px 16px; margin-top: 26px !important; font-size: 14px; }

/* ---------- Markdown body ---------- */
.ent-prose { max-width: 72ch; color: var(--text-secondary); font-size: 15.5px; line-height: 1.65; }
.ent-main > .ent-prose { margin-top: 48px; }
.ent-prose h2 { scroll-margin-top: calc(var(--header-h) + 16px); margin: 44px 0 12px; padding-top: 28px; border-top: 1px solid var(--border); font: 700 21px/1.25 var(--font-display); letter-spacing: -.01em; color: var(--text); }
.ent-prose h2:first-child { margin-top: 0; }
.ent-prose h3 { margin: 24px 0 8px; font: 600 16px/1.35 var(--font-display); color: var(--text); }
.ent-prose p + p, .ent-prose p + ul, .ent-prose p + ol, .ent-prose ul + p, .ent-prose ol + p { margin-top: 12px; }
.ent-prose strong { color: var(--text); font-weight: 600; }
.ent-prose a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.ent-prose a:hover { text-decoration-color: currentColor; }
.ent-prose ul { display: grid; gap: 8px; }
.ent-prose ul li { position: relative; padding-left: 20px; }
.ent-prose ul li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 1px; background: var(--text-tertiary); }
.ent-prose ol { display: grid; gap: 12px; counter-reset: ol; }
.ent-prose ol li { position: relative; padding-left: 40px; counter-increment: ol; min-height: 28px; }
.ent-prose ol li::before { content: counter(ol); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--text); display: grid; place-items: center; font: 600 12.5px/1 var(--font-display); color: var(--text); }
@media (min-width: 900px) { .ent-prose h2 { font-size: 23px; } }

/* legal pages: plain, narrower head */
.page-entity .ent-head .h1 { font-size: clamp(28px, 3vw, 40px); }

/* ---------- Service pages ---------- */
.c-hero .lead b, .c-hero .lead strong { color: var(--text-on-ink); font-weight: 600; }
.c-hero .lead { max-width: 64ch; }
.c-hero .lead .ph-tag { margin-left: 8px; vertical-align: 2px; }
.c-hero .h1 { max-width: 24ch; }
.c-hero > .container > .ph-tag { justify-self: start; align-self: flex-start; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 639px) { .hero-cta .btn { flex: 1 1 100%; } }
.qt-lead { margin-top: 8px; }
.lv-more { margin-top: auto; min-height: 36px; }
.caps li { display: flex; flex-direction: column; gap: 4px; }
.caps .inh { margin-top: auto; padding-top: 8px; }
.who-list li { align-content: start; }
@media (min-width: 900px) { .caps:has(> li:nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); } }
.need { padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.need ul { display: grid; gap: 10px; }
.need li { position: relative; padding-left: 28px; font-size: 14.5px; color: var(--text); line-height: 1.45; }
.need li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 5px; border: 2px solid var(--success); border-top: 0; border-right: 0; transform: rotate(-45deg); }
@media (min-width: 900px) { .need { padding: 24px 28px; } .need ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } }
.rfq-form .form-err { margin-bottom: 4px; }

/* ---------- Apply page ---------- */
.ap-facts { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.ap-facts dl { display: grid; font-size: 13.5px; }
.ap-facts dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.ap-facts dt { color: var(--text-tertiary); }
.ap-facts dd { color: var(--text); font-weight: 600; text-align: right; }
.ap-facts .text-btn { min-height: 36px; }
.ap-about { max-width: 820px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.ap-about .ent-prose { margin-top: 10px; font-size: 14.5px; }

/* ---------- Sent page ---------- */
.sent { padding-bottom: 72px; }
.sent-card { display: grid; justify-items: center; gap: 12px; max-width: 560px; margin: 24px auto 0; padding: 40px 28px; border: 1px solid var(--border); border-radius: var(--r-md); text-align: center; }
.sent-ic { width: 48px !important; height: 48px !important; padding: 11px; border-radius: 50%; background: var(--success-soft); color: var(--success); stroke-width: 2.2 !important; }
.sent-ref { font-size: 14px; }
.sent-ref .mono { color: var(--text); font-weight: 600; }
.sent-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

/* /rfq: style card next to the factory-quote form (PRICING.md §4) */
.rfq-card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface, #fff); color: inherit; text-decoration: none; }
.rfq-card img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--surface-2, #f4f4f4); }
.rfq-card > span { display: grid; gap: 2px; font-size: 13px; line-height: 1.4; color: var(--text-secondary); min-width: 0; }
.rfq-card > span > b { color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Service pages: depth blocks (copy review 2026-10-18) ---------- */
/* heading left, body right, as the earrings guide sections */
.svc-sec { display: grid; gap: 14px; }
.svc-sec + .svc-sec { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.svc-sh .h2 { margin: 0; }
.svc-sb { display: grid; gap: 14px; min-width: 0; align-content: start; }
.svc-sb > p { max-width: 72ch; font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
.svc-sb > p.small { font-size: 13.5px; }
.svc-sb > .h4 { margin-top: 14px; }
.svc-sb .table-wrap { margin: 0; }
.svc-sb .timeline { margin-bottom: 4px; }
@media (min-width: 900px) {
  .svc-sec { grid-template-columns: 300px minmax(0, 1fr); gap: 48px; }
}
/* computed tables: every cell is data, not the muted note column */
.svc-t td, .svc-t td:last-child { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.svc-t th[scope="row"] { white-space: nowrap; }
.svc-t-cols thead th:not(:first-child) { color: var(--text); font-weight: 600; }
@media (max-width: 639px) {
  .svc-t th[scope="row"] { white-space: normal; }
  .svc-t td { display: flex; justify-content: space-between; gap: 12px; }
  .svc-t td::before { content: attr(data-label); flex: 0 0 auto; max-width: 48%; color: var(--text-tertiary); font-size: 13px; }
  .svc-t td:empty { display: none; }
  .svc-t-cols td { display: block; }
  .svc-t-cols td::before { display: block; max-width: none; margin-bottom: 1px; }
}
/* lists */
.svc-two { display: grid; gap: 20px; }
.svc-two .h4 { margin-bottom: 10px; }
@media (min-width: 900px) { .svc-two { grid-template-columns: 1fr 1fr; gap: 40px; } }
.svc-dash { display: grid; gap: 10px; max-width: 72ch; }
.svc-dash li { position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.55; color: var(--text-secondary); }
.svc-dash li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 8px; height: 1px; background: var(--text-tertiary); }
.svc-dash b { color: var(--text); font-weight: 600; }
/* labelling rules by market */
.svc-rules { display: grid; border-top: 1px solid var(--text); }
.svc-rules > div { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.svc-rules dt { font-weight: 600; color: var(--text); }
.svc-rules dd { font-size: 14.5px; line-height: 1.6; color: var(--text-secondary); max-width: 72ch; }
@media (min-width: 900px) { .svc-rules > div { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 16px 0; } }
.svc-secs .need { padding: 20px 22px; }
@media (min-width: 900px) { .svc-secs .need ul { grid-template-columns: 1fr; } }
.sec-head p { margin-top: 6px; color: var(--text-secondary); font-size: 14.5px; }
