/* ===============================
   Base & Reset
================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f9f9f9;
  color: #333;
}

/* ===============================
   Theme (Woodworking Training)
================================ */

:root {
  --accent: #0f766e;        /* forest teal */
  --accent-soft: #ecfdf5;   /* subtle hover / table bg */
}

/* ===============================
   Layout
================================ */

.container {
  max-width: 520px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Reduce space between header and main content */
main.container {
  margin-top: 20px;
}

/* ===============================
   Header (Ad-safe)
================================ */

.site-header {
  background: transparent;
  border-bottom: none;
  margin: 0;
  padding: 8px 0;
}

/* Reserved space for future ads */
.header-ad-slot {
  min-height: 0;         /* No ad yet */
  width: 100%;
}

/* Header inner */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-nav a {
  font-weight: 500;
  text-decoration: none;
  color: var(--accent);
}

/* Logo */
.site-header img {
  height: 38px;
  width: auto;
}

.site-nav a {
  font-weight: 500;
  text-decoration: none;
  color: var(--accent);
}

.site-nav a:hover {
  text-decoration: underline;
}

/* ===============================
   Header spacing fix
================================ */

.site-header .container {
  margin: 0 auto;
  padding: 0;
}

/* ===============================
   Typography
================================ */

h1 {
  text-align: center;
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 10px;
}

h2 {
  color: var(--accent);
  margin-top: 40px;
  margin-bottom: 15px;
}

h3 {
  color: var(--accent);
  margin-top: 30px;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 10px 0;
}

.hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #777;
  text-align: center;
  font-style: italic;
}

.intro {
  text-align: center;
  margin-bottom: 30px;
  color: #555;
}

/* ===============================
   Forms & Inputs
================================ */

label {
  display: block;
  margin-bottom: 20px;
  font-weight: 600;
}

