:root {
    --bg: #F8F3EC;
    --card: #FFF4E6;
    --primary: #F4A896;
    --secondary: #E07A6F;
    --accent: #8F9D7A;
    --text-primary: #333333;
    --text-secondary: #6B6B6B;
    --ink: #2A1F14;
    --surface: #FFFFFF;
    --border: rgba(224, 122, 111, 0.24);
    --shadow: 0 12px 34px rgba(51, 51, 51, 0.08);
    --radius: 18px;
    --brand-serif: 'Fraunces', Georgia, serif;
    --serif: 'Lora', Georgia, serif;
    --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--sans);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
}

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 243, 236, 0.93);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(242, 133, 95, 0.14);
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #F2855F;
    font-family: var(--brand-serif);
    font-size: 26px;
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.3px;
    line-height: 1;
    text-transform: lowercase;
}

.nav-logo-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: #5A4636;
    font-size: 14px;
    font-weight: 400;
    padding: 8px 13px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: #F2855F;
    background: rgba(242, 133, 95, 0.08);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #F2855F;
    color: #fff;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.1;
    box-shadow: 0 2px 12px rgba(242, 133, 95, 0.35);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.nav-cta:hover {
    background: #C9612E;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(242, 133, 95, 0.45);
    color: #fff;
}

.nav-appstore {
    display: none;
    align-items: center;
    justify-content: center;
    background: #2A1F14;
    color: #fff;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
    transition: transform 0.2s;
}

.nav-appstore:hover {
    transform: translateY(-1px);
    color: #fff;
}

.page-wrap {
    max-width: 1300px;
    margin: 0 auto;
    padding: 28px 16px 92px;
}

.hero-card,
.card,
.conversion-card,
.seo-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 26px 20px;
    margin-bottom: 18px;
    background: linear-gradient(120deg, rgba(244, 168, 150, 0.24) 0%, rgba(244, 240, 236, 0.92) 45%, rgba(224, 122, 111, 0.18) 100%);
}

.kicker {
    color: #B05A40;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.crumb {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.crumb a {
    color: #B05A40;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hero-card h1 {
    font-family: var(--serif);
    color: #342A25;
    font-size: 26px;
    line-height: 1.25;
    margin-bottom: 8px;
}

.hero-sub {
    color: #5A4D44;
    font-size: 1.1rem;
    max-width: 760px;
    margin-bottom: 18px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    border: none;
    border-radius: 999px;
    font-family: var(--sans);
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(224, 122, 111, 0.26);
    padding: 13px 20px;
}

.primary-btn:hover {
    transform: translateY(-1px);
}

.secondary-btn {
    background: #fff;
    color: #7A4D3F;
    border: 1px solid rgba(224, 122, 111, 0.4);
    padding: 12px 18px;
}

.secondary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(224, 122, 111, 0.18);
}

.ghost-btn {
    background: transparent;
    color: #4E5A41;
    border: 1px solid rgba(143, 157, 122, 0.5);
    padding: 12px 18px;
}

.ghost-btn:hover {
    transform: translateY(-1px);
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1.75fr 1fr;
    gap: 16px;
}

.stack-col {
    display: grid;
    gap: 14px;
}

.results-col {
    display: grid;
    gap: 14px;
    align-content: start;
    position: sticky;
    top: 84px;
    height: fit-content;
}

.card {
    padding: 18px;
}

.card h2 {
    font-family: var(--serif);
    font-size: 1.4rem;
    line-height: 1.2;
    color: #3E312A;
    margin-bottom: 10px;
}

.card-sub {
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-size: 0.96rem;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ingredient-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ingredient-toolbar .secondary-btn,
.ingredient-toolbar .ghost-btn {
    padding: 9px 12px;
    font-size: 0.86rem;
}

.field-grid {
    display: grid;
    gap: 12px;
}

.field-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 7px;
}

.field span {
    font-size: 13px;
    color: #5A4D44;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(224, 122, 111, 0.28);
    border-radius: 10px;
    padding: 10px 11px;
    font-family: var(--sans);
    font-size: 15px;
    color: var(--text-primary);
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(224, 122, 111, 0.15);
}

.currency-input {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-prefix {
    position: absolute;
    left: 12px;
    font-weight: 700;
    font-size: 14px;
    color: #5A4D44;
    pointer-events: none;
    z-index: 1;
}

.currency-input input {
    width: 100%;
    padding-left: 30px;
}

.ingredients-list {
    display: grid;
    gap: 12px;
}

.paste-recipe-wrap {
    border: 1px dashed rgba(224, 122, 111, 0.35);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.65);
}

.paste-recipe-wrap textarea {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(224, 122, 111, 0.28);
    border-radius: 10px;
    padding: 10px 11px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text-primary);
    resize: vertical;
}

.paste-recipe-wrap textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(224, 122, 111, 0.15);
}

.paste-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.parse-status {
    font-size: 13px;
    color: #6D5B4D;
}

