/* Free tools and templates (lib/resource-pages.js): the site's own voice and
   pieces, plus a calculator (inputs on paper, answers on olive noir) and a
   template set on a sheet of paper that prints on its own. */
.rhero { padding-block: 56px 28px; }
.rhero > * { max-width: 900px; }
.rhero h1 { font-weight: 400; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.05; letter-spacing: -.015em; margin: 12px 0 16px; }
.rhero .lede { font-size: 18px; line-height: 1.6; color: #4F5547; max-width: 40em; }
.crumbs { font-size: 13px; margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs a::before { content: '← '; }
.rbody { max-width: 1160px; }

/* ── Calculator ── */
.calc { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0; border: 1px solid var(--rule); border-radius: 22px;
  overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.calc-in { padding: 28px 30px; display: grid; gap: 26px; }
.calc fieldset { border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.calc legend { font: 500 19px/1.2 var(--display); margin-bottom: 12px; padding: 0; }
.calc .note { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin-top: -4px; }
.in { display: grid; gap: 6px; align-content: start; }
.in > span:first-child { font-size: 13px; font-weight: 600; line-height: 1.35; }
.in small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.box { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(210,224,58,.45); }
.box i { font-style: normal; font-size: 14px; color: var(--muted); padding: 0 12px; background: var(--sand); align-self: stretch; display: flex; align-items: center; }
.box input { flex: 1; min-width: 0; border: 0; outline: 0; font: 500 16px var(--body); color: var(--ink); padding: 11px 12px;
  font-variant-numeric: tabular-nums; background: transparent; -moz-appearance: textfield; }
.box input::-webkit-outer-spin-button, .box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.seg { grid-column: 1 / -1; display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--sand); border: 1px solid var(--rule); justify-self: start; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: 600 13.5px var(--body); color: var(--muted); padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(28,36,22,.14); }
.calc-out { background: var(--ink); color: #E3E4DB; padding: 30px 30px 32px; display: flex; flex-direction: column; gap: 18px; }
.calc-out .eyebrow { color: var(--accent); }
.calc-out dl { display: grid; gap: 16px; }
.calc-out dt { font-size: 13px; color: #A9B09A; }
.calc-out .big dd { font: 400 clamp(32px, 3.4vw, 42px)/1.1 var(--display); color: #fff; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.calc-out .big span { font-size: 12.5px; color: #A9B09A; }
.calc-out .small div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; border-top: 1px solid rgba(227,228,219,.12); padding-top: 10px; }
.calc-out .small dd { font: 600 16px var(--body); color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-out .small dd.neg { color: #F4A9A0; }
.calc-out .small dd.pos { color: var(--accent); }
.calc-out .rule { height: 1px; background: rgba(227,228,219,.18); }
.calc-out .warn { font-size: 13px; background: rgba(244,169,160,.14); color: #F7C9C2; border-radius: 10px; padding: 10px 12px; }
.convert { margin-top: 28px; }
.convert h3 { font: 500 19px var(--display); margin-bottom: 10px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.convert table { border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; background: #fff; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.convert th, .convert td { padding: 10px 14px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.convert th { text-align: left; font-weight: 600; background: var(--sand); }
.convert tbody tr:last-child > * { border-bottom: 0; }

/* ── Templates ── */
.legal { font-size: 13.5px; color: var(--wait); background: var(--wait-bg); border-radius: 11px; padding: 10px 14px; margin: 14px 0 0; max-width: 820px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 18px; }
.doc-actions .done { font-size: 13px; color: var(--ok); font-weight: 600; }
.rbody > .seg { display: inline-flex; }
.paper { background: #fff; border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); max-width: 820px;
  padding: clamp(24px, 6vw, 64px) clamp(20px, 6vw, 72px); font-size: 14.5px; line-height: 1.65; color: #2A3123; }
.paper h4 { font: 600 14px var(--display); letter-spacing: .06em; margin: 22px 0 8px; }
.paper h4:first-child { font: 500 22px var(--display); letter-spacing: .04em; text-align: center; margin: 0 0 18px; }
.paper p { margin: 0 0 10px; }
.paper h5 { font: 600 11.5px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.blank { background: #F1F5C9; border-bottom: 1px solid #A9B330; padding: 0 4px; border-radius: 3px; color: #4A5418; font-size: .94em; white-space: normal; }
.blank::before { content: '['; opacity: .5; } .blank::after { content: ']'; opacity: .5; }
.sig { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); line-height: 2; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; line-height: 1.8; }
.doc-title { font: 500 26px/1.1 var(--display); margin-bottom: 8px; }
.doc-meta { display: grid; grid-template-columns: auto auto; gap: 4px 16px; font-size: 13.5px; align-content: start; }
.doc-meta div { display: contents; }
.doc-meta dt { color: var(--muted); }
.doc-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; line-height: 1.8; }
.doc-cols h5 { margin-top: 0; }
.paper table, .sheet table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.paper th, .paper td, .sheet th, .sheet td { border: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; }
.paper th, .sheet th { background: var(--sand); font-weight: 600; font-size: 12.5px; }
.paper table.lines td { height: 34px; }
.doc-totals { margin: 16px 0 0 auto; max-width: 380px; display: grid; gap: 6px; font-size: 13.5px; }
.doc-totals div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.doc-totals dd { min-width: 90px; }
.doc-totals .tot { font-weight: 600; }
.doc-list { padding-left: 20px; display: grid; gap: 6px; }
.prop-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.prop-item .ph { aspect-ratio: 1; border: 1px dashed var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 12px; background: var(--sand); }
.prop-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.prop-nums { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; margin: 6px 0; }
.prop-nums dt { color: var(--muted); font-size: 11.5px; }
.approve { font-size: 13.5px; color: #4F5547; }
.sheet { background: #fff; border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; overflow-x: auto; }
.sheet table { min-width: 1100px; }
.sheet td { height: 34px; white-space: nowrap; }
.sheet th { position: sticky; top: 0; white-space: nowrap; }

/* ── Sections, FAQ, the studio plug, more ── */
.rsec { padding-top: 80px; }
.rsec h2, .rfaq h2 { font-weight: 400; font-size: clamp(26px, 3vw, 36px); margin: 10px 0 24px; }
.rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rgrid article { background: #fff; border: 1px solid var(--rule); border-radius: 18px; padding: 24px 22px; }
.rgrid h3 { font-weight: 500; font-size: 20px; margin: 0 0 8px; }
.rgrid p { font-size: 15px; line-height: 1.6; color: #4F5547; }
.rfaq { padding-top: 80px; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 40px; }
.rfaq h2 { margin-bottom: 0; }
.rfaq details { border-bottom: 1px solid var(--rule); padding: 18px 0; }
.rfaq details:first-of-type { border-top: 1px solid var(--rule); }
.rfaq summary { cursor: pointer; list-style: none; font: 400 clamp(18px, 1.8vw, 21px)/1.35 var(--display); display: flex; justify-content: space-between; gap: 16px; }
.rfaq summary::-webkit-details-marker { display: none; }
.rfaq summary::after { content: '+'; font: 400 22px/1 var(--body); color: var(--teal); }
.rfaq details[open] summary::after { content: '−'; }
.rfaq details p { margin: 10px 0 0; color: #4F5547; font-size: 15.5px; line-height: 1.6; max-width: 40em; }
.plug { margin: 80px 0 0; background: var(--ink); color: #E3E4DB; border-radius: 26px; padding: 44px clamp(24px, 5vw, 60px);
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: center; }
.plug .eyebrow { color: var(--accent); }
.plug h2 { color: #fff; font-weight: 400; font-size: clamp(26px, 3vw, 34px); margin: 8px 0 8px; }
.plug p { color: #C9D3CF; font-size: 15px; }
.plug .ctas { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.plug .fine { font-size: 12.5px; color: #A9B09A; }
.more { padding-top: 56px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.more span { font-size: 14px; color: #6A7062; margin-right: 6px; }
.more a { font-size: 14px; padding: 8px 14px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); text-decoration: none; background: #fff; }
.more a:hover { border-color: var(--teal); }

/* ── The list at /resources ── */
.res-group { padding-top: 28px; }
.res-group h2 { font-weight: 400; font-size: 26px; margin-bottom: 16px; }
.res-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.res-card { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--rule); border-radius: 18px; padding: 24px 22px;
  text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.res-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.res-card h3 { font-weight: 500; font-size: 22px; }
.res-card p { font-size: 14.5px; color: #4F5547; line-height: 1.55; flex: 1; }
.res-card .go { font-size: 14px; font-weight: 600; color: var(--teal); }

@media (max-width: 860px) {
  .calc, .rgrid, .rfaq, .plug { grid-template-columns: minmax(0, 1fr); }
  .calc fieldset { grid-template-columns: minmax(0, 1fr); }
  .calc-in, .calc-out { padding: 22px 18px; }
  .rfaq { gap: 16px; }
  .doc-cols { grid-template-columns: minmax(0, 1fr); }
  .prop-item { grid-template-columns: 72px minmax(0, 1fr); }
}

/* Printing a template prints the template alone. */
@media print {
  @page { margin: 16mm; }
  body { background: #fff; }
  .site-head, .site-foot, .rhero, .rsec, .rfaq, .plug, .more, .doc-actions, .seg, .legal, .calc-in .note { display: none !important; }
  .rbody { padding: 0; max-width: none; }
  .paper, .sheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .sheet table { min-width: 0; font-size: 9pt; }
  .blank { background: none; border-bottom: 1px solid #999; color: #777; }
  .calc { box-shadow: none; }
  .calc-out { background: #fff; color: #000; border-left: 1px solid #ccc; }
  .calc-out dd, .calc-out .big dd, .calc-out .small dd { color: #000 !important; }
}

/* The fee calculator: examples to start from, six short fields, the answer,
   and the detail folded away underneath. */
.calc-fee { display: grid; gap: 14px; }
.fee-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.fee-presets button { font: 600 13.5px var(--body); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.fee-presets button:hover { border-color: var(--ink); }
.fee-presets button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.fee-basics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; background: #fff; border: 1px solid var(--rule); border-radius: 18px; padding: 16px 18px; }
.fee-basics .in.from-stages input { color: var(--muted); }
.fee-out { gap: 14px; border-radius: 22px; }
.fee-note { font-size: 13.5px; color: #C9D3CF; margin: -6px 0 0; }
.fee-note b { color: #fff; font-weight: 600; }
.fee-table .how { display: block; font-weight: 400; font-size: 12.5px; color: #A9B09A; margin-top: 3px; }
.inl { display: inline-flex; align-items: baseline; color: #E3E4DB; }
.inl input { width: 4.6em; font: 600 13px var(--body); color: #fff; background: rgba(227,228,219,.08); border: 0; border-bottom: 1.5px dashed var(--accent); border-radius: 4px 4px 0 0; padding: 2px 4px; margin: 0 2px; text-align: right; -moz-appearance: textfield; }
.inl input::-webkit-outer-spin-button, .inl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inl input:focus { outline: none; background: rgba(210,224,58,.18); }
.calc-fee .furn { display: none; }
.calc-fee.with-furn .furn { display: table-cell; }
.fee-more { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 4px 18px; }
.fee-more summary { cursor: pointer; list-style: none; font: 500 16px var(--display); padding: 12px 0; display: flex; justify-content: space-between; }
.fee-more summary::-webkit-details-marker { display: none; }
.fee-more summary::after { content: '+'; color: var(--teal); font: 400 20px var(--body); }
.fee-more[open] summary::after { content: '−'; }
.fee-more .note { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.fee-more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; padding-bottom: 16px; }
.fee-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fee-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 640px; }
.fee-table th, .fee-table td { padding: 10px 12px; border-bottom: 1px solid rgba(227,228,219,.12); text-align: left; vertical-align: top; }
.fee-table thead th { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #A9B09A; }
.fee-table .n { text-align: right; white-space: nowrap; }
.fee-table tbody th { font-weight: 600; color: #fff; }
.fee-table td { color: #E3E4DB; }
.fee-table td.low span { display: block; font-size: 11px; color: #F4A9A0; }
.fee-table tr.best th, .fee-table tr.best td { background: rgba(210,224,58,.10); }
.fee-table tr.best th::after { content: 'Earns the most'; display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 600; color: #1C2416; background: var(--accent); border-radius: 999px; padding: 1px 7px; vertical-align: 1px; }
.fee-table td.low { color: #F7C9C2; }
.risk { font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.risk.client, .risk.retainer { background: rgba(210,224,58,.14); color: #E5EE9A; }
.risk.you { background: rgba(244,169,160,.16); color: #F7C9C2; }
.risk.shared { background: rgba(227,228,219,.12); color: #E3E4DB; }
.fee-chart svg { width: 100%; max-width: 620px; height: auto; display: block; }
.fee-match { font-size: 14px; color: #E3E4DB; margin: 0; }
.fee-match b { color: var(--accent); font-weight: 600; }
.fee-foot { font-size: 12px; color: #A9B09A; margin: 0; }
@media (max-width: 960px) { .fee-basics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* On a phone: the comparison first, one card per method. */
@media (max-width: 640px) {
  .fee-basics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .calc-fee.with-furn .furn { display: flex; }
  .fee-chart { display: none; }   /* the cards carry the same figures */
  .fee-table { min-width: 0; }
  .fee-table thead { display: none; }
  .fee-table, .fee-table tbody, .fee-table tr, .fee-table th, .fee-table td { display: block; width: 100%; }
  .fee-table tr { border: 1px solid rgba(227,228,219,.14); border-radius: 12px; padding: 4px 0; margin-bottom: 10px; }
  .fee-table tbody th { border-bottom: 1px solid rgba(227,228,219,.12); }
  .fee-table td { display: flex; justify-content: space-between; gap: 12px; border-bottom: 0; padding: 6px 12px; text-align: right; }
  .fee-table td::before { content: attr(data-label); color: #A9B09A; font-size: 12.5px; text-align: left; }
  .fee-table td.low span { display: inline; margin-left: 6px; }
}

/* A result that just changed. */
@keyframes calc-flash { from { background: rgba(210,224,58,.35); } to { background: transparent; } }
.calc-out .flash { animation: calc-flash .9s ease-out; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .calc-out .flash { animation: none; } }
