/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #2d6a4f;
    --color-primary-light: #40916c;
    --color-primary-dark: #1b4332;
    --color-accent: #d4a373;
    --color-accent-light: #e9c46a;
    --color-bg: #fefae0;
    --color-card: #ffffff;
    --color-text: #2b2b2b;
    --color-text-light: #6b7280;
    --color-border: #d1d5db;
    --color-danger: #dc2626;
    --color-success: #16a34a;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d4a373' fill-opacity='0.05'%3E%3Cpath d='M20 20.5V18H0v-2h20v-2H0v-2h20v-2H0V8h20V6H0V4h20V2H0V0h22v20h2V0h2v20h2V0h2v20h2V0h2v20h2V0h2v20.5z'/%3E%3C/g%3E%3C/svg%3E");
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === Animations === */
@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes celebrationPop {
    0% { opacity: 0; transform: scale(0.8); }
    60% { transform: scale(1.03); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes checkmarkDraw {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
}

@keyframes greenFlash {
    0% { background-color: transparent; }
    30% { background-color: rgba(22, 163, 74, 0.15); }
    100% { background-color: transparent; }
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out forwards;
    min-width: 250px;
    max-width: 400px;
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.toast-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.toast-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.toast-info {
    background: #f0f9ff;
    color: #0c4a6e;
    border: 1px solid #bae6fd;
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* === Save Checkmark Animation === */
.save-checkmark-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: none;
    animation: fadeIn 0.2s ease-out;
}

.save-checkmark-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: celebrationPop 0.4s ease-out;
    box-shadow: 0 8px 32px rgba(45, 106, 79, 0.35);
}

.save-checkmark-circle svg {
    width: 40px;
    height: 40px;
}

.save-checkmark-circle svg polyline {
    stroke: white;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: checkmarkDraw 0.35s 0.15s ease-out forwards;
}

/* === Green Flash for pantry save from row === */
.row-green-flash {
    animation: greenFlash 0.8s ease-out;
}

/* === Accessibility === */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    z-index: 10000;
    font-weight: 600;
    border-radius: 0 0 var(--radius) 0;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === Header === */
header {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-dark) 100%);
    color: white;
    padding: 0.75rem 0;
    text-align: center;
    border-bottom: 3px solid var(--color-accent);
    position: relative;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-align: left;
}

.header-logo {
    height: 288px;
    width: auto;
    flex-shrink: 0;
}

.header-text {
    display: flex;
    flex-direction: column;
}

header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent-light), var(--color-accent), var(--color-accent-light));
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--color-accent-light);
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* === Cards === */
.card {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 1.5rem 0;
    animation: cardEntrance 0.4s ease-out both;
    transition: box-shadow 0.3s ease;
    scroll-margin-top: 1rem;
}

.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h2 {
    font-size: 1.25rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-bg);
}

/* === Forms === */
.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

input[type="text"],
input[type="number"],
select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    width: 100%;
}

input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.input-prefix span {
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    background: #f9fafb;
    color: var(--color-text-light);
    font-weight: 600;
    border-right: 1px solid var(--color-border);
}

.input-prefix input {
    border: none;
    border-radius: 0;
}

.input-prefix input:focus {
    box-shadow: none;
}

.help-text {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* === Ingredient Table === */
.table-wrapper {
    overflow-x: auto;
    margin: 0.75rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    text-align: left;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

tbody td {
    padding: 0.4rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

tbody input {
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
}

tbody select {
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
}

.cost-cell {
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
    min-width: 70px;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.delete-btn:hover {
    background: #fef2f2;
}

.subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    margin-top: 0.75rem;
    border-top: 2px solid var(--color-primary);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-primary-dark);
}

/* === Overhead Grid === */
.overhead-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

/* === Buttons === */
.btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
    background: rgba(45, 106, 79, 0.08);
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.15);
    transform: translateY(-1px);
}

.btn-danger {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

.btn-danger:hover {
    background: #fef2f2;
}

/* === Results === */
.results-card {
    border-left: 4px solid var(--color-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.results-card.results-active {
    border-left-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(45, 106, 79, 0.15), 0 2px 4px rgba(0,0,0,0.06);
}

.results-hidden {
    display: none;
}

.results-placeholder {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-text-light);
}

.results-placeholder-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--color-text);
}

.results-placeholder-hint {
    font-size: 0.88rem;
    line-height: 1.5;
}

.results-visible {
    display: block;
}