.ingredient-row {
    border: 1px solid rgba(224, 122, 111, 0.25);
    border-radius: 14px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.72);
    display: grid;
    gap: 6px;
}

.ingredient-card-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

.ingredient-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ingredient-name-field {
    flex: 1;
}

.ingredient-name-field input {
    font-size: 16px;
    font-weight: 700;
}

.phrase-group {
    display: grid;
    gap: 3px;
}

.phrase-label {
    font-size: 13px;
    font-weight: 700;
    color: #5B4C43;
    margin: 0;
}

.phrase-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.phrase-inline {
    font-size: 14px;
    color: #6B5E55;
}

.ingredient-currency-input {
    width: 118px;
}

.ingredient-currency-input .package-cost {
    background: #fff;
    border: 1px solid rgba(244, 168, 150, 0.72);
    border-radius: 10px;
    color: #3F342E;
    font-family: var(--sans);
    font-size: 14px;
    padding: 9px 10px 9px 30px;
}

.ingredient-currency-input .package-cost:focus {
    outline: none;
    border-color: #E07A6F;
    box-shadow: 0 0 0 2px rgba(244, 168, 150, 0.28);
}

.quantity-chip {
    border: 1px solid rgba(224, 122, 111, 0.35);
    background: #fff;
    color: #4E3D33;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    padding: 7px 11px;
    line-height: 1.1;
    cursor: pointer;
}

.quantity-chip:hover,
.quantity-chip:focus-visible {
    border-color: rgba(224, 122, 111, 0.65);
    box-shadow: 0 0 0 2px rgba(224, 122, 111, 0.12);
    outline: none;
}

.inline-editor {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(140px, 1fr);
    gap: 8px;
    align-items: end;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(224, 122, 111, 0.3);
    border-radius: 10px;
    padding: 6px;
}

.inline-editor[hidden] {
    display: none !important;
}

.editor-field {
    gap: 4px;
}

.cost-line {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px dashed rgba(224, 122, 111, 0.28);
    padding-top: 8px;
}

.cost-label {
    font-size: 14px;
    color: #5A4D44;
    font-weight: 700;
}

.ingredient-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.row-cost {
    margin: 0;
    font-weight: 600;
    color: #6B5E55;
    font-size: 0.86rem;
}

.row-error {
    color: #A54537;
    font-size: 12px;
    flex: 1;
    min-width: 220px;
}

.review-flag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(224, 122, 111, 0.16);
    color: #8A3C30;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.mini-btn {
    border: 1px solid rgba(224, 122, 111, 0.35);
    background: #fff;
    color: #724C40;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 11px;
    cursor: pointer;
}

.mini-btn:hover {
    background: rgba(224, 122, 111, 0.1);
}

.row-actions {
    display: flex;
    gap: 8px;
}

.field-problem {
    border-color: #A54537 !important;
    box-shadow: 0 0 0 2px rgba(165, 69, 55, 0.15);
}

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

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.split-card {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
}

.method-toggle {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.method-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(224, 122, 111, 0.3);
    background: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    color: #4D3F35;
    font-weight: 600;
    font-size: 14px;
}

.method-toggle input {
    accent-color: var(--secondary);
}

