/* Cut and fill calculator (/cut-and-fill-calculator). Uses the site tokens from styles.css. */
.cfc [hidden] { display: none !important; } /* the grid/flex rules below would otherwise beat the hidden attribute */
.cfc-section { padding-top: 40px; }
.cfc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.cfc-inputs, .cfc-out { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px; }
.cfc-out { position: sticky; top: 96px; }
.cfc-h { font-family: var(--font-display); color: var(--navy); font-size: 1.15rem; margin: 0 0 16px; }
.cfc-help { font-size: .92rem; color: var(--muted); margin: 0 0 18px; }
.cfc-help a, .cfc-next a:not(.btn) { text-decoration: underline; text-underline-offset: 3px; }

.cfc-tabs { display: flex; gap: 6px; padding: 5px; margin-bottom: 22px; background: var(--bg-soft2); border-radius: 12px; }
.cfc-tabs [role="tab"] { flex: 1; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--navy); font-weight: 600; font-size: .9rem; cursor: pointer; }
.cfc-tabs [role="tab"][aria-selected="true"] { background: #fff; box-shadow: 0 2px 8px -4px rgb(23 48 84 / 35%); }
.cfc-tabs [role="tab"]:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.cfc .field { margin-bottom: 16px; }
.cfc .field input, .cfc .field select { min-height: 44px; padding: 10px 12px; }
.cfc textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; line-height: 1.6; min-height: 0 !important; white-space: pre; overflow-x: auto; }
.cfc-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cfc-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.cfc-row2 .field label, .cfc-row3 .field label { font-size: .84rem; }
.cfc-design { border: 0; margin: 4px 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.cfc-design legend { color: var(--navy); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.cfc-design label { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--navy); cursor: pointer; }
.cfc-small { min-height: 40px; padding: 8px 14px; font-size: .85rem; }
.cfc-err { color: #a3261a; font-size: .86rem; margin-top: 6px; }
.cfc-factors { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.cfc-rates { margin-top: 6px; }
.cfc-rates summary { cursor: pointer; color: var(--navy); font-weight: 600; font-size: .92rem; padding: 6px 0; }
.cfc-rates[open] summary { margin-bottom: 12px; }

.cfc-sec { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.cfc-sec th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 6px 6px 0; }
.cfc-sec td { padding: 0 6px 8px 0; }
.cfc-sec input { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 7px; color: var(--navy); font-size: .95rem; }
.cfc-x { width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--navy); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.cfc-x:hover { border-color: var(--navy); }

.cfc-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.cfc-table th { text-align: left; font-weight: 500; color: var(--text); padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); }
.cfc-table td { text-align: right; font-variant-numeric: tabular-nums; color: var(--navy); font-weight: 600; padding: 9px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cfc-table tr.cfc-key th { color: var(--navy); font-weight: 700; }
.cfc-table tr.cfc-key td { font-family: var(--font-display); font-size: 1.12rem; }
.cfc-link { border: 0; background: none; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .85rem; font-weight: 600; margin-left: 6px; }

.cfc-heat-title { font-size: .84rem; color: var(--muted); margin: 18px 0 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cfc-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.cfc-swatch.is-cut { background: #e0a400; }
.cfc-swatch.is-fill { background: #2d6cb5; }
.cfc-heat { display: grid; gap: 3px; }
.cfc-cell { --t: .5; display: grid; place-items: center; min-height: 34px; border-radius: 4px; font-size: .74rem; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }
.cfc-cell.is-cut { background: rgb(224 164 0 / calc(.15 + var(--t) * .7)); }
.cfc-cell.is-fill { background: rgb(45 108 181 / calc(.15 + var(--t) * .7)); }
.cfc-cell.is-fill[style*="--t: 0.8"], .cfc-cell.is-fill[style*="--t: 0.9"], .cfc-cell.is-fill[style*="--t: 1"] { color: #fff; }

.cfc-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.cfc-copied { font-size: .85rem; color: var(--muted); }
.cfc-note { font-size: .82rem; color: var(--muted); margin-top: 16px; }
.cfc-next { margin-top: 18px; padding: 18px; border-radius: 12px; background: var(--bg-soft); }
.cfc-next p { font-size: .92rem; margin: 0 0 14px; }

@media (max-width: 960px) {
  .cfc { grid-template-columns: 1fr; }
  .cfc-out { position: static; }
}
@media (max-width: 560px) {
  .cfc-inputs, .cfc-out { padding: 18px; }
  .cfc-row3 { grid-template-columns: 1fr 1fr; }
  .cfc-row2 { grid-template-columns: 1fr; }
  .cfc-tabs [role="tab"] { font-size: .82rem; padding: 8px 4px; }
}