.results-visible.results-reveal {
    animation: slideUp 0.5s ease-out;
}

.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.result-box {
    text-align: center;
    padding: 1.25rem 1rem;
    background: #f9fafb;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.result-box.highlight {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
}

.result-box.highlight .result-label,
.result-box.highlight .result-sublabel {
    color: rgba(255,255,255,0.85);
}

.result-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-light);
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.result-sublabel {
    font-size: 0.75rem;
    color: var(--color-text-light);
}

/* === Cost Breakdown Bar === */
.cost-breakdown {
    margin: 1.5rem 0;
}

.cost-breakdown h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary-dark);
}

.breakdown-bar {
    display: flex;
    height: 36px;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    gap: 2px;
    background: #e5e7eb;
    padding: 2px;
}

.breakdown-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    transition: width 0.5s ease, filter 0.2s ease, transform 0.2s ease;
    min-width: 4px;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
}

.breakdown-segment:hover {
    filter: brightness(1.1);
    transform: scaleY(1.1);
    z-index: 1;
}

.breakdown-segment .segment-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: white;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow);
}

.breakdown-segment .segment-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-text);
}

.breakdown-segment:hover .segment-tooltip {
    display: block;
}

.breakdown-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* === Margin Table === */
.margin-table-section {
    margin: 1.5rem 0;
}

.margin-table-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary-dark);
}

.margin-table {
    width: 100%;
}

.margin-table th {
    text-align: right;
}

.margin-table th:first-child {
    text-align: left;
}

.margin-table td {
    text-align: right;
    padding: 0.5rem;
}

.margin-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.margin-table tr.recommended {
    background: rgba(45, 106, 79, 0.08);
    font-weight: 600;
}

/* === Batch Summary === */
.batch-summary {
    margin: 1.5rem 0 0;
}

.batch-summary h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary-dark);
}

.batch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.batch-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 4px;
    font-size: 0.9rem;
}

.batch-item .batch-label {
    color: var(--color-text-light);
}

.batch-item .batch-value {
    font-weight: 600;
}

/* === Saved Recipes === */
.save-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.saved-recipe-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.saved-recipe-item:hover {
    background: #f9fafb;
}

.saved-recipe-info {
    display: flex;
    flex-direction: column;
}

.saved-recipe-name {
    font-weight: 600;
}

.saved-recipe-meta {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.saved-recipe-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* === Share Recipe Button === */
.share-recipe-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: var(--radius);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.share-recipe-btn:hover,
.duplicate-recipe-btn:hover {
    opacity: 1;
}

.duplicate-recipe-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: var(--radius);
    opacity: 0.5;
    transition: opacity 0.2s;
}

/* === Shared Recipe Banner === */
.shared-recipe-banner {
    background: linear-gradient(135deg, rgba(45, 106, 79, 0.08), rgba(212, 163, 115, 0.08));
    border: 2px solid var(--color-primary);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    animation: slideUp 0.3s ease-out;
}

.shared-recipe-banner-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.shared-recipe-banner-text {
    flex: 1;
    font-size: 0.95rem;
    min-width: 200px;
}

.shared-recipe-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* === Pantry Toggle Bar === */
.pantry-toggle-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
    margin-bottom: -0.75rem;
}

/* === Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
    overflow-y: auto;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 700px;
    max-height: calc(100vh - 6rem);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--color-bg);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--color-primary-dark);
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--color-text);
}

.modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
}

/* === Pantry === */
.pantry-search-bar {
    margin: 0.75rem 0;
}

.pantry-search-bar input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.pantry-add-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.pantry-add-form .input-prefix {
    min-width: 0;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.pantry-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}

.pantry-item:last-child {
    border-bottom: none;
}

.pantry-item-name {
    font-weight: 600;
}

.pantry-item-detail {
    color: var(--color-text-light);
    font-size: 0.85rem;
}

.pantry-item-actions {
    display: flex;
    gap: 0.25rem;
}

.pantry-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.pantry-item-actions .pantry-edit-btn {
    color: var(--color-primary);
}

.pantry-item-actions .pantry-edit-btn:hover {
    background: rgba(45, 106, 79, 0.08);
}

.pantry-item-actions .pantry-delete-btn {
    color: var(--color-danger);
}

.pantry-item-actions .pantry-delete-btn:hover {
    background: #fef2f2;
}

.pantry-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.pantry-item-editing {
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
}

