/* Marketing pages (free tools). Sam's look (apps/shell/src/sam.css tokens) in plain CSS, no web
   fonts: system fonts keep these pages fast, which matters for search ranking. */
:root {
  --brand: #d9694b; --brand-strong: #b9452a; --brand-soft: #fbe9e2;
  --ink: #1c1a17; --ink-soft: #4f4a43; --ink-muted: #6f685f;
  --surface: #ffffff; --page: #fcf8f2; --line: #ebe4d9; --radius: 14px;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-strong); }
img { display: block; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; line-height: 1.1; }
h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0.4rem 0 0.8rem; }
h2 { font-size: 1.75rem; margin: 2.4rem 0 0.8rem; }

.m-wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.m-narrow { max-width: 760px; }
main { padding: 24px 0 64px; }

.m-header { border-bottom: 1px solid var(--line); background: rgba(252, 248, 242, 0.92); position: sticky; top: 0; z-index: 10; }
.m-header .m-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.m-header nav { display: flex; align-items: center; gap: 18px; font-size: 0.95rem; }
.m-header nav a { color: var(--ink-soft); text-decoration: none; }
.m-header nav a:hover { color: var(--ink); }
.m-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.m-brand img { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; }
.m-btn, .m-header nav a.m-btn { display: inline-block; background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font: 600 0.95rem/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.m-btn:hover, .m-header nav a.m-btn:hover { background: var(--brand-strong); color: #fff; }

.m-crumbs { font-size: 0.85rem; color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: 6px; }
.m-crumbs a { color: var(--ink-muted); }
.m-crumbs i { font-style: normal; color: var(--line); }
.m-eyebrow { margin: 20px 0 0; font: 500 0.72rem/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-strong); }
.m-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 640px; margin: 0 0 24px; }