input[type="number"],
input[type="date"] {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===============================
   Select (Dropdowns)
================================ */

select {
  width: 100%;
  margin-top: 6px;
  padding: 12px 40px 12px 12px;
  font-size: 1rem;
  font-family: inherit;
  color: #333;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;

  /* Remove default OS styling */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Custom dropdown arrow */
  background-image:
    linear-gradient(45deg, transparent 50%, #555 50%),
    linear-gradient(135deg, #555 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Disabled state */
select:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Ensure label spacing consistency */
label select {
  margin-top: 6px;
}

/* ===============================
   Hub & Cross-Navigation Links
================================ */

.hub-link {
  margin: 18px 0 28px;
  font-size: 0.95rem;
  color: #555;
  text-align: center;
}

.hub-link a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.hub-link a:hover {
  text-decoration: underline;
}

/* ===============================
   Results Box
================================ */

.result {
  margin-top: 25px;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  font-size: 1.05rem;
}

.result p {
  margin: 8px 0;
}

/* ===============================
   Tool List (Homepage)
================================ */

.tools {
  margin-top: 40px;
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tool-list li {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.tool-list a {
  display: block;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.tool-list-desc {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  color: #4b5563;
  font-size: 0.92em;
}

.tool-list a:hover {
  background: var(--accent-soft);
}

/* ===============================
   Footer
================================ */

.site-footer {
  background: transparent;
  border-top: none;
  margin-top: 40px;
}

.site-footer .container {
  text-align: center;
  padding: 10px 0;
}

.footer-links {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 6px;
  line-height: 1.5;
}

.footer-links a {
  color: #777;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.75rem;
  color: #999;
  margin: 0;
}

/* ===============================
   Mobile
================================ */

@media (max-width: 400px) {
  .container {
    margin: 25px auto;
    padding: 0 15px;
  }

  h1 {
    font-size: 1.6rem;
  }
}

/* ===============================
   Mobile Header
================================ */

@media (max-width: 480px) {

  .header-inner {
    padding: 6px 0;
  }

  .site-header img {
    height: 32px;
  }
}

/* =========================
   Tool list grouping labels
   ========================= */

.tool-group {
  list-style: none;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
}

.tool-group + li {
  margin-top: 0.25rem;
}

.related-calculators {
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: #666;
}

.related-calculators a {
  font-weight: 500;
}

/* ===============================
   Homepage Enhancements
   =============================== */

/* Hero section */
.hero {
  margin-bottom: 35px;
}

.hero h1 {
  margin-bottom: 12px;
}

.hero .intro {
  font-size: 1.05rem;
}

/* ===============================
   Category Hub
   =============================== */

.categories {
  margin-top: 40px;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.category-card {
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.category-card:hover {
  background: var(--accent-soft);
}

.category-card h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.category-card p {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
}

/* ===============================
   Popular Tools
   =============================== */

.popular-tools {
  margin-top: 45px;
}

/* Reuse existing tool-list styles */
.popular-tools .tool-list li {
  margin-bottom: 10px;
}

/* ===============================
   Authority Content
   =============================== */

.authority {
  margin-top: 45px;
  font-size: 0.95rem;
  color: #555;
}

.authority p {
  margin-bottom: 12px;
}

.authority a {
  font-weight: 500;
}

/* ===============================
   Content Blocks (Cards)
================================ */

.content-block {
  margin-top: 45px;
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.content-block h2 {
  margin-top: 0;
}

/* ===============================
   FAQ Section
   =============================== */

.faq {
  margin-top: 45px;
}

.faq h3 {
  margin-top: 22px;
  margin-bottom: 6px;
  font-size: 1rem;
}

.faq p {
  margin-top: 0;
  font-size: 0.95rem;
  color: #555;
}

/* ===============================
   Comparison Tables (SEO)
================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  font-size: 0.95rem;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

thead {
  background: var(--accent-soft);
}

th,
td {
  padding: 12px 14px;
  text-align: left;
}

th {
  font-weight: 600;
  color: var(--accent);
}

tbody tr:not(:last-child) {
  border-bottom: 1px solid #eee;
}

tbody tr strong {
  color: #111;
}

@media (max-width: 480px) {
  table {
    font-size: 0.9rem;
  }
}

/* ===============================
   Tooltip (calculator hints)
================================ */

.tooltip {
  position: relative;
  display: inline-block;
  margin-left: 4px;
  cursor: help;
  font-size: 0.9em;
  opacity: 0.7;
}

.tooltip:hover {
  opacity: 1;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 125%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 280px;
  padding: 8px 10px;
  background: #111;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.4;
  border-radius: 6px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 115%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
  opacity: 1;
}

/* ===============================
   Primary Tool Highlight Box
   =============================== */

.primary-tool {
  margin: 1.75rem 0 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e5e7eb;
  border-left: 4px solid var(--accent); /* subtle authority cue */
  background-color: #f9fafb;
  border-radius: 6px;
}

.primary-tool__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.primary-tool__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.primary-tool__title a {
  color: #111827;
  text-decoration: none;
}

.primary-tool__title a:hover {
  text-decoration: underline;
}

.primary-tool__description {
  font-size: 0.9rem;
  color: #374151;
  margin: 0;
}

.primary-tool + section {
  margin-top: 2.5rem;
}

/* ===============================
   Calculator — Pricing Tool
   Page: /woodworking-pricing-calculator
================================ */

/* ── Calculator card ─────────────────────────────── */
.calc-card {
  background: #fff;
  border-radius: 10px;
  padding: 22px 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  margin-top: 30px;
}

.calc-card h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

/* ── Section divider inside card ─────────────────── */
.calc-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 22px 0;
}

/* ── Advanced toggle button ──────────────────────── */
#pc-advanced-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 18px;
  font-family: inherit;
}

#pc-advanced-section {
  display: none;
}

/* ── Result panel ────────────────────────────────── */
#pc-results {
  margin-top: 24px;
  border-top: 2px solid var(--accent);
  padding-top: 18px;
}

.res-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.res-box {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}

.res-box-highlight {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
  grid-column: 1 / -1;
}

.res-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  display: block;
  margin-bottom: 4px;
}

.res-box-highlight .res-label {
  opacity: 0.85;
  color: #e0f7f4;
}

.res-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.res-secondary {
  font-size: 0.88rem;
  color: #555;
  margin-top: 12px;
  padding: 12px 14px;
  background: #f9fafb;
  border-radius: 8px;
  line-height: 1.7;
}

.res-secondary span {
  font-weight: 600;
  color: #111;
}

/* ── Cost breakdown bar ──────────────────────────── */
.breakdown-bar-wrap {
  margin: 18px 0 6px;
}

.breakdown-bar-track {
  height: 22px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
}

.breakdown-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
  min-width: 0;
}

#bar-materials { background: #2dd4bf; }
#bar-labour    { background: #0f766e; }
#bar-overhead  { background: #64748b; }
#bar-profit    { background: #f59e0b; }

.breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #555;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ── Warnings ────────────────────────────────────── */
.pc-warn-red {
  background: #fef2f2;
  border-left: 3px solid #ef4444;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.88rem;
  margin: 8px 0;
  color: #333;
}

.pc-warn-amber {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.88rem;
  margin: 8px 0;
  color: #333;
}

/* ── Action buttons ──────────────────────────────── */
.calc-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex: 1;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex: 1;
}

.btn-primary:hover  { background: #0d6560; }
.btn-secondary:hover { background: #e5e7eb; }

/* ── Small input helper text ─────────────────────── */
.input-hint {
  font-size: 0.78rem;
  color: #888;
  font-weight: 400;
  margin-top: 3px;
  display: block;
  font-style: italic;
}

/* ── Print styles ────────────────────────────────── */
@media print {
  .site-header, .site-footer, .calc-actions,
  #pc-advanced-toggle, .hint, nav { display: none !important; }
  #pc-results { display: block !important; }
  body { background: #fff; }
}

/* ================================================================
   Calculator — Board Feet Tool
   Page: /woodworking-math-calculators/board-feet-calculator
================================================================ */

/* ── Mode / unit toggle row ─────────────────────────── */
#bf-mode-toggle-wrap,
#bf-unit-toggle-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  align-items: center;
}

#bf-unit-toggle-wrap strong {
  margin-right: 4px;
  font-size: 0.9rem;
  color: #374151;
}

/* ── Single-board input grid ────────────────────────── */
.bf-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 1rem;
}

.bf-row-grid label {
  margin-bottom: 0;
}

/* ── Project mode table header ──────────────────────── */
.bf-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.2fr 2rem;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 2px 6px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 6px;
}

/* ── Project mode table rows ────────────────────────── */
.bf-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.2fr 2rem;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.bf-table-row input[type="number"],
.bf-table-row input[type="text"] {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
}

.bf-table-row input[type="number"]:focus,
.bf-table-row input[type="text"]:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15,118,110,0.15);
}

