:root {
    --primary: #8fc879;
    --secondary: #904153;
    --accent: #f5de5d;
    --primary-fg: #fff;

    --body-fg: #333;
    --body-bg: #fff;
    --body-quiet-color: #666;
    --body-medium-color: #444;
    --body-loud-color: #000;

    --header-color: #ffc;
    --header-branding-color: var(--accent);
    --header-bg: var(--secondary);
    --header-link-color: var(--primary-fg);

    --breadcrumbs-fg: #c4dce8;
    --breadcrumbs-link-fg: var(--body-bg);
    --breadcrumbs-bg: #264b5d;

    --link-fg: #417893;
    --link-hover-color: #036;
    --link-selected-fg: var(--secondary);

    --hairline-color: #e8e8e8;
    --border-color: #ccc;

    --error-fg: #ba2121;

    --message-success-bg: #dfd;
    --message-warning-bg: #ffc;
    --message-error-bg: #ffefef;

    --darkened-bg: #f8f8f8; /* A bit darker than --body-bg */
    --selected-bg: #e4e4e4; /* E.g. selected table cells */
    --selected-row: #ffc;

    --button-fg: #fff;
    --button-bg: var(--secondary);
    --button-hover-bg: #205067;
    --default-button-bg: #205067;
    --default-button-hover-bg: var(--secondary);
    --close-button-bg: #747474;
    --close-button-hover-bg: #333;
    --delete-button-bg: #ba2121;
    --delete-button-hover-bg: #a41515;

    --object-tools-fg: var(--button-fg);
    --object-tools-bg: var(--close-button-bg);
    --object-tools-hover-bg: var(--close-button-hover-bg);

    --font-family-primary:
        "Segoe UI",
        system-ui,
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Segoe UI Symbol",
        "Noto Color Emoji";
    --font-family-monospace:
        ui-monospace,
        Menlo,
        Monaco,
        "Cascadia Mono",
        "Segoe UI Mono",
        "Roboto Mono",
        "Oxygen Mono",
        "Ubuntu Monospace",
        "Source Code Pro",
        "Fira Mono",
        "Droid Sans Mono",
        "Courier New",
        monospace,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Segoe UI Symbol",
        "Noto Color Emoji";

    color-scheme: light;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    font-family: var(--font-family-primary);
    color: var(--body-fg);
    background: linear-gradient(180deg, #fcfcfc 0%, #f7f7f2 100%);
}

#container {
    position: relative;
    width: 100%;
    /* min-width: 980px; */
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#site-header {
    position: relative;
    width: auto;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(260px, 1fr) auto;
    grid-template-areas: "nav search user";
    align-items: center;
    gap: 18px;
    padding: 16px 40px 20px;
    background: linear-gradient(135deg, var(--secondary), #7a2f3b 100%);
    color: var(--header-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

#main-nav {
    grid-area: nav;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

#header-search {
    grid-area: search;
    min-width: 0;
}

#header-search form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

#header-search input#search-input  {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

#header-search input[type="submit"] {
    width: auto;
    min-width: 86px;
    max-width: none;
    padding-inline: 14px;
    background: var(--accent);
    color: var(--body-fg);
    border-color: transparent;
    cursor: pointer;
}

#user-actions {
    grid-area: user;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    white-space: nowrap;
}

.header-link {
    margin: 0px 0px;
    cursor: pointer;
    position: relative;
    font-size: 1.05rem;
    padding: 4px;
    display: flex;
    align-items: center;
}

.header-link a {
    text-decoration: none;
    color: var(--header-link-color);
}

.home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
}

.home-link img {
    width: 34px;
    height: 34px;
    display: block;
    border-radius: 8px;
}