.pantry-item-editing input,
.pantry-item-editing select {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.pantry-save-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.pantry-save-btn:hover {
    background: var(--color-primary-dark);
}

.pantry-cancel-btn {
    background: none;
    color: var(--color-text-light);
    border: 1px solid var(--color-border);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.pantry-cancel-btn:hover {
    background: #f3f4f6;
}

/* === Ingredient Autocomplete === */
.ing-name-wrapper {
    position: relative;
}

.pantry-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 180px;
    overflow-y: auto;
    z-index: 100;
}

.pantry-dropdown.open {
    display: block;
}

.pantry-dropdown-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    transition: background 0.15s;
}

.pantry-dropdown-item:hover,
.pantry-dropdown-item.active {
    background: rgba(45, 106, 79, 0.08);
}

.pantry-dropdown-item span:last-child {
    color: var(--color-text-light);
    font-size: 0.8rem;
}

/* === Save to Pantry Button === */
.save-pantry-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}

.save-pantry-btn:hover {
    background: rgba(45, 106, 79, 0.08);
}

.save-pantry-btn.saved {
    color: var(--color-success);
}

/* === Export Actions === */
.export-actions {
    margin: 1.5rem 0 0;
    padding-top: 1rem;
    border-top: 2px solid var(--color-bg);
}

.export-actions h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary-dark);
}

.export-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* === Print Overlay (hidden on screen) === */
.print-overlay {
    display: none;
}

/* === Price Card Styles === */
.price-card {
    border: 2px solid #1b4332;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    page-break-inside: avoid;
    break-inside: avoid;
}

.price-card .pc-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1b4332;
    margin-bottom: 0.25rem;
}

.price-card .pc-unit-type {
    font-size: 0.85rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.price-card .pc-divider {
    width: 60px;
    height: 3px;
    background: #d4a373;
    margin: 0 auto 1rem;
    border-radius: 2px;
}

.price-card .pc-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2d6a4f;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.price-card .pc-per-unit {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.price-card .pc-description {
    font-size: 0.9rem;
    color: #2b2b2b;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.price-card .pc-footer {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 0.75rem;
    border-top: 1px solid #d1d5db;
}

/* === Cost Sheet Print Layout === */
.print-cost-sheet-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.print-cost-sheet-header h1 {
    font-size: 1.5rem;
    color: #1b4332;
    margin-bottom: 0.25rem;
}

.print-cost-sheet-header p {
    font-size: 0.85rem;
    color: #6b7280;
}

.print-cost-sheet-section {
    margin-bottom: 1.25rem;
}

.print-cost-sheet-section h2 {
    font-size: 1rem;
    color: #1b4332;
    border-bottom: 2px solid #2d6a4f;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

.print-cost-sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.print-cost-sheet-table th {
    text-align: left;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    border-bottom: 1px solid #d1d5db;
}

.print-cost-sheet-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.print-cost-sheet-table .text-right {
    text-align: right;
}

.print-cost-sheet-table .total-row td {
    border-top: 2px solid #2d6a4f;
    font-weight: 700;
    color: #1b4332;
}

.print-cost-sheet-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.print-summary-box {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

.print-summary-box.highlight {
    border-color: #2d6a4f;
    background: rgba(45, 106, 79, 0.05);
}

.print-summary-box .psb-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
}

.print-summary-box .psb-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1b4332;
}

/* === Print Cards Grid (multi-card layout) === */
.print-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 0.5rem;
}

.print-cards-grid .price-card {
    width: 100%;
    min-height: 3in;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* === Category Pills === */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.category-pill {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-card);
    color: var(--color-text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.category-pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.category-pill.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.form-group-wide {
    flex: 1 1 100%;
}

/* === Recommended Supplies === */
.supplies-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.supplies-disclosure {
    font-size: 0.7rem;
    color: var(--color-text-light);
    font-style: italic;
}

.supplies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.supplies-category-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--color-border);
}

.supplies-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.supply-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.supply-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow);
}

.supply-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.supply-desc {
    font-size: 0.78rem;
    color: var(--color-text-light);
    line-height: 1.4;
}

.supply-cta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 0.2rem;
}

/* === Market Day Batch Planner === */
.planner-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-top: 0.5rem;
}

.planner-inputs .form-group {
    flex: 1;
    min-width: 180px;
}

.planner-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: var(--radius);
}

.planner-goal-met {
    background: rgba(22, 163, 74, 0.06);
    border: 1px solid var(--color-success);
}

.planner-goal-short {
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid var(--color-danger);
}

