/* Public UI v2 preview tweaks.
   Choice: reuse app-v2.css for .mk-public / site-header / hero / footer / auth;
   this file is thin overlay (banner, disabled auth, preview label). */

.v2-preview-banner {
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 6px var(--s-3);
}

/* Legacy public content inside v2 chrome */
.public-embed .public-article {
    max-width: none;
}

.public-embed .recipe-card img.thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: calc(var(--r-card) - 4px);
    background: var(--surface-2, #f0f2f4);
}

.public-embed .public-breadcrumbs {
    margin: 0 0 var(--s-3);
    font-size: 13px;
}

.adslot,
.adslot--rail {
    display: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

/* /account hub */
.account-hub__loading {
    text-align: center;
    padding: var(--s-8) var(--s-4);
}

.account-hub__grid {
    margin-top: var(--s-5);
}

.account-setup-banner {
    margin-top: var(--s-5);
    display: flex;
    gap: var(--s-3);
    align-items: flex-start;
}

.account-setup-banner[hidden] {
    display: none !important;
}

.account-setup-banner__body {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: center;
    justify-content: space-between;
    flex: 1;
}

.account-setup-banner__body p {
    margin: 0;
}

.auth-wrap .btn.is-disabled,
.btn.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}

.site-header__preview {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-right: var(--s-2);
}

/* Wave 1 public content (034) — helpers without public.css */
.mb-5 { margin-bottom: var(--s-5); }

.recipe-card .thumb.thumb--wide {
    width: 100%;
    height: 148px;
}

.recipe-card .thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Public recipe filter chips are <a class="chip"> (092). */
.mk-public a.chip {
    text-decoration: none;
}

.calc-form.card {
    padding: var(--s-5);
}

/* Single column by default; Body split tools opt into .calc-split */
.mk-public .calc {
    grid-template-columns: minmax(0, 1fr);
}