.bf-label-input { font-size: 0.85rem; }

.bf-row-result {
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f766e;
  text-align: right;
  white-space: nowrap;
}

.bf-delete-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.bf-delete-btn:hover { color: #ef4444; }

/* ── Waste slider ───────────────────────────────────── */
#bf-waste-section {
  margin: 1.4rem 0 1rem;
}

#bf-waste-section label {
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
}

.bf-slider {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 3px;
  background: linear-gradient(to right, #0f766e 0%, #0f766e var(--pct, 37.5%), #e5e7eb var(--pct, 37.5%));
  outline: none;
  margin: 10px 0 14px;
  cursor: pointer;
}

.bf-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f766e;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  cursor: pointer;
}

.bf-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0f766e;
  border: 2px solid #fff;
  cursor: pointer;
}

/* ── Waste preset buttons ───────────────────────────── */
#bf-waste-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

#bf-waste-presets .bf-preset-btn {
  font-size: 0.8rem;
  padding: 5px 12px;
  flex: none;
}

/* ── Cost bridge section ────────────────────────────── */
#bf-cost-bridge {
  margin-top: 1.2rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

#bf-cost-bridge > button {
  margin-bottom: 1rem;
}

#bf-cost-section label {
  max-width: 280px;
}

/* ── Board count note ───────────────────────────────── */
#bf-res-boards-note {
  font-size: 0.75rem;
  color: #9ca3af;
  font-style: italic;
  margin-top: 2px;
}

/* ── Responsive: collapse table on small screens ────── */
@media (max-width: 600px) {
  .bf-table-header { display: none; }

  .bf-table-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background: #f9fafb;
  }

  .bf-table-row .bf-label-input { grid-column: 1 / -1; }
  .bf-row-result { text-align: left; grid-column: 1; }
  .bf-delete-btn { grid-column: 2; text-align: right; }

  .bf-row-grid {
    grid-template-columns: 1fr 1fr;
  }

  #bf-mode-toggle-wrap,
  #bf-unit-toggle-wrap { flex-direction: column; align-items: flex-start; }

  #bf-waste-presets { flex-direction: column; }
}