.planner-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.planner-summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.planner-summary-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
}

.planner-warning {
    color: #b45309;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.planner-table-wrapper {
    overflow-x: auto;
}

.planner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.planner-table th {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-text-light);
}

.planner-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.planner-recipe-cat {
    font-size: 0.7rem;
    color: var(--color-primary);
    background: rgba(45, 106, 79, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 10px;
}

.planner-shopping-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(45, 106, 79, 0.04);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* === Combined Shopping List === */
.combined-recipe-picker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.combined-recipe-picker-row:last-child {
    border-bottom: none;
}

.combined-recipe-picker-row label {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.combined-recipe-picker-row .batch-count-input {
    width: 60px;
    text-align: center;
    padding: 0.3rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.combined-recipe-picker-row .batch-count-label {
    font-size: 0.8rem;
    color: var(--color-text-light);
    white-space: nowrap;
}

.combined-recipe-empty {
    color: var(--color-text-light);
    font-style: italic;
    padding: 0.5rem 0;
}

.combined-shopping-actions {
    margin-top: 0.75rem;
}

/* === FAQ Section === */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    cursor: pointer;
    padding: 0.75rem 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-text-light);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.faq-item[open] .faq-question::after {
    content: '\2212';
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-answer {
    padding: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--color-text-light);
}

.faq-answer p {
    margin: 0 0 0.5rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* === State Reference Table === */
.state-reference {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.state-search-bar {
    margin: 0.5rem 0 0.75rem;
}

.state-search-bar input {
    width: 100%;
    max-width: 300px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.state-reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.state-reference-table th {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-text-light);
}

.state-reference-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.state-reference-table tr:hover {
    background: rgba(45, 106, 79, 0.03);
}

.state-cap-high {
    color: #16a34a;
    font-weight: 600;
}

.state-cap-mid {
    font-weight: 600;
}

.state-cap-low {
    color: #b45309;
    font-weight: 600;
}

.state-cap-restricted {
    color: #dc2626;
    font-weight: 600;
}

/* === Recipe Filter Bar === */
.recipe-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.filter-pill {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-card);
    color: var(--color-text-light);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-pill.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.saved-recipe-category {
    font-size: 0.7rem;
    color: var(--color-primary);
    background: rgba(45, 106, 79, 0.08);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.4rem;
}

/* === Pantry Price History === */
.pantry-price-change {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-left: 0.3rem;
    white-space: nowrap;
}

.pantry-price-change.price-up {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

.pantry-price-change.price-down {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
}

.pantry-price-change {
    cursor: pointer;
    position: relative;
}

.price-history-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0.5rem 0.65rem;
    min-width: 180px;
    z-index: 100;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-text);
    white-space: normal;
}

.pantry-price-change:hover .price-history-tooltip,
.pantry-price-change:focus .price-history-tooltip {
    display: block;
}

.price-history-tooltip-title {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-text-light);
    margin-bottom: 0.35rem;
}

.price-history-row {
    display: flex;
    justify-content: space-between;
    padding: 0.15rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.price-history-row:last-child {
    border-bottom: none;
}

.price-history-date {
    color: var(--color-text-light);
}

.price-history-value {
    font-weight: 600;
}

/* === Recipe Cost Alert Badge === */
.recipe-cost-alert {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.35rem;
    white-space: nowrap;
}

.recipe-cost-alert.cost-up {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

.recipe-cost-alert.cost-down {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
}

/* =============================================
   @media print — controls what appears on paper
   ============================================= */
@media print {
    /* Hide everything on the page by default */
    body > *:not(#print-overlay) {
        display: none !important;
    }

    /* Show the print overlay */
    #print-overlay {
        display: block !important;
        position: static !important;
    }

    body {
        background: white !important;
        margin: 0;
        padding: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Cost sheet: fit nicely on pages */
    .print-cost-sheet-header,
    .print-cost-sheet-section,
    .print-cost-sheet-summary {
        page-break-inside: avoid;
    }

    /* Price card grid: 2-up per page, break between sets of 4 */
    .print-cards-grid {
        gap: 1rem;
        padding: 0.25in;
    }

    .print-cards-grid .price-card {
        min-height: 3.5in;
        border: 2px solid #1b4332 !important;
    }

    /* Print margin table */
    .print-margin-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }

    .print-margin-table th {
        text-align: right;
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        border-bottom: 1px solid #d1d5db;
    }

    .print-margin-table th:first-child {
        text-align: left;
    }

    .print-margin-table td {
        text-align: right;
        padding: 0.25rem 0.5rem;
        border-bottom: 1px solid #f3f4f6;
    }

    .print-margin-table td:first-child {
        text-align: left;
        font-weight: 600;
    }

    .print-margin-table tr.recommended {
        background: rgba(45, 106, 79, 0.06) !important;
    }

    /* Page setup */
    @page {
        margin: 0.5in;
    }
}

/* === Batch Scaling Tool === */
.batch-scaling-section {
    margin: 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-bg);
}

.batch-scaling-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary-dark);
}

