/* ==========================================================================
   Blackfire new tools — css/tools-new.css
   land-area-converter.html (nt-*) and market-trends.html (mt-*).
   Load after css/style.css and css/bf-tools.css; uses their tokens (--accent, --ink, --stone,
   --rule, --ash, --paper, --bf-error, Barlow). No framework.
   ========================================================================== */

/* the floating "Ask Blackfire" button (bottom-right, about 48 px tall) never covers the last
   controls on the page: there is always room to scroll them above it */
body.page-newtools main { padding-bottom: 72px; }
body.page-newtools .tool-nav a { min-height: 44px; display: flex; align-items: center; }
/* links inside running text are underlined so they do not look like plain (muted) text */
body.page-newtools main p a:not(.btn):not(.bf-btn), body.page-newtools main td a, body.page-newtools .mt-empty a { text-decoration: underline; text-underline-offset: 2px; }

/* ---- shared form bits ------------------------------------------------------- */
.nt-field, .mt-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.nt-field label, .mt-field label, .mt-field .mt-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.nt-hint, .mt-hint { font-size: 13.5px; color: var(--stone); line-height: 1.35; }
.nt-field input, .nt-field select, .mt-field input, .mt-field select, .mt-field textarea {
  font: inherit; font-size: 16px; color: var(--ink);
  min-height: 44px; padding: 9px 10px; width: 100%; max-width: 100%;
  border: 1px solid #8f8f8a; border-radius: 3px; background: #fff;
}
.mt-field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.nt-field input:focus, .nt-field select:focus, .mt-field input:focus, .mt-field select:focus, .mt-field textarea:focus {
  outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--ink);
}
.mt-field select:disabled { background: var(--ash); color: var(--stone); cursor: not-allowed; }
.nt-status, .mt-status { min-height: 1.4em; margin: 0; font-size: 14px; color: var(--stone); }

/* ==========================================================================
   Land area converter
   ========================================================================== */