/* 115: form | result panel */
.mk-public .calc.calc-split {
    gap: var(--s-4);
    align-items: start;
}
@media (min-width: 900px) {
    .mk-public .calc.calc-split {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.95fr);
    }
}
.calc-panel {
    background: var(--accent-soft, #ecfdf5);
    border: 1px solid var(--sage-300, #a7f3d0);
    border-radius: var(--r-card, 12px);
    padding: var(--s-3) var(--s-4);
    min-width: 0;
}
.calc-panel .t-upper {
    margin: 0 0 var(--s-2);
    font-size: 11px;
}
.calc-panel--standby {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 220px;
    justify-content: center;
}
.calc-panel--standby .v-gauge {
    margin: 0 auto var(--s-2);
}
.calc-panel--standby .calc-panel__hint {
    margin: 0;
    max-width: 16rem;
    font-size: 13px;
    color: var(--muted, #6b7280);
}
.calc-panel--filled .v-gauge {
    margin: 0 auto var(--s-2);
}
.calc-panel--filled .calc-results__stats {
    margin: 0 auto;
}
.calc-panel--filled .calc-panel__foot {
    margin-top: var(--s-2);
    width: 100%;
}
.v-gauge--standby {
    opacity: 0.9;
}
.v-gauge--standby .v-gauge__arc {
    opacity: 0.4;
}
.v-gauge--standby .v-gauge__needle {
    opacity: 0.45;
}
.calc-panel--dual-standby,
.calc-panel--dual-filled .calc-results__main--dual {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s-3);
}
.calc-how {
    margin-top: var(--s-4);
}

.calc-form textarea {
    width: 100%;
    min-height: 140px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    font: inherit;
    resize: vertical;
}

.calc__result {
    text-align: left;
}

.calc__result .t-upper {
    text-align: center;
}

.calc__result .kv {
    margin-top: var(--s-3);
}

.calc-info {
    padding: var(--s-5);
}

.calc-info h2 {
    margin: 0 0 var(--s-3);
    font-size: 16px;
}

.pub-faq {
    padding: var(--s-3) var(--s-4);
}

.pub-faq__q {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.pub-faq__q::-webkit-details-marker {
    display: none;
}

.calc-warnings {
    margin: var(--s-3) 0 0;
    padding-left: 1.2em;
    color: var(--warn);
    font-size: 13px;
}

/* Calculator upgrade: WHO / category band + compare table (106) */
.calc-bands {
    position: relative;
    margin: var(--s-4) 0;
}
.calc-bands__track {
    display: flex;
    gap: 2px;
    min-height: 28px;
    border-radius: var(--r-sm, 6px);
    overflow: hidden;
    background: var(--border, #e5e7eb);
}
.calc-bands__seg {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    color: var(--muted, #6b7280);
    background: var(--surface-2, #f3f4f6);
    min-width: 0;
}
.calc-bands__seg.is-active {
    background: var(--green-soft, #dcfce7);
    color: var(--green-dark, #166534);
    font-weight: 600;
}
.calc-bands__marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    margin-left: -1px;
    background: var(--green, #16a34a);
    border-radius: 1px;
    pointer-events: none;
}
.calc-table {
    width: 100%;
    margin-top: var(--s-3);
    border-collapse: collapse;
    font-size: 14px;
}
.calc-table th,
.calc-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.calc-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted, #6b7280);
}

/* 112: units panel + V-gauge + V-bars */
.calc-units-seg {
    display: inline-flex;
    gap: 0;
    margin-bottom: var(--s-3);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--r-md, 8px);
    overflow: hidden;
}
.calc-units-seg label {
    margin: 0;
    cursor: pointer;
}
.calc-units-seg input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.calc-units-seg span {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted, #6b7280);
    background: var(--surface, #fff);
}
.calc-units-seg input:checked + span,
.calc-units-seg label:has(input:checked) span {
    background: var(--green-soft, #dcfce7);
    color: var(--green-dark, #166534);
}
/* Inactive unit system must not occupy layout (.form-grid display overrides UA [hidden]). */
[data-unit-panel][hidden],
.calc-unit-panel[hidden] {
    display: none !important;
}
.calc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-3);
    align-items: center;
}

/* Compact result chrome (113) */
.mk-public .calc__result {
    padding: var(--s-3) var(--s-4);
    text-align: left;
}
.mk-public .calc__result .t-upper {
    text-align: left;
    margin: 0 0 var(--s-2);
    font-size: 11px;
}
.mk-public .calc__result > .t-muted {
    margin: 0 0 var(--s-2);
    font-size: 13px;
}
.mk-public .calc__result .kv {
    margin-top: 0;
    width: max-content;
    max-width: 100%;
}
.mk-public .calc__result .kv__row {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    justify-items: start;
    align-items: baseline;
    padding: 5px 0;
    gap: 4px 16px;
    font-size: 13px;
    width: max-content;
    max-width: 100%;
}
.mk-public .calc__result .kv__val {
    margin-left: 0;
    text-align: left;
}
.mk-public .calc__result .t-small {
    margin: var(--s-2) 0 0;
    line-height: 1.35;
}
.mk-public .calc__result .t-small + .t-small {
    margin-top: 4px;
}

.calc-results__main {
    display: grid;
    gap: var(--s-3);
    align-items: start;
    justify-content: start;
}
.calc-results__stats,
.calc-results__body {
    width: max-content;
    max-width: 100%;
    min-width: 0;
}
.calc-results__stats > .t-muted,
.calc-results__body > .t-muted {
    margin: 0 0 6px;
    font-size: 13px;
}
@media (min-width: 768px) {
    .calc-results__main--gauge {
        grid-template-columns: minmax(140px, 200px) max-content;
        gap: var(--s-4);
    }
    .calc-results__main--gauge .v-gauge {
        margin: 0;
        max-width: 200px;
    }
    .calc-results__main--gauge .v-gauge__legend {
        justify-content: flex-start;
    }
    .calc-results__main--dual {
        grid-template-columns: max-content max-content;
        gap: var(--s-3);
    }
    .calc-results__main--dual .v-gauge {
        margin: 0;
        max-width: none;
    }
}

.v-gauge {
    margin: var(--s-2) auto;
    max-width: 220px;
    text-align: center;
    color: var(--text, #111);
}
.v-gauge__svg {
    width: 100%;
    max-height: 100px;
    height: auto;
    display: block;
}
.v-gauge__arc {
    opacity: 0.55;
}
.v-gauge__arc.is-active {
    opacity: 1;
}
.v-gauge__cap {
    margin-top: -12px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.v-gauge__value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}
.v-gauge__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.v-gauge__legend {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 8px;
    font-size: 10px;
    line-height: 1.2;
    color: var(--muted, #6b7280);
}
.v-gauge__legend li {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.v-gauge__legend li.is-active {
    color: var(--text, #111);
    font-weight: 600;
}
.v-gauge__swatch {
    width: 6px;
    height: 6px;
    border-radius: 1px;
    display: inline-block;
    flex-shrink: 0;
}

.v-bars {
    margin-top: var(--s-2);
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}
.v-bars__meta {
    display: flex;
    justify-content: space-between;
    gap: var(--s-2);
    font-size: 12.5px;
    margin-bottom: 2px;
}
.v-bars__name {
    font-weight: 600;
}
.v-bars__track {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-2, #f3f4f6);
    overflow: hidden;
}
.v-bars__fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--green, #16a34a);
    min-width: 2px;
}
.v-bars--standby {
    width: 100%;
    max-width: 260px;
    opacity: 0.55;
}
.v-bars--standby .v-bars__fill {
    background: var(--border, #cbd5e1);
}

.thumb.thumb--hero {
    width: 100%;
    height: auto;
    min-height: 220px;
    aspect-ratio: 16 / 9;
}

.banner .banner__actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-left: auto;
}

@media (max-width: 768px) {
    .site-header__preview {
        display: none;
    }

    /* Keep primary hubs reachable on small screens (app-v2 hides .site-nav). */
    .mk-public .site-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 8px;
        max-width: 100%;
        order: 3;
        flex-basis: 100%;
        justify-content: flex-start;
    }

    .mk-public .site-nav a {
        padding: 6px 8px;
        font-size: 12.5px;
    }

    .mk-public .site-header__in {
        flex-wrap: wrap;
    }
}

/* Cookie consent + AdSense slots (065 SEO parity; styles lived in public.css) */
.cookie-banner {
    position: fixed;
    z-index: 1000;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    background: rgba(15, 23, 22, 0.96);
    color: #f4f7f5;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    justify-content: space-between;
}

.cookie-banner-inner p {
    margin: 0;
    flex: 1 1 280px;
    font-size: 14px;
    line-height: 1.45;
}

.cookie-banner-inner a {
    color: #6ee7b7;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.cookie-banner-actions .public-btn,
.cookie-banner-actions .cookie-banner-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
}

.cookie-banner-actions .public-btn--primary {
    background: #10b981;
    color: #042f2e;
}

.cookie-banner-link {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(226, 232, 240, 0.35) !important;
}

.public-ad-slot {
    margin: 0;
    padding: 0;
}

.public-ad-slot--live {
    margin: 12px auto;
    max-width: 970px;
    min-height: 90px;
    text-align: center;
}

.public-ad-slot--empty,
.public-ad-slot:empty,
.public-ad-slot[hidden] {
    display: none !important;
    min-height: 0 !important;
    margin: 0 !important;
}