.header-link ul {
    background-color: #fffdf8;
    position: absolute;
    display: block;
    visibility: hidden;
    margin: 0;
    padding: 8px 10px;
    z-index: 2;
    right: 0;
    border: 1px solid #e8e2d2;
    border-radius: 8px;
    list-style: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.header-link ul a {
    color: var(--body-fg);
}

.header-link:hover ul {
    visibility: visible;
}

.hamburger,
.meatballs {
    display: none;
}

@media (max-width: 900px) {
    #site-header {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "nav user"
            "search search";
    }

    #main-nav {
        gap: 12px;
    }

    #user-actions {
        align-self: start;
        padding-top: 4px;
    }
}

@media (max-width: 600px) {
    #site-header {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "menu search more";
        gap: 10px;
        padding: 12px 14px;
    }

    #main-nav,
    #user-actions {
        display: none;
    }

    #site-header.nav-open #main-nav,
    #site-header.user-open #user-actions {
        position: absolute;
        top: calc(100% + 8px);
        z-index: 30;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        min-width: 190px;
        padding: 10px;
        background: #fffdf8;
        border: 1px solid #e8e2d2;
        border-radius: 8px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    }

    #site-header.nav-open #main-nav {
        left: 14px;
    }

    #site-header.user-open #user-actions {
        right: 14px;
    }

    #site-header.nav-open #main-nav .header-link,
    #site-header.user-open #user-actions .header-link {
        padding: 0;
    }

    #site-header.nav-open #main-nav a,
    #site-header.user-open #user-actions a,
    #site-header.user-open #user-actions strong {
        display: block;
        color: var(--body-fg);
        padding: 9px 10px;
        border-radius: 6px;
    }

    #site-header.user-open #user-actions .header-link {
        display: block;
    }

    #site-header.user-open #user-actions ul {
        position: static;
        visibility: visible;
        box-shadow: none;
        border: 0;
        padding: 0;
        background: transparent;
    }

    #site-header.nav-open #main-nav a:hover,
    #site-header.user-open #user-actions a:hover {
        background: #f7f1e7;
    }

    #site-header.nav-open .home-link {
        width: auto;
        height: auto;
        justify-content: flex-start;
    }

    #site-header.nav-open .home-link img {
        width: 34px;
        height: 34px;
    }

    .hamburger,
    .meatballs {
        width: 42px;
        height: 42px;
        display: block;
        border: none;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.16);
        color: var(--header-link-color);
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
    }

    .hamburger {
        grid-area: menu;
    }

    .meatballs {
        grid-area: more;
    }

    #header-search {
        grid-area: search;
        margin: 0;
    }

    #header-search form {
        grid-template-columns: minmax(0, 1fr);
    }

    #header-search input[type="submit"] {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        border: 0;
        clip: rect(0 0 0 0);
        overflow: hidden;
    }
}

#container > .main {
    display: flex;
    flex: 1 0 auto;
}

.main > .content {
    flex: 1 0;
    max-width: 100%;
}

#content {
    padding: 24px 40px 40px;
}

h1, h2, h3 {
    line-height: 1.2;
    color: var(--body-loud-color);
}

h1 {
    margin-bottom: 0.5rem;
}

p {
    margin-top: 0;
}

pre {
    text-wrap: wrap;
    text-wrap-style: pretty;
}

img.logo-small{
    max-height:50px;
    max-width:200px;
    height:auto;
    width:auto;
}