.scaling-controls {
    margin-top: 0.75rem;
}

.scaling-mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    width: fit-content;
}

.scaling-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-light);
    transition: all 0.2s;
}

.scaling-tab.active {
    background: var(--color-primary);
    color: white;
}

.scaling-tab:not(.active):hover {
    background: rgba(45, 106, 79, 0.05);
}

.scaling-input-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

.scaling-input-row .form-group {
    flex: 1;
    max-width: 300px;
}

.scaling-input-with-hint {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.scaling-results {
    margin-top: 1.25rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.scaling-multiplier-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--color-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.scaling-multiplier-badge #scaling-multiplier-display {
    font-size: 1rem;
}

.scaled-ingredients-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.scaled-ingredients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.scaled-ingredients-table thead th {
    text-align: left;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
}

.scaled-ingredients-table tbody td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.scaled-ingredients-table tbody td:nth-child(3) {
    font-weight: 600;
    color: var(--color-primary);
}

.scaled-cost-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.scaled-cost-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 4px;
    font-size: 0.9rem;
}

.scaled-cost-item .scaled-cost-label {
    color: var(--color-text-light);
}

.scaled-cost-item .scaled-cost-value {
    font-weight: 600;
}

.bulk-savings-note {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.2);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--color-success);
    font-weight: 500;
}

/* === Grocery Shopping List === */
.shopping-list-section {
    margin: 1.5rem 0 0;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-bg);
}

.shopping-list-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary-dark);
}

.shopping-list-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
}

.shopping-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
}

.shopping-checkbox-label input[type="checkbox"] {
    width: auto;
    accent-color: var(--color-primary);
}

.shopping-list-group {
    margin-bottom: 1rem;
}

.shopping-group-header {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary-dark);
    padding: 0.4rem 0;
    border-bottom: 2px solid var(--color-primary);
    margin-bottom: 0.5rem;
}

.shopping-list-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
    gap: 1rem;
}

.shopping-item-left {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.shopping-item-name {
    font-weight: 600;
}

.shopping-item-detail {
    color: var(--color-text-light);
    font-size: 0.8rem;
}

.shopping-item-cost {
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}

.shopping-list-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    border-top: 2px solid var(--color-primary);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-primary-dark);
}

.shopping-total-value {
    font-size: 1.1rem;
    color: var(--color-primary);
}

.shopping-list-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.copy-feedback {
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(22, 163, 74, 0.08);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--color-success);
    font-weight: 500;
    text-align: center;
}

/* === Unit Converter === */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 2fr;
    gap: 0.75rem;
    align-items: end;
    margin: 0.75rem 0;
}

.converter-arrow {
    font-size: 1.5rem;
    color: var(--color-text-light);
    padding-bottom: 0.4rem;
    text-align: center;
}

.converter-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-radius: var(--radius);
    margin-top: 0.5rem;
}

.converter-result-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.converter-result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.converter-result-value.conv-error {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-light);
    font-style: italic;
}

/* === Ingredient Conversion Note === */
.ing-conversion-note {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--color-text-light);
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 0.15rem;
}

/* === Quick Add Section === */
.quick-add-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--color-border);
}

.quick-add-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.quick-add-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.quick-add-pill {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--color-primary-light);
    border-radius: 20px;
    background: rgba(45, 106, 79, 0.04);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-add-pill:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(45, 106, 79, 0.2);
}

/* === Recipe Notes === */
.recipe-notes-group {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

.recipe-notes-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s;
}

.recipe-notes-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

/* === Cost Trend Indicator === */
.cost-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.cost-trend.trend-up {
    color: var(--color-danger);
}

.cost-trend.trend-down {
    color: var(--color-success);
}

.cost-trend.trend-same {
    color: var(--color-text-light);
}

/* === Pantry Per-Unit Cost === */
.pantry-unit-cost {
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 500;
}

