/* 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; }
