/* Scoped to #trayonomics-cost-calculator so it never leaks into the WordPress theme. */
  #trayonomics-cost-calculator {
    --tco-forest: #12372A;
    --tco-leaf: #3FA66B;
    --tco-gold: #E5A93D;
    --tco-ink: #17201B;
    --tco-canvas: #F7F8F3;
    --tco-white: #FFFFFF;
    --tco-muted: #5F6B64;
    --tco-border: #DCE5DF;
    --tco-error: #B3261E;

    --tco-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

    box-sizing: border-box;
    font-family: var(--tco-font);
    color: var(--tco-ink);
    background: var(--tco-canvas);
    padding: 32px clamp(16px, 4vw, 40px);
    border-radius: 16px;
    line-height: 1.5;
    max-width: 100%;
    overflow: clip;
  }

  #trayonomics-cost-calculator img,
  #trayonomics-cost-calculator svg,
  #trayonomics-cost-calculator table {
    max-width: 100%;
  }

  #trayonomics-cost-calculator *,
  #trayonomics-cost-calculator *::before,
  #trayonomics-cost-calculator *::after {
    box-sizing: inherit;
  }

  #trayonomics-cost-calculator h2,
  #trayonomics-cost-calculator h3,
  #trayonomics-cost-calculator h4 {
    margin: 0;
    color: var(--tco-forest);
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  #trayonomics-cost-calculator p {
    margin: 0;
  }

  /* ---------- Intro ---------- */
  .tco-intro {
    max-width: 720px;
    margin: 0 auto 28px;
    text-align: left;
  }

  .tco-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 700;
    color: var(--tco-leaf);
    margin-bottom: 8px;
  }

  .tco-heading {
    font-size: clamp(24px, 3.4vw, 32px);
    line-height: 1.2;
    margin-bottom: 10px;
  }

  .tco-lede {
    color: var(--tco-muted);
    font-size: 16px;
    max-width: 62ch;
  }

  /* ---------- Card ---------- */
  .tco-card {
    background: var(--tco-white);
    border: 1px solid var(--tco-border);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(23, 32, 27, 0.04), 0 8px 24px rgba(23, 32, 27, 0.04);
    padding: clamp(20px, 3vw, 32px);
  }

  .tco-card-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 100%;
  }

  /* Desktop: inputs and results sit side by side. */
  @media (min-width: 900px) {
    .tco-card-inner {
      grid-template-columns: 58% 1fr;
      gap: 36px;
      align-items: start;
    }
  }

  /*
    Belt-and-suspenders (V2): explicitly re-assert the single-column
    layout below the desktop breakpoint. .tco-card-inner is already
    mobile-first (1fr by default), but some embedding contexts —
    including a standalone HTML file opened without a <meta viewport>
    tag — can otherwise cause a narrow device to render the desktop
    layout viewport and only visually shrink it. This max-width rule
    guarantees the results panel drops below the inputs and never sits
    beside them at tablet or phone widths, independent of viewport
    handling elsewhere on the page.
  */
  @media (max-width: 899.98px) {
    #trayonomics-cost-calculator .tco-card-inner {
      grid-template-columns: 1fr !important;
      position: static !important;
      top: auto !important;
    }
    #trayonomics-cost-calculator .tco-results {
      position: static !important;
    }
  }

  /* Strict single-column mobile: every field full width, stacked
     actions, no side-by-side pairing of fields or controls. */
  @media (max-width: 599.98px) {
    #trayonomics-cost-calculator {
      padding: 20px 16px;
    }
    #trayonomics-cost-calculator .tco-grid {
      grid-template-columns: 1fr !important;
    }
    #trayonomics-cost-calculator .tco-inputs-head {
      flex-direction: column;
      align-items: stretch;
    }
    #trayonomics-cost-calculator .tco-field-currency {
      min-width: 0;
      width: 100%;
    }
    #trayonomics-cost-calculator .tco-actions {
      flex-direction: column;
    }
    #trayonomics-cost-calculator .tco-actions .tco-btn {
      width: 100%;
    }
    #trayonomics-cost-calculator .tco-utility-actions {
      flex-direction: column;
      align-items: stretch;
    }
    #trayonomics-cost-calculator .tco-utility-actions .tco-btn {
      width: 100%;
    }
    #trayonomics-cost-calculator .tco-primary-value {
      font-size: clamp(28px, 9vw, 34px);
    }
  }

  .tco-section-heading {
    font-size: 18px;
  }

  /* ---------- Inputs ---------- */
  .tco-inputs-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }

  .tco-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 100%;
  }

  /* Two fields per row only once there's genuinely comfortable width for
     it (tablet and up). Below that, every field is full-width. */
  @media (min-width: 600px) {
    .tco-grid {
      grid-template-columns: 1fr 1fr;
    }
    .tco-field-wide {
      grid-column: 1 / -1;
    }
  }

  .tco-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tco-forest);
    margin-bottom: 6px;
  }

  .tco-required {
    color: var(--tco-gold);
  }

  .tco-field-currency {
    min-width: 160px;
    max-width: 100%;
  }

  .tco-field-currency select {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tco-border);
    border-radius: 10px;
    background: var(--tco-white);
    color: var(--tco-ink);
    font-family: inherit;
    font-size: 14px;
  }

  .tco-currency-note {
    font-size: 11.5px;
    color: var(--tco-muted);
    margin-top: 6px;
  }

  .tco-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--tco-border);
    border-radius: 10px;
    background: var(--tco-white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .tco-input-wrap:focus-within {
    border-color: var(--tco-leaf);
    box-shadow: 0 0 0 3px rgba(63, 166, 107, 0.18);
  }

 .tco-currency-symbol,
.tco-suffix {
  padding: 14px 12px;
  color: var(--tco-muted);
  font-size: 15px;
  user-select: none;
  display: flex;
  align-items: center;
}

.tco-input-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 14px 12px 14px 4px;
  font-family: inherit;
  font-size: 16px;
  color: var(--tco-ink);
  min-width: 0;
}

  .tco-input-wrap-plain input {
    padding-left: 12px;
  }

  .tco-input-wrap-suffix input {
    padding-right: 4px;
  }

  .tco-input-wrap input:focus {
    outline: none;
  }

  .tco-input-wrap.tco-input-error {
    border-color: var(--tco-error);
  }

  .tco-help {
    font-size: 12px;
    color: var(--tco-muted);
    margin-top: 6px;
  }

  .tco-error {
    font-size: 12px;
    color: var(--tco-error);
    margin-top: 6px;
    min-height: 0;
  }

  .tco-error:empty {
    display: none;
  }

  /* Hide native number spinners consistently is unnecessary; keep default browser affordance for accessibility. */

  .tco-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
  }

  .tco-btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    padding: 12px 22px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.05s ease, background-color 0.15s ease, border-color 0.15s ease;
    min-height: 44px;
  }

  .tco-btn:active {
    transform: translateY(1px);
  }

  .tco-btn-primary {
    background: var(--tco-forest);
    color: var(--tco-white);
  }

  .tco-btn-primary:hover {
    background: #0d2b20;
  }

  .tco-btn-secondary {
    background: var(--tco-white);
    color: var(--tco-forest);
    border-color: var(--tco-border);
  }

  .tco-btn-secondary:hover {
    border-color: var(--tco-forest);
  }

  .tco-btn-ghost {
    background: transparent;
    color: var(--tco-forest);
    border-color: var(--tco-border);
    padding: 10px 16px;
    font-size: 13px;
    min-height: 40px;
  }

  .tco-btn-ghost:hover {
    background: rgba(63, 166, 107, 0.08);
    border-color: var(--tco-leaf);
  }

  #trayonomics-cost-calculator .tco-btn:focus-visible,
  #trayonomics-cost-calculator select:focus-visible,
  #trayonomics-cost-calculator input:focus-visible {
    outline: 2px solid var(--tco-leaf);
    outline-offset: 2px;
  }

  /* ---------- Results ---------- */

  .tco-results {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .tco-primary-result {
  background: var(--tco-forest);
  color: var(--tco-white);
  border-radius: 14px;
  padding: 22px 20px;
  box-shadow: 0 8px 24px rgba(18, 55, 42, 0.25); 
}

  .tco-primary-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 6px;
  }

  .tco-primary-value {
    font-size: clamp(30px, 5vw, 40px);
    font-weight: 700;
    color: var(--tco-white);
    line-height: 1.1;
    margin-bottom: 8px;
  }

  .tco-primary-note {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.72);
    max-width: 42ch;
  }

  .tco-secondary-results {
    border: 1px solid var(--tco-border);
    border-radius: 12px;
    overflow: hidden;
  }

  .tco-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--tco-border);
    gap: 12px;
  }

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

  .tco-result-label {
    font-size: 13.5px;
    color: var(--tco-muted);
  }

  .tco-result-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--tco-forest);
    text-align: right;
  }

  .tco-result-row-supporting .tco-result-value {
    font-weight: 600;
    color: var(--tco-ink);
  }

  .tco-zero-warning {
    font-size: 13px;
    color: var(--tco-error);
    background: rgba(179, 38, 30, 0.08);
    border: 1px solid rgba(179, 38, 30, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
  }

  .tco-zero-warning[hidden] {
    display: none;
  }


  /* ---------- Breakdown ---------- */
  .tco-breakdown-heading {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .tco-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .tco-breakdown-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .tco-breakdown-row-top {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--tco-ink);
  }

  .tco-breakdown-row-top span:last-child {
    color: var(--tco-muted);
  }

  .tco-breakdown-bar-track {
    height: 8px;
    border-radius: 6px;
    background: var(--tco-canvas);
    border: 1px solid var(--tco-border);
    overflow: hidden;
  }

  .tco-breakdown-bar-fill {
    height: 100%;
    background: var(--tco-leaf);
    border-radius: 6px 0 0 6px;
    transition: width 0.2s ease;
  }

  .tco-breakdown-empty {
    font-size: 12.5px;
    color: var(--tco-muted);
  }

  .tco-breakdown-empty[hidden] {
    display: none;
  }

  /* ---------- Utility actions ---------- */
  .tco-utility-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .tco-copy-confirmation {
    font-size: 12.5px;
    color: var(--tco-leaf);
    font-weight: 600;
  }

  /* ---------- Education ---------- */
  .tco-education {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--tco-border);
    padding-top: 16px;
  }

  .tco-education-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--tco-forest);
    margin-bottom: 3px;
  }

  .tco-education-text {
    font-size: 12.5px;
    color: var(--tco-muted);
  }

  .tco-note {
    margin-top: 20px;
    font-size: 12.5px;
    color: var(--tco-muted);
    border-top: 1px solid var(--tco-border);
    padding-top: 16px;
  }

  /* ---------- Structured content ---------- */
  .tco-articles {
    max-width: 760px;
    margin: 36px auto 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .tco-article h3 {
    font-size: 17px;
    margin-bottom: 8px;
  }

  .tco-article p {
    font-size: 14.5px;
    color: var(--tco-muted);
    margin-bottom: 8px;
  }

  .tco-article p:last-child {
    margin-bottom: 0;
  }

  /* ---------- Reduced motion ---------- */
  @media (prefers-reduced-motion: reduce) {
    #trayonomics-cost-calculator * {
      transition: none !important;
    }
  }

  /* ---------- Print ---------- */
  @media print {
    #trayonomics-cost-calculator .tco-inputs,
    #trayonomics-cost-calculator .tco-utility-actions,
    #trayonomics-cost-calculator .tco-articles,
    #trayonomics-cost-calculator .tco-eyebrow {
      display: none !important;
    }
    #trayonomics-cost-calculator .tco-card-inner {
      grid-template-columns: 1fr;
    }
    #trayonomics-cost-calculator {
      background: #fff;
      box-shadow: none;
      padding: 0;
    }
  }
 /* ---------- WordPress theme grid isolation ---------- */

#trayonomics-cost-calculator .tco-card-inner > .tco-inputs {
  grid-column: 1 !important;
}

#trayonomics-cost-calculator .tco-card-inner > .tco-results {
  grid-column: 2 !important;
}

@media (max-width: 899.98px) {
  #trayonomics-cost-calculator .tco-card-inner > .tco-inputs,
  #trayonomics-cost-calculator .tco-card-inner > .tco-results {
    grid-column: auto !important;
  }
}
body.page-id-55 .wp-block-post-title {
  display: none !important;
}




/* =========================================
   NUCLEAR STICKY OVERRIDE
========================================= */
/* 1. Force the WordPress theme wrappers to allow sticky scrolling */
html, body, .wp-site-blocks {
  overflow-x: clip !important;
}

/* 2. Absolute override for the results dashboard */
@media (min-width: 900px) {
  #trayonomics-cost-calculator .tco-card-inner > .tco-results {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 32px !important;
    align-self: start !important;
    height: max-content !important;
    z-index: 10 !important;
  }
}