/* === Focus Visible Styles for Keyboard Navigation === */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 0;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary-dark);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

/* === Input Validation Visual Feedback === */
input.input-error {
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

input.input-warning {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1) !important;
}

/* === Getting Started Tutorial === */
.getting-started-card {
    border-left: 4px solid var(--color-accent);
    background: linear-gradient(135deg, #fffdf7 0%, #fff 100%);
}

.getting-started-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.getting-started-header h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.getting-started-body {
    margin-top: 0.75rem;
}

.tutorial-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.tutorial-step {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.tutorial-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
}

.tutorial-step div {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* === Seasonal Adjustment === */
.seasonal-adjustment {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
}

.seasonal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.25rem;
}

.seasonal-checkbox-label input[type="checkbox"] {
    width: auto;
    accent-color: var(--color-accent);
}

.seasonal-adjustment .help-text {
    margin-top: 0.25rem;
    display: block;
}

/* === Profit Goal Calculator === */
.profit-goal-section {
    margin: 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-bg);
}

.profit-goal-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary-dark);
}

.profit-goal-input-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 0.75rem;
}

.profit-goal-input-row .form-group {
    max-width: 200px;
}

.profit-goal-results-table {
    width: 100%;
    margin-top: 1rem;
}

.profit-goal-results-table th {
    text-align: right;
}

.profit-goal-results-table th:first-child {
    text-align: left;
}

.profit-goal-results-table td {
    text-align: right;
    padding: 0.5rem;
}

.profit-goal-results-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.profit-goal-results-table tr.recommended {
    background: rgba(45, 106, 79, 0.08);
    font-weight: 600;
}

/* === Import/Export Actions === */
.import-export-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--color-border);
}

/* === Compare Recipes Table === */
#compare-recipes-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 2px solid var(--color-bg);
}

#compare-recipes-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary-dark);
}

.compare-table {
    width: 100%;
    font-size: 0.85rem;
}

.compare-table th {
    text-align: center;
    padding: 0.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.compare-table th:first-child {
    text-align: left;
    color: var(--color-text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.compare-table td {
    text-align: center;
    padding: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.compare-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--color-text-light);
}

.compare-table .compare-best {
    color: var(--color-success);
    font-weight: 700;
}

/* === Footer === */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--color-text-light);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-branding {
    font-size: 0.9rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.25rem;
}

.footer-branding strong {
    color: var(--color-primary);
}

/* === Privacy Badge === */
.privacy-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.3rem 0.85rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.3px;
}

/* === Cost Checklist === */
.cost-checklist {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.cost-checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.cost-checklist-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0c4a6e;
}

.cost-checklist-dismiss {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #0c4a6e;
    cursor: pointer;
    padding: 0 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.cost-checklist-dismiss:hover {
    opacity: 1;
}

.cost-checklist-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checklist-item {
    font-size: 0.78rem;
    color: #0369a1;
    padding: 0.15rem 0.5rem;
    background: rgba(255,255,255,0.6);
    border-radius: 4px;
    border: 1px solid #bae6fd;
}

/* === Labor Warning === */
.labor-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #92400e;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

/* === State Revenue Cap Tracker === */
.state-cap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.state-cap-details {
    padding: 0.6rem 0.75rem;
    background: #f9fafb;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.state-cap-details .cap-amount {
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 1.1rem;
}

.state-cap-details .cap-note {
    font-size: 0.8rem;
    color: var(--color-text-light);
    display: block;
    margin-top: 0.25rem;
}

.state-cap-progress-container {
    margin-bottom: 0.75rem;
}

.state-cap-progress-bar {
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.state-cap-progress-fill {
    height: 100%;
    border-radius: 12px;
    background: var(--color-primary);
    transition: width 0.5s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    min-width: 0;
}

.state-cap-progress-fill.warning {
    background: #f59e0b;
}

.state-cap-progress-fill.danger {
    background: var(--color-danger);
}

.state-cap-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 0.35rem;
}

.state-cap-projection {
    padding: 0.5rem 0.75rem;
    background: rgba(45, 106, 79, 0.06);
    border: 1px solid rgba(45, 106, 79, 0.15);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--color-text);
}

.state-cap-projection .projection-warning {
    color: var(--color-danger);
    font-weight: 600;
}

.state-no-cottage {
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: #991b1b;
}

/* === Seasonal Presets === */
.seasonal-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0;
}

