/* Shared look for the interactive tools under /tools/.
   Page-specific layout (e.g. the stress-tensor grid) stays inline in each tool page. */

/* --- Page header --- */
.tool-header { margin-top: 28px; }
.tool-crumbs { font-size: 13px; color: #999; margin: 0 0 6px 0; }
.tool-crumbs a { color: #999; text-decoration: none; }
.tool-crumbs a:hover { color: #ff6f61; }
.tool-header h1 { font-size: 32px; margin: 0; }
.tool-lede { color: #555; font-size: 16px; line-height: 1.55; margin: 10px 0 0 0; max-width: 760px; }

@media (max-width: 768px) { .tool-header h1 { font-size: 24px; } }

.tool-page a { color: #ff6f61; text-decoration: none; }
.tool-page a:hover { text-decoration: underline; }
.tool-page .navbar a { color: #333; }
.tool-page .navbar a:hover { text-decoration: none; }

/* --- Related-course box --- */
.tool-related {
  background: #f7f7f7; border-left: 4px solid #ff6f61;
  padding: 12px 16px; font-size: 14px; color: #555; margin-top: 28px; margin-bottom: 40px;
}
.tool-related strong { color: #333; }

/* --- Calculator card --- */
.calc-wrap {
  margin-top: 22px; border: 1px solid #e2e0dc; border-radius: 6px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.calc-head {
  background: #555; color: #fff; padding: 10px 18px; font-weight: bold;
  letter-spacing: 0.05em; font-size: 15px; display: flex; align-items: center; gap: 10px;
}
.calc-head .dotlive {
  width: 9px; height: 9px; border-radius: 50%; background: #ff6f61;
  animation: dotpulse 2s ease-in-out infinite;
}
@keyframes dotpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.calc-body { padding: 18px; background: #fff; }
.calc-wrap sub, .calc-wrap sup { font-size: 72%; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.preset-chip {
  border: 1px solid #ddd; background: #fafafa; border-radius: 20px; padding: 5px 14px;
  font-size: 13px; color: #555; cursor: pointer; font-family: sans-serif;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}
.preset-chip:hover { border-color: #ff6f61; color: #ff6f61; background: #fff; transform: translateY(-2px); }

.units-note { font-size: 12.5px; color: #999; margin: 8px 2px 0 2px; }

/* --- Result cards --- */
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 8px; }
.rescard {
  background: #fafafa; border: 1px solid #eee; border-radius: 5px; padding: 10px 14px;
  transition: box-shadow 0.25s, transform 0.25s;
}
.rescard:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08); transform: translateY(-2px); }
.rescard .rlabel { font-size: 12px; color: #888; letter-spacing: 0.03em; }
.rescard .rname { font-size: 12.5px; color: #aaa; }
.rescard .rval {
  font-size: 21px; color: #333; font-weight: 600; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.rescard.primary { border-left: 4px solid #ff6f61; }
.rescard.secondary { border-left: 4px solid #0055aa; }
.rval.pop { animation: valpop 0.45s ease; }
@keyframes valpop { 0% { transform: scale(1); color: #ff6f61; } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.rval.vec { font-size: 15.5px; font-variant-numeric: normal; }
.rval.vec b { font-style: italic; color: #ff6f61; }

@media (prefers-reduced-motion: reduce) {
  .dotlive, .rval.pop { animation: none !important; }
}
