@font-face { font-family: 'TBFR Export Body'; src: url('fonts/montserrat-400-normal.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'TBFR Export Body'; src: url('fonts/montserrat-700-normal.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'TBFR Export Script'; src: url('fonts/dancing-script-700-normal.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
.tbfr-builder {
    --rb-bg: #fff; --rb-panel: #f6f8f6; --rb-field: #fff; --rb-text: #202b25;
    --rb-muted: #4b5c52; --rb-line: #a3b4aa; --rb-accent: #205c40; --rb-on-accent: #fff;
    color: var(--rb-text); font-size: 1rem; line-height: 1.6;
}
.tbfr-builder *, .tbfr-builder *::before, .tbfr-builder *::after { box-sizing: border-box; }
.tbfr-builder [hidden] { display: none !important; }
.tbfr-builder h2 { margin: 0 0 18px; font-size: 1.75rem; line-height: 1.2; }
.tbfr-builder h3 { font-size: 1.2rem; }
.tbfr-builder p { margin: 0 0 16px; }
.tbfr-builder-intro { max-width: 750px; font-size: 1.15rem; }
.tbfr-builder .tbfr-small { font-size: .875rem; line-height: 1.6; color: var(--rb-muted); }
.tbfr-builder label { display: block; font-size: .875rem; font-weight: 700; min-width: 0; }
.tbfr-builder input, .tbfr-builder select, .tbfr-builder textarea {
    display: block; width: 100%; min-width: 0; margin: 6px 0 0; padding: 11px 12px;
    color: var(--rb-text); background: var(--rb-field); border: 1px solid var(--rb-line);
    border-radius: 4px; font-family: inherit; font-size: 1rem; font-weight: 400; line-height: 1.4;
}
.tbfr-builder input::placeholder, .tbfr-builder textarea::placeholder { color: var(--rb-muted); opacity: 1; }
.tbfr-builder textarea { resize: vertical; min-height: 130px; }
.tbfr-builder select {
    appearance: none; padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%238b805f' stroke-width='2'/%3E%3C/svg%3E");
    background-size: 12px 8px; background-position: right 12px center; background-repeat: no-repeat;
}
.tbfr-builder button {
    border: 1px solid var(--rb-accent); border-radius: 4px; padding: 11px 16px;
    background: var(--rb-accent); color: var(--rb-on-accent); font: inherit; font-weight: 700;
    font-size: .9375rem; line-height: 1.5; cursor: pointer; min-height: 44px;
}
.tbfr-builder button.tbfr-secondary { background: transparent; color: var(--rb-accent); }
.tbfr-builder button:hover { filter: brightness(1.15); }
.tbfr-builder button:disabled { opacity: .5; cursor: default; filter: none; }
.tbfr-builder :is(input, select, textarea, button, a, summary):focus-visible { outline: 3px solid var(--rb-accent); outline-offset: 3px; }
.tbfr-builder a { color: var(--rb-accent); }
.tbfr-style-section { margin: 34px 0; }
.tbfr-style-carousel { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; margin-bottom: 14px; }
.tbfr-builder .tbfr-style-arrow { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 1.5rem; line-height: 1; }
.tbfr-style-options { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 24px) / 3); gap: 12px; min-width: 0; padding: 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 6px; scrollbar-width: none; }
.tbfr-style-options::-webkit-scrollbar { display: none; }
.tbfr-style-options button { min-width: 0; scroll-snap-align: start; text-align: left; background: var(--rb-panel); border-color: var(--rb-line); color: var(--rb-text); padding: 18px 14px; }
.tbfr-style-options button[aria-pressed="true"] { border: 2px solid var(--rb-accent); padding: 17px 13px; box-shadow: inset 0 3px var(--rb-accent); }
.tbfr-style-options strong { display: block; font-size: 1.1rem; margin-bottom: 4px; color: var(--rb-accent); }
.tbfr-style-options span { display: block; font-size: .875rem; font-weight: 400; }
.tbfr-workbench { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 24px; }
.tbfr-editor, .tbfr-insights { min-width: 0; }
.tbfr-panel { padding: 24px; border: 1px solid var(--rb-line); border-radius: 6px; background: var(--rb-panel); margin-bottom: 24px; }
.tbfr-section-top { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.tbfr-section-top > label { flex: 0 0 145px; }
.tbfr-section-top h2 { margin-top: 5px; }
.tbfr-ingredient-row { padding: 18px 0; border-top: 1px solid var(--rb-line); }
.tbfr-row-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.tbfr-builder .tbfr-remove { font-size: .875rem; padding: 10px; }
.tbfr-row-measures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; margin-top: 14px; }
.tbfr-custom-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.tbfr-row-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.tbfr-row-foot p { margin: 0; }
.tbfr-builder-shop { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; padding: 7px; flex-shrink: 0; }
.tbfr-builder-shop img { width: 20px; height: 20px; }
.tbfr-button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tbfr-shop-disclosure { margin-top: 14px !important; }
.tbfr-inline-estimate { margin-top: 18px !important; font-size: .9375rem; }
.tbfr-strength { scroll-margin-top: 85px; }
.tbfr-editor > .tbfr-panel > label { margin-bottom: 18px; }
.tbfr-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 12px; margin: 20px 0 28px; }
.tbfr-stats strong, .tbfr-stats span { display: block; }
.tbfr-stats strong { font-size: 1.2rem; line-height: 1.3; overflow-wrap: anywhere; }
.tbfr-stats span { font-size: .875rem; color: var(--rb-muted); margin-top: 6px; }
.tbfr-primary-stat { grid-column: 1 / -1; }
.tbfr-primary-stat strong { font-size: 3rem; color: var(--rb-accent); }
.tbfr-water-fields { display: grid; grid-template-columns: minmax(0, 1fr) 95px; align-items: end; gap: 12px; margin-bottom: 12px; }
.tbfr-builder ul { padding-left: 1.3rem; margin: 0 0 16px; }
.tbfr-builder li { margin-bottom: 12px; }
.tbfr-errors { padding: 16px 16px 4px 32px !important; border: 1px solid var(--rb-accent); border-radius: 4px; font-size: .875rem; }
.tbfr-builder summary { font-weight: 700; cursor: pointer; }
.tbfr-method[open] summary { margin-bottom: 20px; }
.tbfr-method p, .tbfr-method li { font-size: .875rem; }
.tbfr-preview { border-top: 4px solid var(--rb-accent); padding: 32px; overflow-wrap: anywhere; }
.tbfr-preview h2 { font-size: 2.5rem; }
.tbfr-recipe-brand { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--rb-line); }
.tbfr-recipe-brand > div:last-child { text-align: right; }
.tbfr-builder .tbfr-recipe-brand p { font-weight: 700; margin-bottom: 4px; }
.tbfr-recipe-brand a { font-size: .875rem; }
.tbfr-recipe-logo { display: block; width: 160px; max-width: 100%; height: auto; padding: 8px; border-radius: 3px; }
.tbfr-recipe-credit { border-top: 1px solid var(--rb-line); margin-top: 24px; padding-top: 18px; font-size: .875rem; }
.tbfr-builder .tbfr-recipe-credit p { margin-bottom: 4px; font-weight: 700; }
.tbfr-eyebrow { color: var(--rb-accent); font-size: .875rem; letter-spacing: .1em; font-weight: 700; }
.tbfr-preparation { white-space: pre-wrap; }
.tbfr-keep { margin-bottom: 32px; }
.tbfr-keep .tbfr-small { margin-top: 14px; }
.tbfr-message { font-weight: 700; color: var(--rb-accent); overflow-wrap: anywhere; }
.tbfr-library > label { margin-bottom: 18px; max-width: 600px; }
.tbfr-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 950px) {
    .tbfr-style-options { grid-auto-columns: calc((100% - 12px) / 2); }
    .tbfr-workbench { grid-template-columns: 1fr; }
    .tbfr-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
    .tbfr-insights .tbfr-panel { margin-bottom: 0; }
    .tbfr-method { grid-column: 1 / -1; }
    .tbfr-preview { margin-top: 24px; }
}
@media (max-width: 600px) {
    .tbfr-recipe-brand { flex-direction: column; align-items: flex-start; gap: 12px; }
    .tbfr-recipe-brand > div:last-child { text-align: left; }
    .tbfr-style-options { grid-auto-columns: 100%; }
    .tbfr-panel { padding: 18px; }
    .tbfr-insights { display: block; }
    .tbfr-insights .tbfr-panel { margin-bottom: 24px; }
    .tbfr-section-top { display: block; }
    .tbfr-section-top > label { max-width: 160px; }
    .tbfr-custom-fields { grid-template-columns: 1fr; }
    .tbfr-row-measures { gap: 8px; }
    .tbfr-row-measures input, .tbfr-row-measures select { padding-left: 8px; padding-right: 8px; }
    .tbfr-row-measures select { padding-right: 24px; background-position: right 7px center; }
    .tbfr-preview { padding: 22px; }
}
@media print {
    @page { size: auto; margin: 16mm; }
    body:has(.tbfr-builder) { background: #fff !important; color: #000 !important; }
    body:has(.tbfr-builder) .wp-site-blocks > header, body:has(.tbfr-builder) .wp-site-blocks > footer,
    body:has(.tbfr-builder) .bad-menu, body:has(.tbfr-builder) #wpadminbar,
    body:has(.tbfr-builder) .wp-block-post-title,
    .tbfr-builder-intro, .tbfr-style-section, .tbfr-workbench, .tbfr-keep, .tbfr-library { display: none !important; }
    body:has(.tbfr-builder) main { padding: 0; max-width: none; }
    .tbfr-builder { font-size: 11pt; }
    .tbfr-builder .tbfr-preview { display: block; border: 0; background: #fff; padding: 0; margin: 0; }
    .tbfr-preview, .tbfr-preview * { color: #24211c !important; text-shadow: none !important; box-shadow: none !important; }
    .tbfr-preview { font-family: 'TBFR Export Body', sans-serif; line-height: 1.5; }
    .tbfr-builder .tbfr-preview h2 { font-size: 30pt; line-height: 1.2; }
    .tbfr-builder .tbfr-preview h3 { font-size: 16pt; margin: 16pt 0 7pt; font-family: 'TBFR Export Body', sans-serif; }
    .tbfr-script-headings .tbfr-preview :is(h2,h3) { font-family: 'TBFR Export Script', cursive; font-weight: 700; }
    .tbfr-builder .tbfr-preview :is(h2,h3), .tbfr-preview .tbfr-eyebrow { color: #896526 !important; }
    .tbfr-preview :is(h2,h3), .tbfr-recipe-brand, .tbfr-eyebrow { break-after: avoid; }
    .tbfr-preview p { orphans: 3; widows: 3; }
    .tbfr-preview li, .tbfr-recipe-credit { break-inside: avoid; }
    .tbfr-preview .tbfr-small { font-size: 8.5pt; line-height: 1.5; }
    .tbfr-recipe-brand { flex-direction: row; align-items: center; border-color: #896526; }
    .tbfr-recipe-brand > div:last-child { text-align: right; }
    .tbfr-recipe-logo { width: 140px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .tbfr-recipe-credit { border-color: #d6c7a9; font-size: 9pt; }
}
