/* Web calculator page (book-sales-calculator/index.html), on top of /assets/site.css.
   The result markup comes from the extension's renderer: h2, p.metric (strong + small), p.note. */
.lead { font-size: 18px; }

.calc { margin: 28px 0 0; padding: 20px; border: 1px solid #cfd6e0; border-radius: 12px; background: #f7f9fc; }
.calc .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 16px; align-items: start; }
.calc .grid + .grid { margin-top: 8px; }
.calc .grid[data-for="print"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc .field { min-width: 0; }
.calc label { display: block; margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.calc input[type="text"], .calc select { display: block; width: 100%; height: 46px; padding: 0 10px; line-height: normal; border: 1px solid #8b96a5; border-radius: 6px; background: #fff; color: inherit; font: inherit; }
.calc input[aria-invalid="true"] { border-color: #a72222; box-shadow: 0 0 0 1px #a72222; }
.calc .check { display: flex; align-items: center; gap: 10px; min-height: 44px; grid-column: 1 / -1; margin: 0 0 4px; }
.calc .check input { width: 22px; height: 22px; margin: 0; flex: none; }
.calc .check label { margin: 0; font-weight: 500; }
.hint { margin: 4px 0 10px; color: #556072; font-size: 14px; line-height: 1.4; }
.calc .error { margin: 8px 0 0; color: #a72222; font-size: 16px; }
.calc .error:empty { display: none; }
.calc button { min-height: 48px; }

.result { margin: 20px 0 0; padding: 20px; border: 1px solid #cfd6e0; border-radius: 12px; }
.result h2 { margin: 0 0 8px; font-size: 20px; }
.result p { margin: 6px 0; }
.result .metric { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.result .metric strong { font-size: 30px; line-height: 1.2; }
.result .metric small { color: #556072; font-size: 16px; }
.result .note { color: #556072; font-size: 15px; }
/* v0.2.1 (user test #6): a result that no longer matches the fields. */
.result.stale { opacity: .45; }
/* v0.2.1 (user test #11): space between the store box and the cover calculator line. */
.cross-link { margin-top: 24px; }
.table-wrap { overflow-x: auto; }
.constants { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 16px; }
.constants caption { text-align: left; font-weight: 600; margin-bottom: 6px; }
.constants th, .constants td { padding: 8px 10px 8px 0; border-bottom: 1px solid #e3e8ef; text-align: left; vertical-align: top; }

.cta { margin: 36px 0 0; padding: 20px; border-radius: 12px; background: #eef3fd; }
.cta h2 { margin-top: 0; }
.cta-button { display: inline-block; padding: 13px 24px; border-radius: 10px; background: #255cd1; color: #fff; font-weight: 650; text-decoration: none; }
.cta-button:hover, .cta-button:focus-visible { background: #1d4cb0; }

h3 { font-size: 18px; line-height: 1.35; margin: 22px 0 6px; }
.formula { white-space: nowrap; }
sup { line-height: 0; }

@media (max-width: 640px) {
  .lead { font-size: 17px; }
  .calc, .result, .cta { padding: 16px; }
  .calc .grid { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .calc .grid + .grid { margin-top: 12px; }
  .calc .check { margin-bottom: 8px; }
  /* Fix pass 2 (site test S3): print fields one per row on a phone, as the others. */
  .calc .grid[data-for="print"] { grid-template-columns: minmax(0, 1fr); }
  .constants { font-size: 14px; }
  .constants th, .constants td { padding: 6px 6px 6px 0; }
  .calc button, .cta-button { display: block; width: 100%; text-align: center; }
}

/* SEO pages (2026-11-22). The KDP royalty calculator uses the sales page's form and result; its rows without a rank or
   KU field have two columns (.grid.two). The BSR to
   sales accuracy page: key numbers, the plot (an inline SVG with presentation attributes, generated by
   web-calculator/accuracy-assets.mjs) and the 41-day table in a details block. The plot keeps a readable size on a
   phone and scrolls sideways inside its figure instead of the page. */
.calc .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.key-numbers li { margin-bottom: 8px; }
.acc-figure { margin: 16px 0 20px; overflow-x: auto; }
.acc-plot { display: block; width: 100%; min-width: 560px; height: auto; }
.acc-figure figcaption { margin-top: 8px; color: #556072; font-size: 15px; }
.note-small { color: #556072; font-size: 14px; }
.acc-details { margin: 16px 0 8px; }
.acc-details summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.acc-table { border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.acc-table caption { text-align: left; font-weight: 600; margin-bottom: 6px; }
.acc-table th, .acc-table td { padding: 6px 10px 6px 0; border-bottom: 1px solid #e3e8ef; text-align: left; }
@media (max-width: 640px) {
  .calc .grid.two { grid-template-columns: minmax(0, 1fr); }
}
