/* =============================================================================
   The free invoice generator (pages/invoice-generator.html). Loads after outer/site.css, outer/pages.css and
   components/document-paper.css (PageAssets.applyMarketingGenerator). Design source:
   docs/mocks/site/invoice-maker/maker.css, which this follows section by section. The site has no dark theme.
   Prefix: mk-. The desk's warm light and the placeholder ink are this page's own values, named below.
   ============================================================================= */

.mk-desk, .mk-work { --mk-desk-light: #fdfbf6; --mk-desk: #f4efe3; --mk-desk-edge: #ece5d4; }
.mk-swatch--house { --c: var(--gold); }

/* ---------- head ---------- */
.mk-head { padding-block: clamp(36px, 5vw, 64px) 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 40px; align-items: end; }
.mk-head h1 { margin-top: 10px; font-size: clamp(34px, 4.2vw, 56px); line-height: 1.02; letter-spacing: -.035em; }
.mk-head .lead { max-width: 36em; margin-top: 12px; }
.mk-head .trustline { margin-top: 12px; }
@media (max-width: 860px) { .mk-head { grid-template-columns: minmax(0, 1fr); } }

/* "Start from": the templates as chips; the current one is pressed */
.mk-start { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 18px; }
.mk-start > span { flex: none; margin-right: 4px; font-size: var(--fs-sm); color: var(--caption); }
.mk-chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: #fff; font-size: var(--fs-sm); color: var(--text); text-decoration: none; }
.mk-chip:hover { border-color: var(--sand-400); }
.mk-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

/* ---------- the desk: the paper, lit from above, and one quiet panel beside it ---------- */
.mk-desk { padding-block: 32px 64px; border-block: 1px solid var(--line);
  background: radial-gradient(1100px 520px at 32% -10%, var(--mk-desk-light) 0%, var(--mk-desk) 58%, var(--mk-desk-edge) 100%); }
.mk-work { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 36px; align-items: start; }
@media (max-width: 1020px) { .mk-work { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

/* the sheet: the real paper at Letter width, scaled to the column (full width and reflowed on a phone) */
.mk-stage { position: relative; }
.mk-page { position: relative; width: 816px; transform-origin: 0 0; }
.mk-page .paper { box-shadow: 0 1px 2px rgba(40, 32, 16, .06), 0 22px 44px -22px rgba(40, 32, 16, .38), 0 46px 90px -48px rgba(40, 32, 16, .3); transition: box-shadow .3s var(--ease-out), translate .3s var(--ease-out); }
.mk-stage[aria-busy="true"] .paper { opacity: .86; transition: opacity .2s; }
.mk-stage__fold { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(118, 108, 85, .45); pointer-events: none; }
.mk-stage__fold span { position: absolute; right: 6px; top: -10px; padding: 0 6px; border-radius: var(--r-pill); background: var(--mk-desk); font-size: var(--fs-xs); color: var(--caption); }
/* printing: the sheet lifts and a gold line passes down it, like a proof leaving the press */
.mk-stage.is-printing .paper { translate: 0 -4px; box-shadow: 0 2px 4px rgba(40, 32, 16, .08), 0 34px 60px -26px rgba(40, 32, 16, .45); }
.mk-stage.is-printing .paper::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: mk-press 1.4s var(--ease-out) infinite; }
@keyframes mk-press { from { top: 0; opacity: 1; } to { top: 100%; opacity: .2; } }

/* every part of the paper is a target: a hairline on hover, gold when chosen, coral when something is missing */
.paper .mk-hot { cursor: pointer; border-radius: 6px; outline: 1.5px dashed transparent; outline-offset: 3px; scroll-margin-top: 96px; }
/* no transition on the outline: the paper is redrawn after each pause in typing, and a fresh element would fade from a dark outline */
.paper .mk-hot:hover { outline-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.paper .mk-hot:focus-visible { outline: 2px solid var(--gold); }
.paper .mk-hot.is-active { outline: 2px solid var(--gold); background-color: color-mix(in srgb, var(--gold) 7%, transparent); }
.paper .mk-hot.is-missing { outline: 2px solid var(--overdue-fg); }
.paper tr.mk-hot:hover > td, .paper tr.mk-hot.is-active > td { background-color: color-mix(in srgb, var(--gold) 7%, transparent); }
/* an empty part prints a soft invitation on screen; the PDF never carries it */
.paper .paper-tail { cursor: default; }

/* ---------- the panel ---------- */
.mk-panel { position: sticky; top: 84px; display: grid; gap: 12px; }
@media (max-width: 1020px) { .mk-panel { position: static; } }
.mk-panel .alert { margin-top: 0; }

/* style and color: four tiny drawings of the layouts, then the swatches */
.mk-look { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .72); backdrop-filter: blur(6px); }
.mk-styles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mk-styles button { display: grid; gap: 5px; justify-items: center; padding: 6px 4px 5px; border: 1px solid transparent; border-radius: var(--r-md); background: none; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.mk-styles button:hover { background: #fff; }
.mk-styles button[aria-pressed="true"] { border-color: var(--ink); background: #fff; color: var(--ink); }
.mk-thumb { --b: var(--gold); display: block; width: 100%; max-width: 54px; aspect-ratio: 8.5 / 7; border-radius: 3px; background-color: #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 4px -2px rgba(40, 32, 16, .2); }
.mk-thumb--classic { background-image: linear-gradient(var(--b), var(--b)), linear-gradient(#ddd5c3, #ddd5c3), linear-gradient(#ebe5d8, #ebe5d8), linear-gradient(#ebe5d8, #ebe5d8);
  background-size: 100% 2px, 40% 3px, 80% 2px, 80% 2px; background-position: 0 0, 15% 26%, 50% 62%, 50% 78%; background-repeat: no-repeat; }
.mk-thumb--bold { background-image: linear-gradient(var(--b), var(--b)), linear-gradient(#ddd5c3, #ddd5c3), linear-gradient(#ebe5d8, #ebe5d8);
  background-size: 100% 22%, 40% 3px, 80% 2px; background-position: 0 0, 15% 45%, 50% 75%; background-repeat: no-repeat; }
.mk-thumb--sidebar { background-image: linear-gradient(var(--b), var(--b)), linear-gradient(#f3eee2, #f3eee2), linear-gradient(#ebe5d8, #ebe5d8), linear-gradient(#ebe5d8, #ebe5d8);
  background-size: 2px 100%, 32% 100%, 52% 2px, 52% 2px; background-position: 32% 0, 0 0, 90% 40%, 90% 60%; background-repeat: no-repeat; }
.mk-thumb--overlay { background-image: linear-gradient(#fff, #fff), linear-gradient(var(--b), var(--b)), linear-gradient(#ebe5d8, #ebe5d8);
  background-size: 76% 26%, 100% 30%, 80% 2px; background-position: 50% 30%, 0 0, 50% 78%; background-repeat: no-repeat; }
.mk-colors { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.mk-swatch { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.mk-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.mk-anycolor { display: inline-grid; width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(#d24, #e93, #ec3, #4b6, #39c, #64c, #d24); cursor: pointer; }
.mk-anycolor input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* the part you chose: its fields, nothing else */
.mk-insp { padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 18px 40px -30px rgba(40, 32, 16, .35); }
.mk-insp__head { display: flex; align-items: center; gap: 4px; }
.mk-insp__head h2 { flex: 1; margin: 0 4px; font-size: var(--fs-md); letter-spacing: -.015em; }
.mk-icon-btn { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--r-md); background: none; color: var(--text-muted); }
.mk-icon-btn:hover { background: var(--paper); color: var(--ink); }
.mk-done { padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: #fff; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.mk-done:hover { border-color: var(--sand-400); }
.mk-insp__body { display: grid; gap: 12px; margin-top: 12px; max-height: calc(100vh - 400px); min-height: 160px; overflow: auto; padding: 2px; animation: mk-in .18s var(--ease-out); }
.mk-insp__body--all { max-height: calc(100vh - 330px); }
.mk-insp__body--all section { display: grid; gap: 10px; }
.mk-insp__body--all section + section { padding-top: 14px; border-top: 1px solid var(--line); }
.mk-insp__body--all h3 { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
@keyframes mk-in { from { opacity: 0; translate: 0 4px; } }

/* nothing chosen yet: one line, and the parts in order, ticked as they fill */
.mk-insp__lead { font-size: var(--fs-md); font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.mk-insp__path { display: grid; gap: 2px; margin: 10px 0 12px; padding: 0; list-style: none; }
.mk-insp__path button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: var(--r-md); background: none; text-align: left; font-size: var(--fs-sm); color: var(--text-muted); }
.mk-insp__path button:hover { background: var(--paper); }
.mk-insp__path b { color: var(--ink); font-weight: 600; }
.mk-dot { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--field-border); color: #fff; }
.is-done .mk-dot { background: var(--paid-fg); box-shadow: none; }

/* fields: the site's .field, a size smaller so a part fits without scrolling */
.mk-insp .field { gap: 4px; }
.mk-insp .field > label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em; color: var(--text-muted); }
.mk-insp .field :is(input, textarea, select) { width: 100%; padding: 8px 10px; border: 1px solid var(--field-border); border-radius: var(--r-md); background: #fff; font: inherit; font-size: var(--fs-body); color: var(--ink); }
.mk-insp .field textarea { min-height: 64px; resize: vertical; line-height: 1.5; }
.mk-insp .field input[readonly] { background: var(--paper); color: var(--text-muted); }
.mk-insp :is(input, textarea, select):focus { outline: none; border-color: var(--ink); box-shadow: var(--field-focus); }
.mk-insp :is(input, textarea)[aria-invalid="true"] { border-color: var(--overdue-fg); box-shadow: var(--field-invalid); }
.mk-insp .field__hint { font-size: var(--fs-xs); }
.mk-insp .num { text-align: right; font-variant-numeric: tabular-nums; }
.mk-row { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 10px; }
.mk-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.mk-unit select { width: auto !important; }
.mk-kind { display: inline-flex; justify-self: start; padding: 3px; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.mk-kind button { padding: 5px 14px; border: 0; border-radius: var(--r-pill); background: none; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.mk-kind button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.mk-logo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed var(--field-border); border-radius: var(--r-md); background: var(--paper); font-size: var(--fs-sm); color: var(--text-muted); }
.mk-logo__tile { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--caption); overflow: hidden; }
.mk-logo__tile img { max-width: 100%; max-height: 100%; }
.mk-logo b { color: var(--ink); font-weight: 600; }
.mk-logo .mk-linkbtn { margin-left: auto; }
.mk-linkbtn { display: inline-flex; align-items: center; gap: var(--icon-gap-sm); padding: 0; border: 0; background: none; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; white-space: nowrap; cursor: pointer; }

/* the lines: one card each, the chosen one lit */
.mk-lines { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mk-line { display: grid; gap: 6px; padding: 10px; border: 1px solid transparent; border-radius: var(--r-md); background: var(--paper); }
.mk-line.is-current { border-color: color-mix(in srgb, var(--gold) 50%, transparent); background: #fff; }
.mk-line input, .mk-line textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--field-border); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: var(--fs-sm); color: var(--ink); }
.mk-line textarea { min-height: 36px; height: 36px; resize: vertical; color: var(--text); }
.mk-line__top { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 6px; align-items: center; }
.mk-line__top input { font-weight: 600; }
.mk-line__nums { display: flex; align-items: flex-end; gap: 8px; font-size: var(--fs-xs); color: var(--text-muted); }
.mk-line__nums label { display: grid; gap: 3px; font-weight: 600; }
.mk-line__nums input { width: 84px; }
.mk-line__nums > span { padding-bottom: 8px; }
.mk-line__amt { margin-left: auto; padding-bottom: 7px; font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.mk-line__tax { display: inline-flex; align-items: center; gap: var(--icon-gap-xs); font-size: var(--fs-xs); color: var(--text-muted); }
.mk-line__tax input { width: auto; }
.mk-x { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--caption); }
.mk-x:hover:not(:disabled) { background: var(--paper); color: var(--overdue-fg); }
.mk-x:disabled { opacity: .35; }
.mk-add { justify-self: start; display: inline-flex; align-items: center; gap: var(--icon-gap-sm); padding: 7px 12px; border: 1px dashed var(--field-border); border-radius: var(--r-md); background: #fff; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.mk-add:hover { border-color: var(--ink); }
.mk-sums { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.mk-sums div { display: flex; justify-content: space-between; gap: 12px; color: var(--text-muted); }
.mk-sums .is-total { padding-top: 6px; font-size: var(--fs-body); font-weight: 600; color: var(--ink); }

/* ---------- download, and what comes after ---------- */
.mk-actions { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.mk-actions .caption b { color: var(--ink); font-weight: 600; }
.mk-actions .alert { margin-top: 0; }

/* after the PDF: help with sending it, the next invoice, then one plain sentence about BillGrid */
.mk-next { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.mk-next h3 { font-size: var(--fs-md); letter-spacing: -.015em; }
.mk-next__tips { display: grid; gap: 6px; margin: 0; padding-left: 20px; font-size: var(--fs-sm); color: var(--text); }
.mk-next__tips li::marker { color: var(--caption); }
.mk-next__tips b { color: var(--ink); font-weight: 600; }
.mk-next__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mk-next__offer { padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-muted); }
.mk-next__offer a { color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 3px; }

/* ---------- the content under the tool (what search reads) ---------- */
.mk-content { padding-block: clamp(56px, 7vw, 96px); border-top: 1px solid var(--line); }
.mk-content .section__head + * { margin-top: 32px; }
.mk-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.mk-steps li { counter-increment: s; }
.mk-steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-deep); font-weight: 700; font-size: var(--fs-sm); }
.mk-steps h3 { margin-top: 12px; font-size: var(--fs-md); letter-spacing: -.01em; }
.mk-steps p { margin-top: 6px; color: var(--text-muted); }
@media (max-width: 860px) { .mk-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .mk-steps { grid-template-columns: minmax(0, 1fr); } }

/* free vs BillGrid: what each does, plainly */
.mk-vs { width: 100%; max-width: 820px; border-collapse: collapse; font-size: var(--fs-body); }
.mk-vs th, .mk-vs td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.mk-vs thead th { font-size: var(--fs-sm); color: var(--caption); font-weight: 600; }
.mk-vs td:nth-child(n+2), .mk-vs th:nth-child(n+2) { width: 150px; text-align: center; }
.mk-vs .yes { color: var(--paid-fg); }
.mk-vs .no { color: var(--caption); }

/* ---------- phones: the paper at the screen's width; a part opens as a sheet from the bottom ---------- */
.mk-dock { display: none; }
@media (max-width: 1020px) {
  .mk-dock { display: flex; align-items: center; gap: 8px; position: sticky; bottom: 0; z-index: 3; padding: 10px var(--site-gutter) calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .mk-dock .btn { flex: 1; }
  .mk-dock__total { display: grid; font-size: var(--fs-xs); color: var(--caption); line-height: 1.2; }
  .mk-dock__total b { font-size: var(--fs-body); color: var(--ink); font-variant-numeric: tabular-nums; }
}
/* the sheet below 700 px: the paper's own narrow mode starts at 640 (maker.js NARROW) */
@media (max-width: 700px) {
  .mk-desk { padding-block: 16px 28px; }
  .mk-work.has-region .mk-insp { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-drawer); max-height: 64vh; overflow: auto; border-radius: 20px 20px 0 0; box-shadow: 0 -18px 50px -20px rgba(40, 32, 16, .45); padding-bottom: calc(16px + env(safe-area-inset-bottom)); animation: mk-sheet .24s var(--ease-out); }
  .mk-work.has-region .mk-insp::before { content: ""; display: block; width: 36px; height: 4px; margin: -4px auto 10px; border-radius: 2px; background: var(--sand-300); }
  .mk-work.has-region .mk-insp__body { max-height: none; overflow: visible; }
  .mk-work.has-region .mk-paperside { padding-bottom: 60vh; }
  body:has(.mk-work.has-region) .mk-dock { display: none; }
  .mk-styles button { font-size: var(--fs-xs); }
}
@keyframes mk-sheet { from { translate: 0 30%; opacity: .4; } }

/* ---------- print: only as the busy fallback (body.mk-print-sheet), the sheet alone ---------- */
@media print {
  body.mk-print-sheet > :not(main), body.mk-print-sheet :is(.mk-head, .mk-start, .mk-panel, .mk-content, .mk-dock, .site-footer, .site-header) { display: none !important; }
  body.mk-print-sheet .mk-desk { padding: 0; background: none; border: 0; }
  body.mk-print-sheet .mk-work { display: block; padding: 0; }
  body.mk-print-sheet .mk-stage { height: auto !important; }
  body.mk-print-sheet .mk-page { width: auto; transform: none !important; }
  body.mk-print-sheet .mk-page .paper { box-shadow: none; }
  body.mk-print-sheet .paper .mk-hot { outline: 0 !important; background: none !important; }
  body.mk-print-sheet .mk-stage__fold { display: none; }
  /* no print offer (under the daily cap or past it): the sheet is not printed on its own */
  body:not(.mk-print-sheet) .mk-stage { display: none !important; }
  @page { margin: 12mm; }
}

/* phones: the template chips scroll sideways instead of stacking three rows */
@media (max-width: 640px) {
  .mk-start { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mk-chip { flex: none; }
}
