/*
 * Hofmann Family Cookbook - front-end styles
 * Colour variables (--hfc-bg, --hfc-paper, --hfc-terracotta, --hfc-leather, --hfc-gold, ...)
 * are injected from the Settings page as inline CSS on the :root selector.
 */
.hfc-app, .hfc-app *, .hfc-app *::before, .hfc-app *::after { box-sizing: border-box; }
.hfc-app { color: var(--hfc-ink); font-family: var(--hfc-sans); -webkit-font-smoothing: antialiased; line-height: 1.5; }
.hfc-app h1, .hfc-app h2, .hfc-app h3 { color: inherit; }
.hfc-app [hidden] { display: none !important; }

body.hfc-canvas-body {
    margin: 0; padding: 0; background: var(--hfc-bg); color: var(--hfc-ink);
    font-family: var(--hfc-sans); -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(rgba(26, 31, 28, 0.045) 1px, transparent 0);
    background-size: 26px 26px;
}

/* Top Glass Navigation */
.hfc-navbar {
    position: sticky; top: 0; z-index: 900;
    background: var(--hfc-bg-glass); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hfc-border);
    padding: 14px 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.hfc-brand { display: flex; align-items: center; gap: 12px; text-decoration: none !important; color: var(--hfc-ink) !important; }
.hfc-brand-crest {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, var(--hfc-leather) 0%, var(--hfc-leather-deep) 100%);
    color: var(--hfc-gold); border: 1.5px solid var(--hfc-gold);
    display: flex; align-items: center; justify-content: center; font-family: var(--hfc-serif);
    font-size: 1.5rem; font-weight: 700;
}
.hfc-brand-name { font-family: var(--hfc-serif); font-size: 1.55rem; font-weight: 700; line-height: 1; }
.hfc-nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.hfc-btn {
    background: var(--hfc-terracotta); color: #fff !important; border: none;
    padding: 11px 22px; border-radius: var(--hfc-btn-radius, 999px); font-weight: 600; font-size: 0.9rem;
    cursor: pointer; text-decoration: none !important; display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.22s ease; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}