/* ── Print: show breakdown table, hide controls ─────── */
@media print {
  #bf-mode-toggle-wrap, #bf-unit-toggle-wrap, #bf-waste-presets,
  #bf-waste-slider, #bf-add-row, #bf-cost-bridge,
  .bf-delete-btn, .calc-actions { display: none !important; }
  #bf-results, #bf-breakdown-section { display: block !important; }
}

/* ================================================================
   Calculator — Compound Miter Tool
   Page: /woodworking-math-calculators/compound-miter-calculator
================================================================ */

/* ── Mode tab row ───────────────────────────────────── */
.cm-mode-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.cm-tab {
  flex: 1;
  min-width: 160px;
  font-size: 0.88rem;
}

/* ── Input grid ─────────────────────────────────────── */
.cm-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 1rem;
}

/* ── Quick preset row ───────────────────────────────── */
.cm-presets {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.6rem;
}

.cm-preset-label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 600;
  white-space: nowrap;
}

.cm-preset {
  font-size: 0.8rem;
  padding: 5px 11px;
  flex: none;
}

/* ── Instructions box ───────────────────────────────── */
.cm-instructions-box {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}

.cm-instructions-box h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #0f766e;
}

.cm-instructions-box ol {
  margin: 0;
  padding-left: 1.4rem;
}

.cm-instructions-box li {
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.cm-instructions-box .input-hint {
  margin: 0.5rem 0 0.8rem;
}

/* ── Results: highlight two primary angle boxes ─────── */
/* (res-box-highlight already defined globally — no override needed) */

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  .cm-mode-wrap { flex-direction: column; }
  .cm-tab { flex: none; width: 100%; }
  .cm-presets { flex-direction: column; align-items: flex-start; }
  .cm-input-grid { grid-template-columns: 1fr; }
}

/* ── Print ──────────────────────────────────────────── */
@media print {
  .cm-mode-wrap, .cm-presets, .calc-actions { display: none !important; }
  #cm-results { display: block !important; }
  .cm-instructions-box { border: 1px solid #ccc; background: #fff; }
}

/* ================================================================
   Calculator — Woodworking Unit Converter
   Page: /woodworking-math-calculators/unit-converter
================================================================ */

/* ── Length converter input grid (reuses .uc- prefix) ─── */
.uc-length-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 1rem;
}

/* ── Feet + inches compound row ────────────────────────── */
.uc-feet-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.uc-feet-row label { flex: 1; min-width: 110px; }

.uc-feet-plus {
  font-size: 1.3rem;
  font-weight: 700;
  color: #6b7280;
  padding-bottom: 0.35rem;
  flex: none;
}

.uc-feet-hint {
  flex: none;
  width: 100%;
  margin-top: 0.2rem;
}

/* ── Fraction helper ────────────────────────────────────── */
.uc-fraction-helper {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.uc-section-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.5rem;
}

.uc-fraction-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.uc-fraction-row label { flex: none; }

.uc-frac-plus {
  font-size: 1.2rem;
  font-weight: 700;
  color: #6b7280;
  padding-bottom: 0.3rem;
}

.uc-frac-result-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.uc-frac-big {
  font-size: 1.35rem;
  font-weight: 700;
  color: #065f46;
  min-width: 80px;
}

.uc-frac-equals {
  font-size: 1.1rem;
  color: #6b7280;
}

.uc-frac-sep {
  color: #9ca3af;
  font-size: 0.9rem;
  margin: 0 2px;
}

/* ── Quick common values ────────────────────────────────── */
.uc-quick-vals {
  margin-top: 0.8rem;
}

.uc-quick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 0.5rem;
}

.uc-quick-btn {
  font-size: 0.8rem;
  padding: 5px 11px;
  flex: none;
  font-family: monospace;
}

/* ── Hardwood thickness results ─────────────────────────── */
.uc-thickness-results {
  margin: 1rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.uc-thick-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}

.uc-thick-row:last-child { border-bottom: none; }