.t-tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.t-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.t-field, .t-input { min-width: 0; }
.t-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.t-field small { font-weight: 400; color: var(--ink-muted); font-size: 0.8rem; line-height: 1.4; }
.t-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--page); }
.t-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.t-input i { font-style: normal; color: var(--ink-muted); padding: 0 10px; }
.t-input input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 12px; font: 400 1rem var(--sans); color: var(--ink); outline: none; }
.t-input i + input { padding-left: 0; }
.t-results { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.t-result { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--page); }
.t-result span { font-size: 0.85rem; color: var(--ink-muted); }
.t-result strong { font-size: 1.3rem; }
.t-primary { background: var(--brand-soft); }
.t-primary strong { color: var(--brand-strong); font-size: 1.6rem; }
.t-copy { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.t-copy span { font-size: 0.85rem; color: var(--ink-muted); }
.t-copy code { display: block; padding: 12px; border-radius: 10px; background: var(--page); font: 0.9rem/1.5 var(--mono); overflow-wrap: anywhere; }
.t-copy p { margin: 0; display: flex; gap: 14px; align-items: center; font-size: 0.9rem; }
.t-note { grid-column: 1 / -1; margin: 0; color: var(--ink-soft); }
.t-btn-quiet { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font: 500 0.85rem var(--sans); color: var(--ink); cursor: pointer; }
.t-btn-quiet:hover { border-color: var(--ink-muted); }
.t-share { margin: 14px 0 0; }

.m-cta { margin: 28px 0 0; padding: 22px; border-radius: var(--radius); background: var(--ink); color: #f4eee5; }
.m-cta h2 { margin: 0 0 6px; color: #fff; }
.m-cta p { margin: 0 0 16px; }
.m-cta .m-btn { background: var(--brand); }
.m-cta .m-btn:hover { background: #fff; color: var(--ink); }

.m-prose { color: var(--ink-soft); }
.m-prose strong { color: var(--ink); }
.m-formula { font-family: var(--mono); font-size: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink); overflow-wrap: anywhere; }
.m-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 0.95rem; }
.m-table th, .m-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.m-table th { color: var(--ink); }

.m-faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.m-faq summary { cursor: pointer; font-weight: 600; }
.m-faq p { margin: 8px 0 0; color: var(--ink-soft); }

.m-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.m-cards-hub { margin-top: 12px; }
.m-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.m-card span { color: var(--ink-soft); font-size: 0.95rem; }
.m-card:hover { border-color: var(--brand); }

.m-footer { border-top: 1px solid var(--line); padding: 40px 0 24px; font-size: 0.92rem; color: var(--ink-soft); }
.m-footer .m-wrap { display: grid; grid-template-columns: 1.6fr 1.2fr 1fr 1fr; gap: 28px; }
.m-footer a:not(.m-brand) { display: block; color: var(--ink-soft); text-decoration: none; padding: 3px 0; }
.m-footer a:hover { color: var(--ink); }
.m-footer-title { font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.m-country a, .m-footer .m-country a { display: inline; }
.m-copy { text-align: center; color: var(--ink-muted); font-size: 0.8rem; margin: 28px 0 0; }

/* Selects, text areas and line items (invoice generator). */
.t-input select, .t-input textarea { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 12px; font: 400 1rem var(--sans); color: var(--ink); outline: none; }
.t-input textarea { resize: vertical; line-height: 1.45; }
.t-wide { grid-column: 1 / -1; }
.t-row { grid-column: 1 / -1; display: grid; grid-template-columns: 3fr 1fr 1.2fr; gap: 8px; }
.t-row .t-field { gap: 0; }
.t-row-head { font-weight: 600; font-size: 0.85rem; margin-bottom: -10px; }
.t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.t-copy pre { margin: 0; padding: 12px; border-radius: 10px; background: var(--page); font: 0.9rem/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.t-results > * { min-width: 0; }
.t-doc { grid-column: 1 / -1; overflow-x: auto; }
.m-scroll { overflow-x: auto; }
.t-doc > p { margin: 14px 0 0; }
.t-names { columns: 2; margin: 0; padding-left: 1.4em; font-weight: 600; }
.t-qr { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 16px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.t-qr svg { width: 180px; height: 180px; }
.t-qr p { margin: 0; font-size: 1.1rem; }

/* Printable documents (d-*): invoice, quote, job sheet, timesheet. */
.d-doc { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 10px; padding: 28px; font-size: 0.92rem; line-height: 1.45; min-width: 520px; }
.d-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.d-title { font: 400 2rem/1 var(--serif); margin: 0 0 6px; }
.d-from { text-align: right; }
.d-muted { color: #666; margin: 0; }
.d-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #666; margin: 0 0 4px; }
.d-to { margin-bottom: 18px; }
.d-to p { margin: 0; }
.d-lines, .d-totals { width: 100%; border-collapse: collapse; }
.d-lines th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: #666; border-bottom: 2px solid #111; padding: 6px 4px; }
.d-lines td { border-bottom: 1px solid #e5e5e5; padding: 8px 4px; vertical-align: top; }
.d-ruled td { height: 34px; }
.d-num { text-align: right; white-space: nowrap; }
.d-totals { width: auto; margin: 12px 0 0 auto; min-width: 240px; }
.d-totals td { padding: 4px; }
.d-total td { font-weight: 700; border-top: 2px solid #111; font-size: 1.05rem; }
.d-notes { margin: 20px 0 0; padding-top: 12px; border-top: 1px solid #e5e5e5; color: #333; }
.d-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.d-box { margin-bottom: 14px; }
.d-blank { border-bottom: 1px solid #999; height: 28px; }

/* Content pages. */
.m-dialogue { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 6px 16px; }
.m-dialogue p { color: var(--ink); }
.m-table caption { text-align: left; padding: 10px 14px; color: var(--ink-muted); font-size: 0.85rem; caption-side: top; }
.m-more { margin-top: 28px; }
.m-embed { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: var(--surface); }
.m-embed summary { cursor: pointer; font-weight: 600; }
.m-embed pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 0.82rem/1.5 var(--mono); background: var(--page); padding: 12px; border-radius: 10px; }
body.m-bare { background: transparent; }
.m-embed-frame { padding: 8px; }
.m-credit { text-align: right; font-size: 0.82rem; color: var(--ink-muted); margin: 8px 0 0; }
.m-credit a { color: var(--ink-muted); }

/* Print: only the document. */
/* The credit at the foot of every document (calc/documents.ts) */
.d-made { margin: 22px 0 0; padding-top: 10px; border-top: 1px solid #eee; font-size: 0.75rem; color: #888; text-align: center; }
.d-made a { color: #888; }

/* Printing a document: client.ts copies it into #print-area; only that prints, on clean A4 pages with no
   browser header or footer (margin 0) and the document's own margins. */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  html.printing body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; padding: 16mm 15mm; }
  #print-area .d-doc { border: 0; border-radius: 0; padding: 0; min-width: 0; font-size: 10.5pt; }
  #print-area .d-lines tr, #print-area .d-totals { break-inside: avoid; }
  html:not(.printing) body * { visibility: hidden; }
  html:not(.printing) .t-printable, html:not(.printing) .t-printable * { visibility: visible; }
  html:not(.printing) .t-printable { position: absolute; inset: 0 auto auto 0; width: 100%; }
}
#print-area { display: none; }

@media (max-width: 640px) {
  .m-header nav a:not(.m-btn):not(:first-child) { display: none; }
  .m-footer .m-wrap { grid-template-columns: 1fr; }
  .t-tool { padding: 16px; }
  .t-row { grid-template-columns: 2fr 1fr 1.2fr; }
  .t-names { columns: 1; }
  .d-grid2 { grid-template-columns: 1fr; }
}

/* Guides */
.m-byline { color: var(--ink-muted); font-size: 0.9rem; margin: 0 0 24px; }
.m-prose blockquote { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--brand); background: #fff; border-radius: 0 10px 10px 0; }
.m-prose blockquote p { margin: 0; }

.t-audio { width: 100%; margin: 8px 0 4px; }

/* Industry pages: hero actions and official links */
.m-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.m-btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.m-btn-ghost:hover { background: #fff; color: var(--ink); }
.m-official { font-size: 0.95rem; color: var(--ink-soft); }
.m-answer { font-size: 1.02rem; line-height: 1.6; color: var(--ink); background: #fff; border-left: 3px solid var(--brand); border-radius: 0 12px 12px 0; padding: 14px 16px; margin: -8px 0 24px; }
.m-save { margin: 20px 0 0; padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.m-save h2 { margin: 0 0 6px; font-size: 1.3rem; }
.m-save p { margin: 0 0 12px; color: var(--ink-soft); }
.m-save p:last-child { margin: 0; }
.m-alt { margin: 12px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.m-alt h3 { margin: 0 0 6px; }
.m-alt p { margin: 0 0 6px; color: var(--ink-soft); }
.m-alt p:last-child { margin: 0; }

/* UK AI jobs map (pages/research.ts) */
.aj-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 24px; }
.aj-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.aj-stats strong { display: block; font: 400 2.2rem/1.1 var(--serif); color: var(--brand-strong); }
.aj-stats span { color: var(--ink-soft); font-size: 0.92rem; }
.aj-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.aj-search { flex: 1 1 240px; }
.aj-search input { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; background: var(--page); }
.aj-toggle[aria-pressed="true"] { background: var(--brand-strong); }
.aj-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--ink-muted); margin-bottom: 10px; }
.aj-legend i { width: 140px; height: 10px; border-radius: 5px; }
.aj-key { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; }
.aj-key b { width: 14px; height: 14px; border: 2.5px solid var(--ink); border-radius: 3px; }
.aj-frame { overflow-x: auto; }
.aj-map { width: 100%; min-width: 640px; height: auto; display: block; font: 600 11px var(--sans); }
.aj-group { fill: var(--ink); font: 700 12px var(--sans); }
.aj-tile { cursor: pointer; outline: none; }
.aj-tile text { fill: #1c1a17; pointer-events: none; }
.aj-tile rect { stroke: var(--surface); stroke-width: 1; transition: opacity .15s; }
.aj-tile.is-home rect { stroke: var(--ink); stroke-width: 2.5; }
.aj-tile.is-dim rect, .aj-tile.is-dim text { opacity: 0.15; }
.aj-tile.is-picked rect, .aj-tile:focus rect { stroke: var(--brand-strong); stroke-width: 3.5; }
.aj-detail { min-height: 96px; margin-top: 12px; padding: 12px 14px; background: var(--page); border-radius: 10px; font-size: 0.95rem; }
.aj-detail p { margin: 0 0 6px; }
.aj-detail dl { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 6px; }
.aj-detail dt { font-size: 0.75rem; color: var(--ink-muted); }
.aj-detail dd { margin: 0; font-weight: 600; }
.aj-badge { display: inline-block; font-size: 0.75rem; background: var(--brand-soft); color: var(--brand-strong); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }
.aj-table tr.is-home td { background: var(--brand-soft); }

/* Solution landing pages (pages/solutions.ts) */
.s-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding-top: 24px; padding-bottom: 16px; }
.s-context { margin: 18px 0 0; padding: 12px 16px; border-radius: var(--radius); background: var(--brand-soft); color: var(--ink); font-size: 0.98rem; }
.s-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.s-btn-ghost, .m-cta .s-btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.m-cta .s-btn-ghost { color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4); }
.s-hero-img { position: relative; margin: 0; }
.s-hero-img img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; }
.s-call { position: absolute; left: -16px; bottom: 20px; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(28,26,23,0.12); font-size: 0.88rem; }
.s-call span { color: var(--ink-muted); }
.s-section { padding: 8px 0 16px; }
.s-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.s-grid-3 { grid-template-columns: repeat(3, 1fr); }
.s-tile, .s-scene { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.s-tile h3, .s-scene h3 { margin: 0 0 6px; font-size: 1.05rem; }
.s-tile p, .s-scene p { margin: 0; color: var(--ink-soft); }
.s-scene { padding: 0; overflow: hidden; }
.s-scene img { width: 100%; height: auto; aspect-ratio: 20 / 13; object-fit: cover; }
.s-scene figcaption { padding: 16px 18px 18px; }
.s-benefits { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; }
.s-benefits li { padding: 10px 16px; border-radius: 999px; background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.s-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) {
  .s-hero, .s-demo, .s-grid, .s-grid-3 { grid-template-columns: 1fr; }
  .s-hero { gap: 24px; }
  .s-call { left: 12px; }
}
.s-samples { padding-left: 18px; }
.s-samples li { margin-bottom: 8px; }
.s-samples span { color: var(--ink-soft); }
.s-pref { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.s-pref legend { font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; padding: 0; }
.s-pref label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.9rem; cursor: pointer; }
.s-pref label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.s-pref legend small { font-weight: 400; color: var(--ink-muted); }
.s-industries p { margin: 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-soft); font-size: 0.95rem; }

/* Interactive demo (/demo/try/, demo-client.ts) */
.d-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.d-tabs [aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.d-panel { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; }
.d-panel[hidden] { display: none; }
.d-site, .d-call, .d-owner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.d-call, .d-owner { padding: 16px; }
.d-site-bar { margin: 0; padding: 8px 12px; background: var(--page); font-size: 0.8rem; color: var(--ink-muted); }
.d-site-body { padding: 16px; }
.d-chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.d-msg { margin: 0; padding: 8px 12px; border-radius: 12px; max-width: 85%; background: var(--page); }
.d-msg span { display: block; font-size: 0.75rem; color: var(--ink-muted); }
.d-caller { align-self: flex-end; background: var(--line); }
.d-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.d-alert { padding: 10px 12px; border-radius: 10px; background: var(--page); }
.d-alert span { display: block; font-size: 0.75rem; color: var(--ink-muted); }
.d-owner[hidden] { display: none; }
.d-alerts { margin-top: 32px; }
.d-sms-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.d-sms { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.d-sms figcaption { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.d-sms-head { margin: 6px 0 10px; font-weight: 600; }
.d-sms-head span { display: block; font-weight: 400; font-size: 0.85rem; color: var(--ink-muted); }
.d-sms-body { background: var(--page); border-radius: 12px 12px 12px 4px; padding: 10px 12px; }
.d-sms dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0; }
.d-sms dt { color: var(--ink-muted); }
.d-sms dd { margin: 0; }
.p-grade { margin-top: 24px; }