.hfc-btn:hover { background: var(--hfc-terracotta-dark); transform: translateY(-2px); }
.hfc-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.hfc-btn-ghost {
    background: var(--hfc-paper); color: var(--hfc-ink) !important; border: 1px solid var(--hfc-border);
    box-shadow: none;
}
.hfc-btn-ghost:hover { background: #EDE5D7; }
.hfc-btn-olive {
    background: var(--hfc-leather); color: #fff !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.hfc-btn-olive:hover { background: var(--hfc-leather-deep); }

/* Bespoke Editorial Hero + 3D Hardcover Heirloom Book */
.hfc-hero {
    max-width: 1280px; margin: 0 auto; padding: 54px 36px 46px;
    display: grid; grid-template-columns: 1.25fr 0.85fr; gap: 48px; align-items: center;
}
@media (max-width: 960px) {
    .hfc-hero { grid-template-columns: 1fr; text-align: center; padding: 36px 20px; }
    .hfc-navbar { padding: 12px 18px; }
}
.hfc-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.16em;
    font-size: 0.74rem; font-weight: 700; color: var(--hfc-terracotta);
    margin-bottom: 16px; padding: 6px 14px; background: rgba(0,0,0,0.05); border-radius: 999px;
}
.hfc-hero h1 {
    font-family: var(--hfc-serif); font-size: clamp(2.8rem, 5vw, 4.5rem);
    font-weight: 700; margin: 0 0 16px; line-height: 1.04; color: var(--hfc-ink);
}
.hfc-hero p.lead {
    font-size: 1.15rem; color: var(--hfc-muted); margin: 0 0 30px; line-height: 1.65; max-width: 580px;
}
@media (max-width: 960px) { .hfc-hero p.lead { margin-left: auto; margin-right: auto; } }

/* 3D Hardcover Book Showcase */
.hfc-book-stage { perspective: 1400px; display: flex; justify-content: center; align-items: center; padding: 10px; }
.hfc-hardcover {
    width: 310px; height: 410px; position: relative; border-radius: 6px 18px 18px 6px;
    background: linear-gradient(145deg, var(--hfc-leather) 0%, var(--hfc-leather-deep) 100%);
    box-shadow: -14px 22px 42px rgba(20, 26, 22, 0.36), inset 4px 0 10px rgba(255,255,255,0.12);
    transform: rotateY(-16deg) rotateX(4deg);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    padding: 26px; display: flex; flex-direction: column; justify-content: space-between;
    border-left: 14px solid var(--hfc-leather-deep); cursor: pointer;
}
.hfc-hardcover:hover { transform: rotateY(-4deg) rotateX(0deg) translateY(-6px); }
.hfc-hardcover::after {
    content: ""; position: absolute; top: 8px; bottom: 8px; right: -8px; width: 8px;
    background: repeating-linear-gradient(to right, #F6F1E7, #F6F1E7 2px, #DFD5C3 2px, #DFD5C3 4px);
    border-radius: 0 4px 4px 0;
}
.hfc-book-frame {
    border: 1.5px solid var(--hfc-gold); border-radius: 10px; height: 100%;
    padding: 24px 18px; display: flex; flex-direction: column; justify-content: space-between; text-align: center;
}
.hfc-book-monogram {
    width: 58px; height: 58px; margin: 0 auto; border-radius: 50%;
    border: 1.5px solid var(--hfc-gold); color: var(--hfc-gold);
    font-family: var(--hfc-serif); font-size: 2rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.hfc-book-cover-title {
    font-family: var(--hfc-serif); color: #F9F4E8; font-size: 1.95rem; font-weight: 700;
    line-height: 1.15; margin: 12px 0; letter-spacing: 0.01em;
}
.hfc-book-cover-sub {
    color: var(--hfc-gold); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em;
}

/* Command Search & Chef Filter Bar */
.hfc-search-dock {
    background: var(--hfc-paper); border: 1px solid var(--hfc-border);
    border-radius: 20px; padding: 10px; box-shadow: var(--hfc-shadow);
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.hfc-search-input-wrap { flex: 1; min-width: 220px; display: flex; align-items: center; padding-left: 14px; gap: 10px; }
.hfc-search-input-wrap input {
    width: 100%; border: none; outline: none; font-size: 1rem; background: transparent;
    color: var(--hfc-ink); font-family: inherit; padding: 10px 0;
}
.hfc-chef-select {
    border: 1px solid var(--hfc-border); background: var(--hfc-bg); color: var(--hfc-ink);
    padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 0.9rem; cursor: pointer; outline: none;
}

/* Main Cookbook Shelving & Chapter Navigation */
.hfc-container { max-width: 1280px; margin: 0 auto; padding: 12px 36px 90px; }
@media (max-width: 768px) { .hfc-container { padding: 12px 18px 70px; } }

.hfc-chapter-strip {
    display: flex; gap: 10px; overflow-x: auto; padding: 8px 0 16px; margin-bottom: 24px;
    scrollbar-width: none;
}
.hfc-chapter-strip::-webkit-scrollbar { display: none; }
.hfc-chapter-pill {
    flex-shrink: 0; padding: 12px 20px; border-radius: 14px;
    background: var(--hfc-paper); border: 1px solid var(--hfc-border);
    font-weight: 600; font-size: 0.92rem; color: var(--hfc-ink); cursor: pointer;
    transition: all 0.2s ease; display: flex; align-items: center; gap: 8px;
}
.hfc-chapter-pill span.count {
    font-size: 0.76rem; background: var(--hfc-bg); padding: 2px 8px; border-radius: 999px; color: var(--hfc-muted);
}
.hfc-chapter-pill:hover { border-color: var(--hfc-terracotta); transform: translateY(-1px); }
.hfc-chapter-pill.active {
    background: var(--hfc-leather); color: #fff; border-color: var(--hfc-leather);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
.hfc-chapter-pill.active span.count { background: rgba(255, 255, 255, 0.18); color: var(--hfc-gold); }

.hfc-chapter-banner {
    display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px;
    margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--hfc-border);
}
.hfc-chapter-banner h2 { font-family: var(--hfc-serif); font-size: 2.35rem; margin: 0; line-height: 1.1; }
.hfc-chapter-banner p { margin: 4px 0 0; color: var(--hfc-muted); font-size: 0.98rem; }

/* Recipe Cards Grid */
.hfc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.hfc-card {
    background: var(--hfc-paper); border: 1px solid var(--hfc-border); border-radius: 20px;
    overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
}
.hfc-card:hover { transform: translateY(-7px); box-shadow: var(--hfc-shadow); }
.hfc-card-media { height: 215px; position: relative; background: #EAE2D3; overflow: hidden; }
.hfc-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease; }
.hfc-card:hover .hfc-card-media img { transform: scale(1.05); }
.hfc-card-placeholder {
    width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 26px; text-align: center;
    background: radial-gradient(circle at top left, var(--hfc-bg) 0%, #E3D7C3 100%);
    font-family: var(--hfc-serif); font-style: italic; color: #5B5347; font-size: 1.32rem;
}
.hfc-card-tag {
    position: absolute; top: 14px; left: 14px; background: var(--hfc-paper);
    padding: 5px 12px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--hfc-terracotta); box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.hfc-card-content { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.hfc-card-title { font-family: var(--hfc-serif); font-size: 1.6rem; font-weight: 700; margin: 0 0 8px; line-height: 1.2; }
.hfc-card-excerpt { font-size: 0.92rem; color: var(--hfc-muted); margin: 0 0 18px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hfc-card-footer {
    margin-top: auto; padding-top: 14px; border-top: 1px solid var(--hfc-border);
    display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem;
}
.hfc-chef-badge { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--hfc-ink); }
.hfc-chef-avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--hfc-leather); color: var(--hfc-gold);
    display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700;
}

/* Interactive Open-Book Reader Modal */
.hfc-modal-backdrop {
    position: fixed; inset: 0; background: rgba(18, 22, 19, 0.72); backdrop-filter: blur(8px);
    z-index: 9999; display: none; align-items: center; justify-content: center; padding: 20px;
}
.hfc-modal-backdrop.open { display: flex; animation: hfcFadeIn 0.22s ease; }
@keyframes hfcFadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.hfc-book-modal {
    background: var(--hfc-paper); width: 100%; max-width: 1040px; max-height: 92vh;
    border-radius: 24px; overflow-y: auto; box-shadow: 0 32px 80px rgba(0,0,0,0.42);
    border: 1px solid var(--hfc-border); position: relative;
}
.hfc-modal-bar {
    position: sticky; top: 0; z-index: 10; background: var(--hfc-paper);
    padding: 14px 28px; border-bottom: 1px solid var(--hfc-border);
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.hfc-book-body { padding: 38px 44px; }
@media (max-width: 768px) { .hfc-book-body { padding: 24px 20px; } }
.hfc-book-cols { display: grid; grid-template-columns: 1fr 1.65fr; gap: 40px; margin-top: 28px; }
@media (max-width: 820px) { .hfc-book-cols { grid-template-columns: 1fr; } }
.hfc-ing-panel {
    background: var(--hfc-bg); padding: 26px; border-radius: 18px; border: 1px solid var(--hfc-border);
    align-self: start;
}
.hfc-ing-panel h3, .hfc-steps-panel h3 {
    font-family: var(--hfc-serif); font-size: 1.7rem; margin: 0 0 16px;
    padding-bottom: 10px; border-bottom: 1px solid var(--hfc-border);
}
.hfc-ing-item {
    display: flex; align-items: flex-start; gap: 12px; padding: 10px 0;
    border-bottom: 1px dashed #DFD6C7; cursor: pointer; font-size: 0.98rem;
}
.hfc-ing-item.done { text-decoration: line-through; opacity: 0.45; }
.hfc-step-row { display: flex; gap: 16px; margin-bottom: 22px; }
.hfc-step-circle {
    width: 32px; height: 32px; border-radius: 50%; background: var(--hfc-terracotta); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}

/* Native Radio-Backed Family Chef Chip Picker */
.hfc-form-wrap { max-width: 920px; margin: 36px auto; background: var(--hfc-paper); padding: 38px; border-radius: 22px; border: 1px solid var(--hfc-border); box-shadow: var(--hfc-shadow); }
.hfc-chef-picker-box {
    background: var(--hfc-bg);
    border: 1px solid var(--hfc-border); border-radius: 18px; padding: 22px 24px; margin-bottom: 28px;
}
.hfc-chef-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hfc-chef-option { display: inline-block; cursor: pointer; margin: 0; }
.hfc-chef-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.hfc-chef-pill-ui {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: 999px; border: 1.5px solid #CFC3AE;
    background: #fff; color: var(--hfc-ink); font-weight: 600; font-size: 0.92rem;
    transition: all 0.15s ease; user-select: none;
}
.hfc-chef-option:hover .hfc-chef-pill-ui { border-color: var(--hfc-terracotta); transform: translateY(-1px); }
.hfc-chef-option input[type="radio"]:checked + .hfc-chef-pill-ui {
    background: var(--hfc-leather); color: var(--hfc-gold); border-color: var(--hfc-leather);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}
.hfc-custom-chef-row {
    display: flex; flex-wrap: wrap; margin-top: 14px; gap: 10px; align-items: center;
    padding-top: 14px; border-top: 1px dashed #D5CBB8;
}

/* Native Visible File Input Pill */
.hfc-file-upload-pill {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--hfc-leather); color: #fff;
    padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: 0.88rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.hfc-file-upload-pill input[type="file"] {
    color: #fff; font-size: 0.85rem; max-width: 250px; cursor: pointer;
}
.hfc-file-upload-pill input[type="file"]::file-selector-button {
    background: var(--hfc-gold); color: var(--hfc-leather-deep); border: none;
    padding: 6px 12px; border-radius: 999px; font-weight: 700; cursor: pointer; margin-right: 8px;
}

.hfc-magic-panel { background: var(--hfc-bg); border: 2px dashed #CFC3AE; border-radius: 16px; padding: 24px; margin-bottom: 28px; }
.hfc-field { margin-bottom: 20px; }
.hfc-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.hfc-field input, .hfc-field select, .hfc-field textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--hfc-border); border-radius: 12px;
    font-family: inherit; font-size: 1rem; background: #fff;
}

.hfc-batch-item {
    background: #fff; border: 1px solid var(--hfc-border); border-radius: 16px;
    padding: 20px; margin-bottom: 18px; box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}
.hfc-batch-item-head {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--hfc-border);
}

@media print {
    body * { visibility: hidden; }
    .hfc-book-modal, .hfc-book-modal * { visibility: visible; }
    .hfc-book-modal { position: absolute; left: 0; top: 0; width: 100%; max-height: none; box-shadow: none; border: none; }
    .hfc-modal-bar { display: none !important; }
}

/* ==========================================================================
   v5 additions
   ========================================================================== */

/* Utilities */
.hfc-sr-only {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.hfc-center { text-align: center; }
.hfc-muted { color: var(--hfc-muted); }
.hfc-hint { font-size: 0.85rem; color: var(--hfc-muted); margin: 2px 0 0; }
.hfc-heading { font-family: var(--hfc-serif); font-size: 1.7rem; font-weight: 700; margin: 0 0 8px; line-height: 1.15; }
.hfc-heading-xl { font-size: 2.5rem; }
.hfc-loading { text-align: center; padding: 60px 20px; font-family: var(--hfc-serif); font-size: 1.6rem; }

/* Keyboard focus */
.hfc-app a:focus-visible, .hfc-app button:focus-visible, .hfc-app input:focus-visible,
.hfc-app select:focus-visible, .hfc-app textarea:focus-visible, .hfc-app summary:focus-visible {
	outline: 3px solid var(--hfc-gold); outline-offset: 2px;
}
.hfc-chef-option input:focus-visible + .hfc-chef-pill-ui { outline: 3px solid var(--hfc-gold); outline-offset: 2px; }
.hfc-chef-option { position: relative; }

/* Buttons */
.hfc-btn-lg { font-size: 1.05rem; padding: 14px 28px; }
.hfc-btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.hfc-btn-block { width: 100%; justify-content: center; padding: 15px; font-size: 1.05rem; }
.hfc-btn-active { background: var(--hfc-ink) !important; color: #fff !important; }
a.hfc-hardcover { text-decoration: none; color: inherit; }

/* Brand marks */
.hfc-brand-logo { height: 40px; width: auto; max-width: 140px; object-fit: contain; border-radius: 6px; }
.hfc-cover-logo { max-width: 96px; max-height: 76px; object-fit: contain; margin: 0 auto; display: block; }

/* Grid states */
.hfc-grid { transition: opacity 0.15s ease; }
.hfc-grid.is-loading { opacity: 0.5; }
.hfc-empty {
	grid-column: 1 / -1; text-align: center; padding: 60px 20px; background: var(--hfc-paper);
	border-radius: 18px; border: 1px dashed var(--hfc-border);
}
.hfc-more-wrap { margin-top: 32px; }
.hfc-card-title { margin: 0 0 8px; }
.hfc-card-title a { color: inherit !important; text-decoration: none !important; }
.hfc-card:focus-within { box-shadow: var(--hfc-shadow); }
.hfc-modal-tools { display: flex; gap: 10px; flex-wrap: wrap; }

/* Recipe page (modal + single) */
.hfc-recipe-head { margin-bottom: 24px; }
.hfc-kicker { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; font-weight: 700; color: var(--hfc-terracotta); }
.hfc-recipe-title { font-family: var(--hfc-serif); font-size: clamp(2.1rem, 4vw, 3.2rem); margin: 6px 0 12px; line-height: 1.12; }
.hfc-meta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--hfc-muted); font-size: 0.95rem; }
.hfc-chef-chip { background: #EFE8DC; color: var(--hfc-ink); padding: 5px 14px; border-radius: 999px; font-weight: 600; }
.hfc-recipe-photo { width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px; margin-bottom: 26px; }
.hfc-story {
	margin: 0 0 28px; padding: 18px 22px; background: var(--hfc-bg); border-left: 4px solid var(--hfc-terracotta);
	border-radius: 10px; font-family: var(--hfc-serif); font-style: italic; font-size: 1.22rem; color: #333A35;
}
.hfc-ing-panel .hfc-hint { margin: -8px 0 12px; }
.hfc-ing-item input { margin-top: 4px; }
.hfc-steps { list-style: none; margin: 0; padding: 0; }
.hfc-step-text { line-height: 1.7; font-size: 1.05rem; }
.hfc-single { max-width: 960px; padding-top: 32px; }
.hfc-sheet { background: var(--hfc-paper); padding: 38px; border-radius: 22px; border: 1px solid var(--hfc-border); box-shadow: var(--hfc-shadow); }
.hfc-sheet-tools { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 18px; }
@media (max-width: 768px) { .hfc-sheet { padding: 22px 18px; } }

/* Notices */
.hfc-notice { padding: 14px 18px; margin: 0 0 22px; border-radius: 14px; border: 1.5px solid; font-weight: 600; font-size: 0.95rem; color: #1A1F1C; }
.hfc-notice-error { border-color: #c0392b; background: #fdf2f2; }
.hfc-notice-warn { border-color: #b7791f; background: #fff8e8; }
.hfc-notice-ok { border-color: var(--hfc-leather); background: #eef5f0; }
.hfc-notice .hfc-btn { margin-left: 8px; }

/* Add / import page */
.hfc-form-head { margin-bottom: 24px; }
.hfc-chef-picker-box { margin-left: 0; margin-right: 0; min-width: 0; }
.hfc-legend { font-weight: 700; font-size: 1rem; padding: 0; }
.hfc-custom-chef-row input {
	flex: 1; min-width: 200px; padding: 10px 14px; border-radius: 12px; border: 1px solid #C8BBA6;
	font-size: 0.95rem; background: #fff;
}
.hfc-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.hfc-import-controls { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; align-items: center; }
.hfc-voice-indicator { font-size: 0.88rem; font-weight: 600; color: var(--hfc-terracotta); }
#hfc-raw-input { width: 100%; padding: 12px; border: 1px solid var(--hfc-border); border-radius: 12px; font-family: inherit; background: #fff; }
.hfc-actions-row { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.hfc-progress { margin-top: 16px; }
.hfc-progress-bar { height: 10px; border-radius: 999px; background: var(--hfc-border); overflow: hidden; }
.hfc-progress-bar span { display: block; height: 100%; width: 2%; background: var(--hfc-terracotta); border-radius: 999px; transition: width 0.4s ease; }
#hfc-import-alert { margin-top: 16px; margin-bottom: 0; }

/* Review screen */
.hfc-review { margin-top: 24px; border-top: 2px solid var(--hfc-border); padding-top: 24px; }
.hfc-review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hfc-review-head .hfc-heading { font-size: 1.95rem; margin: 0; }
.hfc-review-foot { justify-content: flex-end; }
.hfc-batch-item.is-excluded { opacity: 0.55; }
.hfc-batch-item.is-published { border-color: var(--hfc-leather); }
.hfc-include { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--hfc-terracotta); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; }
.hfc-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.hfc-badge { font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.hfc-badge-warn { background: #fff1d6; color: #7a4b00; }
.hfc-badge-ok { background: #e3f1e6; color: #1d5a2b; }
.hfc-review-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
.hfc-review-grid-wide { grid-template-columns: 1fr 1.4fr; }
.hfc-review-grid-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .hfc-review-grid, .hfc-review-grid-wide, .hfc-review-grid-even { grid-template-columns: 1fr; } }
.hfc-review-field { margin-bottom: 12px; }
.hfc-review-field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 4px; }
.hfc-review-field input[type="text"], .hfc-review-field select, .hfc-review-field textarea {
	width: 100%; padding: 10px; border: 1px solid var(--hfc-border); border-radius: 10px; font-family: inherit; font-size: 0.95rem; background: #fff;
}
.hfc-result-list { list-style: none; margin: 16px 0; padding: 0; line-height: 1.9; }

@media (prefers-reduced-motion: reduce) {
	.hfc-app *, .hfc-app *::before, .hfc-app *::after { animation: none !important; transition: none !important; }
	.hfc-card:hover, .hfc-hardcover:hover { transform: none; }
}

/* Print: works for both the reader modal and the single recipe page */
@media print {
	.hfc-sheet, .hfc-sheet * { visibility: visible; }
	.hfc-sheet { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: none; padding: 0; }
	.hfc-sheet-tools, .hfc-hint { display: none !important; }
	body.hfc-canvas-body { background: #fff; }
}

/* ==========================================================================
   Navbar (responsive rules, logo sizes and colours come from Settings via inline CSS)
   ========================================================================== */
.hfc-brand { min-width: 0; }
.hfc-brand-crest, .hfc-brand-logo { flex: 0 0 auto; }   /* never squash the logo into an oval */
.hfc-brand-crest { aspect-ratio: 1 / 1; }
.hfc-brand-logo { width: auto; object-fit: contain; }
.hfc-name-short, .hfc-label-short { display: none; }

.hfc-nav-menu { display: flex; align-items: center; }
.hfc-nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.hfc-nav-actions .hfc-btn { white-space: nowrap; justify-content: center; }
.hfc-nav-link {
	color: var(--hfc-ink) !important; font-weight: 600; font-size: 0.92rem; text-decoration: none !important;
	padding: 9px 14px; border-radius: var(--hfc-btn-radius, 999px); display: inline-flex; align-items: center; white-space: nowrap;
}
.hfc-nav-link:hover { background: rgba(0, 0, 0, 0.06); }

/* Hamburger (shown only below the breakpoint set in Settings) */
.hfc-nav-toggle {
	display: none; align-items: center; justify-content: center; flex: 0 0 auto;
	width: 44px; height: 44px; padding: 0; cursor: pointer;
	background: transparent; border: 1.5px solid var(--hfc-border); border-radius: 12px;
}
.hfc-burger { position: relative; display: block; width: 20px; height: 14px; }
.hfc-burger i {
	position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: var(--hfc-ink);
	transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}
.hfc-burger i:nth-child(1) { top: 0; }
.hfc-burger i:nth-child(2) { top: 6px; }
.hfc-burger i:nth-child(3) { top: 12px; }
.hfc-nav-toggle[aria-expanded="true"] .hfc-burger i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.hfc-nav-toggle[aria-expanded="true"] .hfc-burger i:nth-child(2) { opacity: 0; }
.hfc-nav-toggle[aria-expanded="true"] .hfc-burger i:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* ==========================================================================
   v5.4 - File / Camera / Photo Upload Picker & Mobile Polish
   ========================================================================== */
.hfc-upload-group { margin: 16px 0; }
.hfc-upload-picker {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}
.hfc-upload-tile {
	appearance: none;
	-webkit-appearance: none;
	background: var(--hfc-paper);
	border: 1.5px solid var(--hfc-border);
	border-radius: 16px;
	padding: 16px 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 5px;
	cursor: pointer;
	color: var(--hfc-ink);
	font-family: inherit;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
	min-height: 96px;
}
.hfc-upload-tile:hover {
	border-color: var(--hfc-terracotta);
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.07);
}
.hfc-upload-tile.is-selected {
	background: var(--hfc-leather);
	border-color: var(--hfc-leather);
	color: #fff;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}
.hfc-upload-icon {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--hfc-bg);
	color: var(--hfc-terracotta);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 2px;
	transition: background 0.18s ease, color 0.18s ease;
}
.hfc-upload-tile.is-selected .hfc-upload-icon {
	background: rgba(255, 255, 255, 0.14);
	color: var(--hfc-gold);
}
.hfc-upload-title {
	font-weight: 700;
	font-size: 0.96rem;
	line-height: 1.2;
}
.hfc-upload-sub {
	font-size: 0.76rem;
	color: var(--hfc-muted);
	line-height: 1.2;
}
.hfc-upload-tile.is-selected .hfc-upload-sub {
	color: rgba(255, 255, 255, 0.8);
}

.hfc-selected-file {
	margin-top: 12px;
	padding: 12px 14px;
	background: var(--hfc-paper);
	border: 1.5px solid var(--hfc-leather);
	border-radius: 14px;
	display: flex;
	align-items: center;
	gap: 12px;
}
.hfc-selected-thumb {
	width: 54px;
	height: 54px;
	border-radius: 10px;
	object-fit: cover;
	flex-shrink: 0;
	border: 1px solid var(--hfc-border);
}
.hfc-selected-doc-icon {
	width: 46px;
	height: 46px;
	border-radius: 10px;
	background: var(--hfc-bg);
	color: var(--hfc-leather);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.hfc-selected-info {
	flex: 1;
	min-width: 0;
}
.hfc-selected-name {
	font-weight: 700;
	font-size: 0.92rem;
	color: var(--hfc-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.hfc-selected-meta {
	font-size: 0.8rem;
	color: var(--hfc-muted);
	margin-top: 2px;
}

.hfc-existing-photo {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
	padding: 10px 12px;
	background: var(--hfc-bg);
	border-radius: 12px;
	border: 1px solid var(--hfc-border);
}
.hfc-existing-photo img {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 8px;
}

@media (max-width: 640px) {
	.hfc-form-wrap {
		margin: 14px 10px 32px;
		padding: 20px 15px;
		border-radius: 18px;
	}
	.hfc-heading-xl {
		font-size: clamp(1.75rem, 6.5vw, 2.3rem);
	}
	.hfc-chef-picker-box,
	.hfc-magic-panel {
		padding: 16px 14px;
		border-radius: 14px;
		margin-bottom: 20px;
	}
	.hfc-upload-picker {
		gap: 8px;
	}
	.hfc-upload-tile {
		padding: 12px 6px;
		min-height: 86px;
		border-radius: 14px;
	}
	.hfc-upload-icon {
		width: 36px;
		height: 36px;
	}
	.hfc-upload-title {
		font-size: 0.88rem;
	}
	.hfc-upload-sub {
		font-size: 0.7rem;
	}
	.hfc-import-controls .hfc-btn,
	.hfc-actions-row .hfc-btn {
		width: 100%;
		justify-content: center;
		min-height: 46px;
	}
	.hfc-app input[type="text"],
	.hfc-app input[type="search"],
	.hfc-app select,
	.hfc-app textarea {
		font-size: 16px;
	}
}