.nt-calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.nt-form { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.nt-field--value input { font-size: 22px; font-weight: 600; max-width: 320px; }
.nt-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; }
.nt-swap {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 8px 14px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink);
  background: var(--paper); border: 1px solid var(--ink); border-radius: 3px; cursor: pointer;
}
.nt-swap span { font-size: 20px; line-height: 1; }
.nt-swap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .nt-swap:hover { background: var(--ink); color: #fff; } }

.nt-marla { margin: 0; padding: 14px 16px 6px; border: 1px solid var(--rule); background: var(--ash); min-width: 0; }
.nt-marla legend { padding: 0 6px; font-size: 15px; font-weight: 700; }
.nt-radio { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 8px 4px; cursor: pointer; border-top: 1px solid var(--rule); }
.nt-radio:first-of-type { border-top: 0; }
.nt-radio input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); }
.nt-radio span { font-size: 15.5px; line-height: 1.35; }
.nt-radio small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--stone); }
.nt-radio:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.nt-why { margin: 10px 0 8px; font-size: 14.5px; color: var(--graphite); line-height: 1.5; }
.nt-actions { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.nt-actions .btn { min-height: 44px; }

.nt-out { position: sticky; top: 140px; min-width: 0; }
.nt-caption, .mt-caption { caption-side: top; text-align: left; font-weight: 700; font-size: 15px; color: var(--ink); padding: 0 0 6px; }
.nt-units th, .nt-conv th { width: 60%; }
.nt-hl-to th, .nt-hl-to td { color: var(--ink) !important; font-weight: 700; background: #fff4ef; }
.nt-hl-from th, .nt-hl-from td { color: var(--ink) !important; font-weight: 600; }
.nt-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--stone); border-radius: 2px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--stone); vertical-align: 1px;
}
.nt-tag--to { border-color: var(--bf-accent-strong, #bf3b16); color: var(--bf-accent-strong, #bf3b16); }
.nt-note { margin: 0 0 10px; font-size: 14px; color: var(--stone); }
.nt-static { max-width: 820px; background: var(--paper); padding: 6px 16px; border: 1px solid var(--rule); }
.nt-noscript { padding: 12px 14px; border-left: 4px solid var(--accent); background: var(--ash); }

@media (max-width: 1024px) {
  .nt-calc { grid-template-columns: 1fr; gap: 28px; }
  .nt-out { position: static; }
}
@media (max-width: 520px) {
  .nt-pick { grid-template-columns: 1fr; }
  .nt-swap { justify-self: start; }
  .nt-field--value input { max-width: none; }
  .nt-units th, .nt-conv th { width: auto; }
}
@media print {
  body.page-newtools main { padding-bottom: 0; }
  .nt-hl-to th, .nt-hl-to td { background: none; }
}

/* ==========================================================================
   Market trends
   ========================================================================== */
.mt-sections { top: 76px; }
.mt-intro { padding-bottom: 8px; }
.mt-summary { max-width: 860px; }
.mt-summary-h { font-size: 22px; margin-bottom: 10px; }
.mt-status-box { border-left: 4px solid var(--accent); background: var(--ash); padding: 12px 18px; margin-bottom: 10px; }
.mt-status-list { margin: 0; padding-left: 1.1em; font-size: 15.5px; }
.mt-status-list li { margin: 4px 0; }
.mt-loading { color: var(--stone); margin: 0; }
.mt-small, .mt-muted { font-size: 14px; color: var(--stone); }
.mt-muted { font-size: inherit; }
.mt-error-text { color: var(--bf-error); font-weight: 500; }
.mt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mt-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; margin: 0 0 22px; align-items: end; }
.mt-filters--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mt-filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.mt-out { min-width: 0; }
.mt-result-h { font-size: 16px; margin: 0 0 14px; }

.mt-empty { border: 1px dashed #a9a9a3; background: var(--paper); padding: 16px 18px; max-width: 860px; }
.mt-empty p:last-child, .mt-empty ul:last-child { margin-bottom: 0; }
.mt-empty ul { margin: 0 0 12px; }
.mt-error { border-style: solid; border-color: var(--bf-error); background: var(--bf-error-bg, #fff6f5); }
.mt-needs { border-left: 4px solid #8a4b00; background: #fff8ec; padding: 10px 14px; font-size: 15px; max-width: 860px; }
.mt-note { border-left: 4px solid var(--rule); padding: 8px 14px; font-size: 15px; color: var(--graphite); max-width: 860px; }
.mt-note--block { border-left-color: var(--accent); background: var(--ash); padding: 14px 18px; }
.mt-note code, .mt-method code { font-size: 13.5px; background: var(--ash); padding: 1px 4px; overflow-wrap: anywhere; }
.mt-flag { display: inline-block; font-size: 13px; color: #735400; }
.mt-kind-note { font-size: 14.5px; color: var(--stone); margin: -4px 0 10px; }
.mt-note-cell { display: block; font-size: 13px; color: var(--stone); margin-top: 3px; }

.mt-group { border-top: 2px solid var(--ink); padding: 14px 0 6px; margin-bottom: 18px; }
.mt-group-h { font-size: 18px; margin: 0 0 8px; }
.mt-group-h .mt-muted { font-size: 15px; font-weight: 500; }
.mt-obs-table th[scope="row"] { width: 26%; }
.mt-obs-table td { min-width: 150px; }
.mt-change td.num strong { color: var(--ink); }

.mt-actions-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 14px 0 6px; }
.mt-link, .mt-wa { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.mt-wa { color: var(--ink); }

/* chart */
.mt-chart { position: relative; max-width: 760px; margin: 6px 0 4px; border: 1px solid var(--rule); background: #fff; padding: 6px 4px 0; }
.mt-svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.mt-grid { stroke: #e1e0d9; stroke-width: 1; }
.mt-base { stroke: #c3c2b7; }
.mt-tick { font-size: 12px; fill: #5c5c5a; font-variant-numeric: tabular-nums; }
.mt-axis-title { font-size: 12px; fill: #5c5c5a; font-weight: 600; }
.mt-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mt-dot { stroke: #fff; stroke-width: 2; }
.mt-range line { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.mt-hit { fill: transparent; cursor: default; }
.mt-hit:focus { outline: none; }
.mt-hit:focus-visible { stroke: var(--accent); stroke-width: 2; }
.mt-direct { font-size: 12.5px; fill: var(--ink); font-weight: 600; }
.mt-tip {
  position: absolute; z-index: 5; pointer-events: none; max-width: 280px;
  padding: 6px 9px; background: var(--ink); color: #fff; font-size: 13.5px; line-height: 1.35; border-radius: 3px;
}
.mt-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 8px 0; font-size: 14px; }
.mt-key { display: inline-block; width: 18px; height: 3px; margin-right: 7px; vertical-align: middle; border-radius: 2px; }
.mt-series-list { font-size: 15px; margin: 10px 0 14px; max-width: 860px; }
.mt-mat-table td { font-size: 14.5px; }
/* wide tables scroll inside their own box on phones instead of squeezing every column */
.mt-mat-table, .mt-report-table { min-width: 720px; }

/* report */
.mt-report-form { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; margin-bottom: 18px; }
.mt-choice { border: 0; margin: 0; padding: 0; min-width: 0; }
.mt-choice legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 4px; }
.mt-radio { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-right: 18px; font-size: 15.5px; cursor: pointer; }
.mt-radio input { width: 20px; height: 20px; accent-color: var(--accent); }
.mt-report-opts { display: flex; flex-wrap: wrap; gap: 14px 18px; }
.mt-report-opts .mt-field { min-width: 220px; }
.mt-report { border: 1px solid var(--rule); background: #fff; padding: 18px 20px; max-width: 900px; }
.mt-report h4 { font-size: 16px; margin: 18px 0 6px; }
.mt-report-brand { font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--stone); margin: 0 0 4px; }
.mt-report-title { font-size: 22px; margin: 0 0 4px; }
.mt-report ul { font-size: 15px; }
.mt-report-table td { font-size: 14px; }
.mt-url { overflow-wrap: anywhere; font-size: 12.5px !important; color: var(--stone); }

/* share form */
.mt-share { max-width: 900px; display: flex; flex-direction: column; gap: 14px; }
.mt-share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.mt-err { display: block; padding-left: 9px; border-left: 3px solid var(--bf-error); color: var(--bf-error); font-size: 14px; font-weight: 500; }
.mt-err[hidden] { display: none !important; }
.mt-field [aria-invalid="true"] { border-color: var(--bf-error); box-shadow: inset 0 0 0 1px var(--bf-error); background: var(--bf-error-bg, #fff6f5); }
.mt-consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; cursor: pointer; min-height: 44px; }
.mt-consent input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); }
.mt-consent input[aria-invalid="true"] { outline: 2px solid var(--bf-error); outline-offset: 2px; }
.mt-share .btn, .mt-share .bf-btn { min-height: 44px; }
.mt-share-out { border: 1px solid var(--rule); background: var(--ash); padding: 14px 16px; }
.mt-preview { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.5 var(--font); background: #fff; border: 1px solid var(--rule); padding: 10px 12px; margin: 0 0 12px; }

.mt-method { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 48px; max-width: 1000px; }
.mt-method h3 { font-size: 18px; margin-top: 8px; }
.mt-method p { font-size: 15.5px; }

@media (max-width: 1024px) {
  .mt-filters, .mt-filters--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-method { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .mt-filters, .mt-filters--5, .mt-share-grid { grid-template-columns: 1fr; }
  .mt-report { padding: 14px 12px; }
  .mt-report-opts .mt-field { min-width: 0; flex: 1 1 100%; }
  .mt-obs-table td { min-width: 120px; }
  .mt-radio { margin-right: 0; width: 100%; }
}

/* print: the whole page prints its sections without navigation; "Print or save as PDF" prints the report only */
@media print {
  body.page-trends .tool-nav, body.page-trends .mt-filters, body.page-trends .mt-report-form, body.page-trends .mt-actions-row,
  body.page-trends #share, body.page-trends .mt-tip, body.page-trends .page-title .contact-line { display: none !important; }
  body.mt-printing-report main > *:not(#report) { display: none !important; }
  body.mt-printing-report #report > .wrap > *:not(#report-out) { display: none !important; }
  body.mt-printing-report #report { padding: 0 !important; border: 0 !important; }
  .mt-report { border: 0; padding: 0; max-width: none; }
  .mt-report .bf-table-wrap { overflow: visible; }
  .mt-mat-table, .mt-report-table { min-width: 0; }
  .mt-chart { break-inside: avoid; border-color: #999; }
  .mt-group { break-inside: avoid-page; }
}
