/* Tools view (mead calculators). Every selector is scoped under .tools-view.
   Builds on the shared vocabulary in app.css (.card, .fields, .calc-result, .chip…). */

/* Sticky row of jump chips, parked just under the app's sticky top bar
   (--tools-sticky-top is measured in tools.js mount()). */
.tools-view .tools-jump {
  position: sticky; top: var(--tools-sticky-top, 0px); z-index: 20;
  margin: 0 0 12px; padding: 7px; border-radius: 14px;
  background: rgba(245, 243, 238, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(222, 217, 207, .8);
}
.tools-view .tools-jump { scrollbar-width: none; }        /* still swipes sideways; the cut-off chip hints at more */
.tools-view .tools-jump::-webkit-scrollbar { display: none; }
.tools-view .tools-jump .chip { flex: none; min-height: 36px; }

/* Jump / deep-link targets land below both sticky bars. */
.tools-view .tools-section,
.tools-view .tools-card { scroll-margin-top: calc(var(--tools-sticky-top, 0px) + 66px); }
.tools-view .tools-section { margin-bottom: 6px; }
.tools-view .tools-section > .notice { margin-top: 0; }

.tools-view .tools-quickfill { margin: 0 0 4px; }
.tools-view .tools-quickfill .mini { margin: 8px 0 0; }

/* Cards */
.tools-view .tools-card { display: flex; flex-direction: column; }
.tools-view .tools-card h3 { margin-bottom: 4px; }
.tools-view .tools-purpose { margin: 0 0 10px; }
.tools-view .tools-card > .notice { margin: 10px 0; font-size: 13.5px; }
.tools-view .tools-card > .tools-purpose + .notice { margin-top: 0; }
.tools-view .tools-run { margin-top: 10px; align-self: flex-start; }
.tools-view .tools-note { margin: 8px 0 0; }

/* Results */
.tools-view .calc-result { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tools-view .calc-result.tools-warn { background: var(--goldSoft); color: #5a4212; }
.tools-view .tools-sub { display: block; margin-top: 4px; font-weight: 600; font-size: 13px; color: #3f4b44; }
.tools-view .tools-warn .tools-sub { color: inherit; }
.tools-view .tools-src { color: var(--muted); font-weight: 500; font-size: 12px; }
.tools-view .tools-table { margin: 8px 0 2px; font-weight: 600; font-size: 13px; background: transparent; }
.tools-view .tools-table th { padding: 5px 6px; }
.tools-view .tools-table td { padding: 6px; border-bottom-color: rgba(47, 91, 70, .15); }
.tools-view .tools-table .qty { text-align: right; }

/* Extra blocks inside cards */
.tools-view .tools-card details { margin: 10px 0 0; }
.tools-view .tools-card details .fields { margin-top: 8px; }
.tools-view .tools-notes { margin: 0; padding-left: 18px; font-size: 13px; color: #3d3b36; }
.tools-view .tools-notes li + li { margin-top: 6px; }
.tools-view .tools-steps { margin: 0 0 4px; padding-left: 20px; font-size: 13.5px; }
.tools-view .tools-steps li + li { margin-top: 4px; }

/* Brief highlight when a card is deep-linked or its Calculate button is used. */
.tools-view .tools-flash { animation: tools-flash 1.6s ease-out; }
@keyframes tools-flash {
  0% { box-shadow: 0 0 0 4px rgba(47, 91, 70, .35); }
  100% { box-shadow: 0 0 0 4px rgba(47, 91, 70, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .tools-view .tools-flash { animation: none; outline: 3px solid rgba(47, 91, 70, .35); outline-offset: 2px; }
}

@media (max-width: 760px) {
  .tools-view .tools-jump { padding: 6px; border-radius: 12px; }
  .tools-view .tools-jump .chip { padding: 6px 10px; font-size: 12.5px; }
}

@media print {
  .tools-view .tools-jump, .tools-view .tools-quickfill, .tools-view .tools-run { display: none; }
  .tools-view .tools-card { break-inside: avoid; }
}