.seasonal-preset-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid #fde68a;
    border-radius: 20px;
    background: rgba(253, 230, 138, 0.2);
    color: #92400e;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seasonal-preset-btn:hover {
    background: rgba(253, 230, 138, 0.5);
}

.seasonal-preset-btn.active {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

/* === Recipe Last Updated === */
.recipe-last-updated {
    font-size: 0.78rem;
    color: var(--color-text-light);
    margin-top: 0.35rem;
}

.recipe-stale-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recipe-stale-warning .dismiss-stale {
    background: none;
    border: none;
    color: #92400e;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.25rem;
    margin-left: auto;
    opacity: 0.6;
}

.recipe-stale-warning .dismiss-stale:hover {
    opacity: 1;
}

/* === Responsive === */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .overhead-grid {
        grid-template-columns: 1fr 1fr;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }

    .converter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .converter-arrow {
        display: none;
    }

    .batch-grid {
        grid-template-columns: 1fr;
    }

    .table-wrapper {
        margin: 0.75rem 0;
    }

    /* Hide Pantry save button column on medium screens to save space */
    thead th:nth-child(8),
    tbody td:nth-child(8) {
        display: none;
    }

    .save-actions {
        flex-direction: column;
    }

    .saved-recipe-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .saved-recipe-info {
        flex: 1 1 100%;
    }

    .pantry-add-form {
        grid-template-columns: 1fr 1fr;
    }

    .pantry-add-form input:first-child {
        grid-column: 1 / -1;
    }

    .pantry-item {
        grid-template-columns: 1fr auto;
        gap: 0.25rem;
    }

    .pantry-item-detail {
        grid-column: 1;
    }

    .modal {
        margin: 0;
        max-height: calc(100vh - 2rem);
    }

    .scaling-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .scaling-input-row .form-group {
        max-width: none;
    }

    .scaled-cost-grid {
        grid-template-columns: 1fr;
    }

    .shopping-list-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .shopping-list-actions {
        flex-direction: column;
    }

    .tutorial-steps {
        grid-template-columns: 1fr;
    }

    .profit-goal-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .profit-goal-input-row .form-group {
        max-width: none;
    }

    .import-export-actions {
        flex-direction: column;
    }

    .state-cap-grid {
        grid-template-columns: 1fr;
    }

    .seasonal-presets {
        flex-direction: column;
    }

    .cost-checklist-items {
        gap: 0.35rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Touch-friendly minimum sizes */
    .btn {
        min-height: 44px;
        padding: 0.65rem 1.25rem;
    }

    .btn-sm {
        min-height: 40px;
    }

    .delete-btn,
    .duplicate-recipe-btn,
    .share-recipe-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .save-pantry-btn {
        min-height: 44px;
        padding: 0.4rem 0.6rem;
    }

    .pantry-dropdown-item {
        padding: 0.65rem 0.75rem;
        min-height: 44px;
    }

    .quick-add-pill {
        min-height: 44px;
        padding: 0.5rem 0.85rem;
    }

    .seasonal-preset-btn {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }

    .scaling-tab {
        min-height: 44px;
    }

    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }

    select, input[type="number"], input[type="text"] {
        min-height: 44px;
    }

    .pantry-item-actions button {
        min-height: 44px;
        min-width: 44px;
    }

    .footer-links a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .overhead-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .header-logo {
        height: 187px;
    }
}

/* === Empty State Messages === */
.empty-state-message {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-style: italic;
    background: #f9fafb;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    margin: 0.75rem 0;
}

/* === Footer Links — visually distinct from buttons === */
.footer-links a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-links a:hover {
    color: var(--color-primary-dark);
}

/* === Back to Top Button === */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* === FOUC Prevention === */
body {
    opacity: 1;
}

