* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: sans-serif; background: #f4f4f4; color: #333; padding: 2rem; }
h1 { margin-bottom: 0; }
.site-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:1.5rem; }
.auth-area { display:flex; align-items:center; gap:0.75rem; font-size:0.85rem; }
.auth-email { color:#666; }
.auth-link { color:#2563eb; text-decoration:none; }
.auth-link:hover { text-decoration:underline; }

/* Tab nav */
.tab-nav { display: flex; gap: 0; margin-bottom: 2rem; border-bottom: 2px solid #e0e0e0; }
.tab-nav button {
    padding: 0.6rem 1.4rem; border: none; background: none; cursor: pointer;
    font-size: 0.95rem; color: #666; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-nav button.active { color: #2c7be5; border-bottom-color: #2c7be5; font-weight: 600; }

/* Store cards */
.stores { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.store-card {
    background: white; border-radius: 8px; padding: 1rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    display: flex; flex-direction: column; gap: 0.5rem; min-width: 160px;
}
.store-card h3 { font-size: 1rem; }
.store-card button {
    padding: 0.4rem 0.8rem; background: #2c7be5; color: white;
    border: none; border-radius: 4px; cursor: pointer; font-size: 0.85rem;
}
.store-card button:disabled { background: #aaa; cursor: not-allowed; }
.store-card .status { font-size: 0.8rem; color: #666; min-height: 1.2em; }
.progress-wrap { display: none; flex-direction: column; gap: 0.3rem; }
.progress-wrap.visible { display: flex; }
.progress-bar-track { background: #e0e0e0; border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: #2c7be5; border-radius: 4px; transition: width 0.4s ease; width: 0%; }
.progress-label { font-size: 0.75rem; color: #555; }

/* Table */
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid #eee; font-size: 0.9rem; }
th { background: #f8f8f8; font-weight: 600; }
.badge { background: #e8f5e9; color: #2e7d32; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }
.empty { text-align: center; padding: 2rem; color: #999; }
td a { color: #2c7be5; text-decoration: none; }
td a:hover { text-decoration: underline; }
th[data-col] { cursor: pointer; user-select: none; white-space: nowrap; }
th[data-col]:hover { background: #efefef; }
th[data-col] .sort-arrow { margin-left: 4px; color: #aaa; font-size: 0.75em; }
th[data-col].sorted .sort-arrow { color: #2c7be5; }

/* Filters / toolbar */
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters button {
    padding: 0.35rem 0.9rem; border: 1px solid #ccc; border-radius: 20px;
    background: white; cursor: pointer; font-size: 0.85rem; color: #555;
}
.filters button.active { background: #2c7be5; color: white; border-color: #2c7be5; }
#sale-toggle, #fresh-toggle {
    padding: 0.35rem 0.9rem; border: 1px solid #ccc; border-radius: 20px;
    background: white; cursor: pointer; font-size: 0.85rem; color: #555; white-space: nowrap;
}
#sale-toggle.active, #fresh-toggle.active { background: #2c7be5; color: white; border-color: #2c7be5; }
.toolbar { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.search-box {
    flex: 1; min-width: 200px; padding: 0.4rem 0.75rem;
    border: 1px solid #ccc; border-radius: 20px; font-size: 0.9rem; outline: none;
}
.search-box:focus { border-color: #2c7be5; }
.pagination { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; justify-content: center; }
.pagination button {
    padding: 0.35rem 0.8rem; border: 1px solid #ccc; border-radius: 4px;
    background: white; cursor: pointer; font-size: 0.85rem;
}
.pagination button:disabled { color: #aaa; cursor: not-allowed; }
.pagination button.active { background: #2c7be5; color: white; border-color: #2c7be5; }
.pagination .page-info { font-size: 0.85rem; color: #666; }

/* Meat highlights */
.highlights { margin-bottom: 2rem; }
.highlights h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; color: #555; text-transform: uppercase; letter-spacing: 0.05em; }
.highlight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.highlight-card { background: white; border-radius: 8px; padding: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.highlight-card h3 { font-size: 0.9rem; font-weight: 700; color: #333; margin-bottom: 0.6rem; border-bottom: 2px solid #f0f0f0; padding-bottom: 0.4rem; }
.hl-item { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid #f5f5f5; font-size: 0.82rem; }
.hl-item:last-child { border-bottom: none; }
.hl-rank { font-size: 0.75rem; color: #aaa; min-width: 1.2em; padding-top: 1px; }
.hl-rank.gold { color: #f59e0b; font-weight: 700; }
.hl-info { flex: 1; min-width: 0; }
.hl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #333; }
.hl-name a { color: #2c7be5; text-decoration: none; }
.hl-name a:hover { text-decoration: underline; }
.hl-meta { color: #888; font-size: 0.78rem; }
.hl-price { text-align: right; white-space: nowrap; }
.hl-price .price { font-weight: 700; color: #111; }
.hl-price .was { font-size: 0.75rem; color: #999; text-decoration: line-through; }
.hl-price .save { font-size: 0.75rem; color: #2e7d32; }
.hl-sale { display: inline-block; background: #fff3e0; color: #e65100; border-radius: 3px; padding: 0 0.35rem; font-size: 0.7rem; font-weight: 600; margin-left: 3px; vertical-align: middle; }
.hl-empty { color: #aaa; font-size: 0.85rem; padding: 0.5rem 0; }

/* Shared buttons */
.btn-primary { padding: 0.45rem 1rem; background: #2c7be5; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.btn-primary:hover { background: #1a6bd4; }
.btn-secondary { padding: 0.45rem 1rem; background: white; color: #555; border: 1px solid #ccc; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.btn-danger { padding: 0.3rem 0.7rem; background: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }

/* Recipe list */
.recipe-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.recipe-toolbar h2 { font-size: 1rem; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: 0.05em; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.recipe-card {
    background: white; border-radius: 8px; padding: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1); cursor: pointer;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.recipe-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.recipe-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.recipe-card h3 { font-size: 1rem; color: #333; }
.recipe-card .meta { font-size: 0.8rem; color: #888; }
.recipe-photos-strip { display: flex; gap: 0.4rem; }
.recipe-photos-strip img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }

/* Recipe detail */
#recipe-detail { display: none; }
.detail-back { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.detail-back button { background: none; border: 1px solid #ccc; border-radius: 4px; padding: 0.3rem 0.7rem; cursor: pointer; font-size: 0.85rem; }
#detail-edit .form-group { margin-bottom: 1rem; }
#detail-edit label { display: block; font-size: 0.8rem; font-weight: 600; color: #666; margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.04em; }
#detail-edit input[type=text], #detail-edit textarea { width: 100%; box-sizing: border-box; border: 1px solid #ddd; border-radius: 4px; padding: 0.4rem 0.6rem; font-size: 0.9rem; font-family: inherit; }
#detail-edit textarea { resize: vertical; }
.detail-photos { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.detail-photos img { max-height: 220px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.detail-sections { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; }
@media (max-width: 700px) { .detail-sections { grid-template-columns: 1fr; } }
.detail-section { background: white; border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.detail-section h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: #888; margin-bottom: 0.75rem; }
.ingredient-row { padding: 0.5rem 0; border-bottom: 1px solid #f5f5f5; }
.ingredient-row:last-child { border-bottom: none; }
.ing-name { font-weight: 600; font-size: 0.9rem; }
.ing-qty { color: #666; font-size: 0.85rem; }
.ing-matches { margin-top: 0.35rem; }
.ing-match { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: #555; padding: 0.2rem 0.4rem; border-radius: 3px; }
.ing-match:hover { background: #f5f8ff; }
.ing-match a { color: #2c7be5; text-decoration: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ing-match .match-price { font-weight: 700; color: #111; white-space: nowrap; }
.ing-match .match-sale { color: #2e7d32; font-size: 0.72rem; }
.ing-match .match-store { color: #999; margin-left: 0.3rem; }
.ing-no-match { color: #bbb; font-size: 0.78rem; font-style: italic; margin-top: 0.25rem; }
.instructions-text { font-size: 0.9rem; line-height: 1.7; color: #444; white-space: pre-wrap; }

/* Upload modal */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 100;
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: 10px; padding: 1.75rem; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal h2 { margin-bottom: 1rem; font-size: 1.1rem; }
.drop-zone {
    border: 2px dashed #ccc; border-radius: 8px; padding: 2rem; text-align: center;
    color: #888; cursor: pointer; margin-bottom: 1rem; transition: border-color 0.2s;
}
.drop-zone.drag-over { border-color: #2c7be5; background: #f0f6ff; }
.drop-zone p { font-size: 0.9rem; }
.photo-previews { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.photo-previews img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.modal-status { font-size: 0.85rem; color: #666; margin-bottom: 0.75rem; min-height: 1.2em; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* Extracted recipe form */
#extracted-form { display: none; margin-top: 1rem; }
.form-group { margin-bottom: 0.75rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: #555; margin-bottom: 0.3rem; }
.form-group input, .form-group textarea {
    width: 100%; padding: 0.4rem 0.6rem; border: 1px solid #ccc; border-radius: 4px;
    font-size: 0.9rem; font-family: inherit;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.ing-edit-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.35rem; flex-wrap: wrap; }
.ing-edit-row input { flex: 1; min-width: 60px; }
.ing-edit-row .ing-name-input { flex: 2; }
.ing-edit-row button { padding: 0.3rem 0.5rem; background: #f5f5f5; border: 1px solid #ddd; border-radius: 3px; cursor: pointer; font-size: 0.8rem; }