footer {
    padding: 20px 40px 28px;
    background: #f2efe8;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--body-fg);
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.hero-actions a {
    background: var(--secondary);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.content-grid section,
.content-grid article {
    background: #fffdf8;
    border: 1px solid #e8e2d2;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.content-grid article > p:last-of-type {
    margin-top: 1rem;
    padding-top: 8px;
}

.item-card {
    position: relative;
    display: block;
    height: 240px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--body-fg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #fff;
}

.item-card:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.item-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #f2f2f2;
}

.item-card-content {
    position: absolute;
    inset: auto 0 0 0;
    padding: 14px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-card-content strong {
    color: #fff;
    font-size: 1rem;
}

.item-card-content span {
    color: rgba(255,255,255,0.95);
    font-size: 0.9rem;
    line-height: 1.4;
}

.store-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
}

.store-sidebar {
    background: #f7f7f7;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.buy-box {
    background: #fffdf8;
    border: 1px solid #e8e2d2;
    border-radius: 14px;
    padding: 18px;
    margin-top: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.recipe-notes {
    background: #fffdf8;
    border: 1px solid #e8e2d2;
    border-radius: 14px;
    padding: 18px;
    margin-top: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.recipe-description {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    white-space: pre-wrap;
    font-family: var(--font-family-primary);
    line-height: 1.6;
}

@media (max-width: 700px) {
    .store-layout {
        grid-template-columns: 1fr;
    }
}

form input,
form textarea,
form button {
    width: 100%;
    max-width: 480px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font: inherit;
}

form button {
    background: var(--secondary);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

form button:hover,
.hero-actions a:hover,
.listing-row a:hover {
    transform: translateY(-1px);
}

#search-results-container {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    width: min(420px, 100%);
    height: auto;

    /* background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    padding: 12px 14px; */
}

#search-results-container-inner {
    max-height: 80vh;
    overflow-y: auto;

}

.search-results-popup-list {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    padding: 12px 14px;
    color: var(--body-fg);
    /* max-height: 80vh;
    overflow-y: auto; */
}

.search-results-popup-list.empty {
    color: var(--body-quiet-color);
}

.search-results-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-results-list li a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--body-fg);
    background: #f7f7f7;
}

.search-results-list li a:hover {
    background: #f0f0f0;
}

.search-result-type {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary);
    margin-bottom: 2px;
}

.guide-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

.equipment-card-svg {
    width: 100%;
    height: 128px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e8e2d2;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
}

.guide-card a {
    margin-top: auto;
    font-weight: 600;
}

.card-link {
    color: inherit;
    text-decoration: none;
    display: block;
    height: 100%;
}

.card-link:hover .guide-card {
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-link-text {
    margin-top: auto;
    font-weight: 600;
    color: var(--secondary);
}
.disclosure {
    color: var(--body-quiet-color);
    font-size: 0.95rem;
}

.listing-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.listing-row:first-of-type {
    border-top: none;
}

.listing-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.listing-meta {
    color: var(--body-quiet-color);
    font-size: 0.92rem;
}

.listing-row a {
    background: var(--secondary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.breadcrumb {
    margin-bottom: 16px;
    color: var(--body-quiet-color);
}

.equipment-guide-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.equipment-summary {
    max-width: 760px;
    color: var(--body-medium-color);
    font-size: 1.05rem;
}

.equipment-svg-image {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
}

.equipment-guide-body {
    display: grid;
    gap: 18px;
    max-width: 960px;
}

.guide-section,
.calculator-panel {
    background: #fffdf8;
    border: 1px solid #e8e2d2;
    border-radius: 10px;
    padding: 18px;
}

.guide-section h2,
.calculator-panel h2 {
    margin-top: 0;
}

.calculator-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px)) minmax(220px, 320px);
    gap: 10px 14px;
    align-items: center;
}

.calculator-panel label {
    font-weight: 600;
}

.calculator-panel input {
    width: 100%;
    max-width: 220px;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font: inherit;
}

.calculator-result {
    grid-column: 1 / 3;
    min-height: 28px;
    font-weight: 700;
    color: var(--secondary);
}

.hydrometer-simulation {
    grid-column: 3;
    grid-row: 1 / 5;
    width: 100%;
    max-width: 320px;
}

.reading-table {
    width: 100%;
    border-collapse: collapse;
}

.reading-table th,
.reading-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.reading-table th {
    background: #f7f1e7;
}

@media (max-width: 760px) {
    .equipment-guide-header,
    .calculator-panel {
        grid-template-columns: 1fr;
    }

    .calculator-result,
    .hydrometer-simulation {
        grid-column: auto;
        grid-row: auto;
    }
}