.actions-row {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.warning-card {
    border-color: rgba(166, 69, 55, 0.35);
    background: #FFF1EF;
}

.warning-card ul {
    list-style: disc;
    padding-left: 20px;
    color: #7C3B32;
    display: grid;
    gap: 6px;
}

.result-card {
    background: linear-gradient(155deg, #FFF4E6 0%, #FFFFFF 100%);
}

.result-kicker {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: #8C4A3E;
    font-weight: 700;
    margin-bottom: 8px;
}

.suggested-price {
    font-family: var(--serif);
    color: #2A281F;
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.05;
    margin-bottom: 8px;
}

.result-note {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.result-workflow-panel {
    border: 1px solid rgba(224, 122, 111, 0.24);
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(255, 244, 230, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
    padding: 12px;
    margin: 0 0 14px;
}

.result-workflow-panel h3 {
    margin: 0 0 6px;
    font-size: 1.08rem;
    color: #3E3029;
}

.result-workflow-panel p {
    margin: 0;
    color: #5A4D44;
    font-size: 0.94rem;
    line-height: 1.45;
}

.result-workflow-subtext {
    margin-top: 6px !important;
    color: #6B5E55 !important;
    font-size: 0.88rem !important;
}

.result-workflow-steps {
    margin-top: 10px !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.result-workflow-steps span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(244, 168, 150, 0.16);
    color: #6A4F42;
    font-size: 0.79rem;
    font-weight: 700;
}

.result-workflow-steps span[aria-hidden="true"] {
    background: transparent;
    padding: 0;
    color: #8B6455;
    font-weight: 500;
}

.result-workflow-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.result-dropdowns {
    display: grid;
    gap: 10px;
}

.result-dropdown {
    border: 1px solid rgba(224, 122, 111, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.result-dropdown > summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 700;
    color: #4E3D33;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.result-dropdown > summary::-webkit-details-marker {
    display: none;
}

.result-dropdown > summary::after {
    content: "▾";
    font-size: 13px;
    color: #7A4D3F;
    transition: transform 0.18s ease;
}

.result-dropdown[open] > summary::after {
    transform: rotate(180deg);
}

.result-dropdown .result-grid {
    padding: 0 10px 10px;
}

.result-grid {
    display: grid;
    gap: 9px;
}

.result-grid div {
    background: #fff;
    border: 1px solid rgba(224, 122, 111, 0.18);
    border-radius: 10px;
    padding: 9px 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.result-grid dt {
    color: #5A4D44;
    font-size: 13px;
}

.result-grid dd {
    font-weight: 700;
    color: #3A2F2A;
    text-align: right;
}

.seo-content {
    margin-top: 18px;
    width: 100%;
    padding: 24px;
    background: linear-gradient(170deg, rgba(255, 244, 230, 0.95) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.seo-header {
    margin-bottom: 16px;
}

.seo-content h2 {
    font-family: var(--serif);
    color: #352C27;
    font-size: 1.9rem;
    margin-bottom: 8px;
}

.seo-intro {
    color: #5A4D44;
    font-size: 1rem;
    white-space: nowrap;
}

.seo-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 16px;
}

.seo-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px 14px 13px;
    box-shadow: 0 8px 22px rgba(42, 31, 20, 0.06);
}

.seo-card h3 {
    font-family: var(--serif);
    color: #3D312A;
    font-size: 1.18rem;
    line-height: 1.25;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.seo-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.seo-card p {
    margin: 0;
    color: #5A4D44;
    font-size: 0.95rem;
}

.formula-box {
    background: rgba(244, 168, 150, 0.16);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
}

.formula-box h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #3D312A;
}

.formula-box p {
    margin: 0 0 8px;
    color: #4E4037;
    font-size: 0.95rem;
}

.formula-box p:last-child {
    margin-bottom: 0;
}

.formula-helper {
    color: #6B5E55;
}

.guide-cta {
    background: linear-gradient(120deg, rgba(244, 168, 150, 0.24) 0%, rgba(244, 240, 236, 0.92) 45%, rgba(224, 122, 111, 0.18) 100%);
    border-radius: 14px;
    padding: 16px;
}

.guide-cta h3 {
    margin: 0 0 8px;
    font-size: 1.22rem;
    color: #352C27;
}

.guide-cta p {
    margin: 0;
    color: #53473D;
}

.guide-cta-row {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

footer {
    text-align: center;
    padding: 32px 20px 42px;
    color: #A18875;
    font-size: 13px;
}

footer a {
    color: #7A5A48;
    text-decoration: none;
}

footer a:hover {
    color: #C9612E;
}

@media (max-width: 1200px) {
    .ingredient-card-grid {
        grid-template-columns: 1fr;
    }

    .results-col {
        position: static;
    }

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

@media (max-width: 1040px) {
    .seo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .field-grid.three-col,
    .field-grid.two-col,
    .split-card {
        grid-template-columns: 1fr;
    }

    .seo-intro {
        white-space: normal;
    }
}

@media (max-width: 768px) {
    nav { padding: 0 16px; }
    .nav-logo {
        font-size: 18px;
        gap: 6px;
        flex-shrink: 0;
    }
    .nav-logo-icon { width: 28px; height: 28px; }
    .nav-links {
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        max-width: calc(100vw - 150px);
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-link {
        font-size: 13px;
        padding: 8px 10px;
        white-space: nowrap;
    }
    .nav-appstore {
        display: inline-flex;
        font-size: 13px;
        padding: 8px 10px;
    }
    .nav-cta {
        font-size: 13px;
        padding: 8px 10px;
    }
}

@media (max-width: 640px) {
    .page-wrap {
        padding: 18px 12px 72px;
    }

    .card,
    .hero-card,
    .conversion-card,
    .seo-content {
        padding: 16px;
    }

    .hero-sub {
        font-size: 1rem;
    }

    .ingredient-card-grid {
        grid-template-columns: 1fr;
    }

    .inline-editor {
        grid-template-columns: 1fr;
    }

    .ingredient-currency-input {
        width: 108px;
    }

    .cost-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .ingredient-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .seo-content {
        padding: 18px;
    }

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

    .actions-row .primary-btn,
    .actions-row .secondary-btn,
    .actions-row .ghost-btn,
    .cta-row .primary-btn,
    .cta-row .secondary-btn,
    .cta-row .ghost-btn,
    .result-workflow-actions .primary-btn,
    .result-workflow-actions .secondary-btn,
    .guide-cta-row .primary-btn,
    .guide-cta-row .ghost-btn {
        width: 100%;
    }

    .ingredient-toolbar {
        width: 100%;
    }

    .ingredient-toolbar .secondary-btn,
    .ingredient-toolbar .ghost-btn {
        width: 100%;
    }
}