/* === Mobile Card-Style Tables === */
@media (max-width: 600px) {
    /* Ingredient table card layout */
    #ingredients-table,
    #ingredients-table tbody {
        display: block;
        width: 100%;
    }

    #ingredients-table thead {
        display: none;
    }

    #ingredients-table tbody tr {
        display: block;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        background: #f9fafb;
        position: relative;
    }

    #ingredients-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.3rem 0;
        border-bottom: none;
    }

    #ingredients-table tbody td::before {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--color-text-light);
        text-transform: uppercase;
        letter-spacing: 0.3px;
        flex-shrink: 0;
        margin-right: 0.75rem;
    }

    #ingredients-table tbody td:nth-child(1)::before { content: "Ingredient"; }
    #ingredients-table tbody td:nth-child(2)::before { content: "Pkg Price"; }
    #ingredients-table tbody td:nth-child(3)::before { content: "Pkg Size"; }
    #ingredients-table tbody td:nth-child(4)::before { content: "Pkg Unit"; }
    #ingredients-table tbody td:nth-child(5)::before { content: "Recipe Uses"; }
    #ingredients-table tbody td:nth-child(6)::before { content: "Recipe Unit"; }
    #ingredients-table tbody td:nth-child(7)::before { content: "Cost"; }

    #ingredients-table tbody td:nth-child(8),
    #ingredients-table tbody td:nth-child(9) {
        display: inline-flex;
        padding: 0.2rem;
    }

    #ingredients-table tbody td:nth-child(1) .ing-name-wrapper {
        flex: 1;
        min-width: 0;
    }

    #ingredients-table tbody td:nth-child(1) input,
    #ingredients-table tbody td:nth-child(2) input,
    #ingredients-table tbody td:nth-child(3) input,
    #ingredients-table tbody td:nth-child(5) input {
        max-width: 60%;
        text-align: right;
    }

    #ingredients-table tbody td:nth-child(4) select,
    #ingredients-table tbody td:nth-child(6) select {
        max-width: 60%;
    }

    /* Margin table card layout */
    .margin-table thead {
        display: none;
    }

    .margin-table tbody tr {
        display: block;
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.5rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        background: #f9fafb;
    }

    .margin-table tbody tr.recommended {
        border-color: var(--color-primary);
        background: rgba(45, 106, 79, 0.06);
    }

    .margin-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.2rem 0;
        text-align: left;
        border-bottom: none;
    }

    .margin-table tbody td::before {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--color-text-light);
        text-transform: uppercase;
    }

    .margin-table tbody td:nth-child(1)::before { content: "Margin"; }
    .margin-table tbody td:nth-child(2)::before { content: "Price"; }
    .margin-table tbody td:nth-child(3)::before { content: "Profit"; }
    .margin-table tbody td:nth-child(4)::before { content: "Batch Profit"; }

    /* Profit goal table card layout */
    .profit-goal-results-table thead {
        display: none;
    }

    .profit-goal-results-table tbody tr {
        display: block;
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.5rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        background: #f9fafb;
    }

    .profit-goal-results-table tbody tr.recommended {
        border-color: var(--color-primary);
        background: rgba(45, 106, 79, 0.06);
    }

    .profit-goal-results-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.2rem 0;
        text-align: left;
        border-bottom: none;
    }

    .profit-goal-results-table tbody td::before {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--color-text-light);
        text-transform: uppercase;
    }

    .profit-goal-results-table tbody td:nth-child(1)::before { content: "Margin"; }
    .profit-goal-results-table tbody td:nth-child(2)::before { content: "Price"; }
    .profit-goal-results-table tbody td:nth-child(3)::before { content: "Units"; }
    .profit-goal-results-table tbody td:nth-child(4)::before { content: "Revenue"; }

    /* Scaled ingredients table card layout */
    .scaled-ingredients-table thead {
        display: none;
    }

    .scaled-ingredients-table tbody tr {
        display: block;
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.5rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        background: white;
    }

    .scaled-ingredients-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.2rem 0;
        border-bottom: none;
    }

    .scaled-ingredients-table tbody td::before {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--color-text-light);
        text-transform: uppercase;
    }

    .scaled-ingredients-table tbody td:nth-child(1)::before { content: "Ingredient"; }
    .scaled-ingredients-table tbody td:nth-child(2)::before { content: "Original"; }
    .scaled-ingredients-table tbody td:nth-child(3)::before { content: "Scaled"; }
    .scaled-ingredients-table tbody td:nth-child(4)::before { content: "Unit"; }

    /* Compare table card layout */
    .compare-table thead {
        display: none;
    }

    .compare-table tbody tr {
        display: block;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        background: #f9fafb;
    }

    .compare-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.2rem 0;
        text-align: left;
        border-bottom: none;
    }

    .compare-table tbody td:first-child {
        font-weight: 700;
        color: var(--color-primary-dark);
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 0.3rem;
        margin-bottom: 0.2rem;
    }

    /* Export buttons stack on mobile */
    .export-buttons {
        flex-direction: column;
    }

    /* Converter ingredient select full width */
    .converter-grid {
        grid-template-columns: 1fr;
    }

    /* Shopping list items stack better */
    .shopping-list-item {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }

    .shopping-item-cost {
        align-self: flex-end;
    }
}