.uc-thick-row--s2s  { background: #f8fafc; }
.uc-thick-row--s4s  { background: #f0fdfa; }
.uc-thick-row--loss {
  background: #fff7ed;
  font-size: 0.88rem;
  color: #92400e;
}

.uc-thick-label {
  font-size: 0.88rem;
  color: #374151;
}

.uc-thick-val {
  font-weight: 700;
  font-size: 0.95rem;
  font-family: monospace;
  text-align: right;
  white-space: nowrap;
  min-width: 90px;
}

.uc-thick-row--loss .uc-thick-val { color: #b45309; }

/* ── Area sheet goods box ───────────────────────────────── */
.uc-sheets-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-top: 0.8rem;
}

.uc-sheets-box strong { font-size: 0.9rem; display: block; margin-bottom: 0.6rem; }

.uc-sheets-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.uc-sheets-row label { font-size: 0.88rem; flex: none; }

.uc-sheets-result {
  font-size: 0.92rem;
  color: #374151;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 620px) {
  .uc-length-grid    { grid-template-columns: 1fr 1fr; }
  .uc-feet-row       { flex-direction: column; align-items: flex-start; }
  .uc-thick-row      { grid-template-columns: 1fr; gap: 2px; }
  .uc-thick-val      { text-align: left; }
  .uc-quick-grid     { flex-direction: column; }
  .uc-quick-btn      { width: 100%; text-align: left; }
}

@media (max-width: 400px) {
  .uc-length-grid    { grid-template-columns: 1fr; }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .cm-mode-wrap, .uc-quick-grid, .calc-actions,
  .uc-fraction-helper { display: none !important; }
  .uc-thickness-results { border: 1px solid #ccc; }
}

/* ================================================================
   Calculator — Lumber Cost Calculator
   Page: /woodworking-math-calculators/lumber-cost-calculator
================================================================ */

/* ── Mode toggle row ────────────────────────────────────── */
#lc-mode-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

#lc-mode-toggle .btn-primary,
#lc-mode-toggle .btn-secondary {
  flex: 1;
  min-width: 180px;
  font-size: 0.9rem;
}

/* ── Quick mode input grid ──────────────────────────────── */
.lc-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 0.8rem;
}

/* ── Unit / currency toggle rows ────────────────────────── */
.lc-unit-row,
.lc-currency-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.lc-unit-label {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 600;
  white-space: nowrap;
}

.lc-unit-btn,
.lc-currency-btn {
  font-size: 0.8rem;
  padding: 4px 10px;
}

.lc-unit-active,
.lc-currency-active {
  background: #1a6b3c !important;
  color: #fff !important;
  border-color: #1a6b3c !important;
}

/* ── Price row with species reference ───────────────────── */
.lc-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 1rem;
  align-items: start;
}

.lc-species-ref-label {
  font-size: 0.85rem;
}

.lc-price-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lc-currency-symbol {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
  flex: none;
}

.lc-price-input-wrap input { flex: 1; }

/* ── Waste presets ──────────────────────────────────────── */
.lc-waste-section {
  margin-bottom: 1rem;
}

.lc-waste-presets {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.lc-waste-btn {
  font-size: 0.8rem;
  padding: 4px 10px;
}

.lc-waste-active {
  background: #1a6b3c !important;
  color: #fff !important;
  border-color: #1a6b3c !important;
}

/* ── Budget row ─────────────────────────────────────────── */
.lc-budget-row {
  margin-bottom: 0.8rem;
}

/* ── Project toolbar (unit + currency side by side) ─────── */
.lc-project-toolbar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

/* ── Project table header ───────────────────────────────── */
.lc-table-header {
  display: grid;
  grid-template-columns: 2fr 0.7fr 0.7fr 0.8fr 0.5fr 0.8fr 0.8fr 0.9fr 0.3fr;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0 0.4rem;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 0.3rem;
}

/* ── Project rows ───────────────────────────────────────── */
.lc-row {
  display: grid;
  grid-template-columns: 2fr 0.7fr 0.7fr 0.8fr 0.5fr 0.8fr 0.8fr 0.9fr 0.3fr;
  gap: 5px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
}

.lc-row:last-child { border-bottom: none; }

.lc-row-species { min-width: 0; }
.lc-row-species-sel { width: 100%; font-size: 0.78rem; padding: 4px 5px; }

.lc-row input {
  width: 100%;
  font-size: 0.83rem;
  padding: 4px 6px;
}

.lc-row-calc {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1a6b3c;
  text-align: right;
  padding-right: 2px;
}

.lc-row-del {
  font-size: 0.78rem;
  padding: 3px 6px;
  color: #9ca3af;
  border-color: #e5e7eb;
}
.lc-row-del:hover { color: #dc2626; border-color: #dc2626; }

/* ── Per-species breakdown table ────────────────────────── */
.lc-breakdown-grid {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.8rem;
  margin-bottom: 0.8rem;
  font-size: 0.88rem;
}

.lc-bd-header,
.lc-bd-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 0.5rem 0.8rem;
}

.lc-bd-header {
  background: #f8fafc;
  font-weight: 700;
  font-size: 0.78rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e7eb;
}

.lc-bd-row { border-bottom: 1px solid #f1f5f9; }
.lc-bd-row:last-child { border-bottom: none; }
.lc-bd-row:nth-child(even) { background: #fafafa; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .lc-table-header { display: none; }
  .lc-row {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 6px;
    padding: 8px 0;
  }
  .lc-row-species { grid-column: 1 / -1; }
  .lc-row-del { grid-column: 3; justify-self: end; }
}

@media (max-width: 600px) {
  #lc-mode-toggle { flex-direction: column; }
  #lc-mode-toggle .btn-primary,
  #lc-mode-toggle .btn-secondary { flex: none; width: 100%; }
  .lc-price-row { grid-template-columns: 1fr; }
  .lc-quick-grid { grid-template-columns: 1fr 1fr; }
  .lc-bd-header,
  .lc-bd-row { grid-template-columns: 2fr 1fr 1fr; }
  .lc-bd-header span:nth-child(3),
  .lc-bd-row span:nth-child(3) { display: none; }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  #lc-mode-toggle, .lc-waste-presets, .calc-actions,
  .lc-unit-row, .lc-currency-row,
  .lc-row-del, #lc-add-row { display: none !important; }
  .lc-row input { border: none; padding: 0; }
  .lc-breakdown-grid { border: 1px solid #ccc; }
}

/* ================================================================
   Course Finder — Beginner Woodworking Courses
   Page: /beginner-woodworking-courses
   All classes prefixed "cf-" to avoid conflicts.
   Reuses: .calc-card, .calc-divider, .calc-actions,
           .btn-primary, .btn-secondary, .input-hint
================================================================ */

/* ── Result header (badge + course name) ─────────────────── */
.cf-result-header {
  margin-bottom: 0.6rem;
}

.cf-result-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 0.4rem;
}

.cf-result-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

/* ── Why text ────────────────────────────────────────────── */
.cf-result-why {
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.6;
  margin: 0.5rem 0 1rem;
}

/* ── CTA button (full-width variant) ─────────────────────── */
.cf-result-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-bottom: 0.5rem;
  border-radius: 7px;
  padding: 11px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  /* inherits .btn-primary colours */
}

/* ── Also-consider note ──────────────────────────────────── */
.cf-result-also {
  margin-top: 0.4rem;
}

/* ── Score bars wrapper ──────────────────────────────────── */
.cf-score-wrap {
  margin-top: 1.2rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.9rem;
}

.cf-score-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0.5rem;
}

/* ── Individual score bar row ────────────────────────────── */
.cf-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 36px;
  align-items: center;
  gap: 10px;
}

.cf-bar-label {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 600;
  white-space: nowrap;
}

.cf-bar-track {
  height: 10px;
  background: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
}

.cf-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.35s ease;
}

.cf-bar-pct {
  font-size: 0.75rem;
  color: #6b7280;
  text-align: right;
  font-family: monospace;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 400px) {
  .cf-bar-row {
    grid-template-columns: 70px 1fr 30px;
    gap: 6px;
  }
  .cf-bar-label {
    font-size: 0.72rem;
  }
}

/* ================================================================
   Carpentry Course Matcher — Trade Note
   Page: /online-carpentry-courses
   ADD THIS BLOCK anywhere after the existing cf-* rules in main.css
   (around line 1768, after the .cf-bar-row responsive block)

   Only one new class is needed — .cc-trade-note.
   All other styles are reused from the existing cf-* / calc-card
   classes already in main.css.
================================================================ */

/* ── Trade-specific next-step note (shown below the result) ──── */
.cc-trade-note {
  margin-top: 0.9rem;
  padding: 10px 14px;
  background: #f0fdf4;           /* lighter than accent-soft — distinguishable from result box */
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.6;
}

.cc-trade-note p {
  margin: 0;
  font-style: normal;            /* override .input-hint italic for readability at this length */
  color: #374151;
}