:root {
    --bg: #f5f2ea;
    --bg-deep: #13342f;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --surface-dark: #173b35;
    --text: #17312c;
    --muted: #5e726d;
    --line: rgba(19, 52, 47, 0.1);
    --accent: #a6ed48;
    --accent-strong: #78bf1f;
    --accent-soft: rgba(166, 237, 72, 0.16);
    --warning: #ef9d2f;
    --danger: #de5a44;
    --shadow: 0 20px 50px rgba(13, 37, 33, 0.14);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --nav-height: 84px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 10%, rgba(166, 237, 72, 0.26), transparent 30%),
        radial-gradient(circle at 90% 0%, rgba(239, 157, 47, 0.16), transparent 35%),
        linear-gradient(180deg, #faf7f0 0%, #f2efe7 38%, #ece7dd 100%);
    font-family: "Instrument Sans", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.08;
}

p {
    margin: 0;
    line-height: 1.55;
}

.guest-body {
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.guest-header,
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.guest-header {
    position: relative;
    z-index: 2;
    padding: 1.25rem 1rem 0.75rem;
}

.guest-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pill-link {
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(19, 52, 47, 0.08);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
}

.brand img {
    width: 40px;
    height: 40px;
}

.guest-main,
.app-main {
    padding: 1rem;
}

.guest-main {
    flex: 1;
}

.app-main {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.guest-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem 1.5rem;
    color: var(--muted);
}

.orb {
    position: fixed;
    inset: auto;
    border-radius: 999px;
    filter: blur(20px);
    opacity: 0.65;
    pointer-events: none;
}

.orb-a {
    width: 220px;
    height: 220px;
    top: 2rem;
    right: -2rem;
    background: rgba(166, 237, 72, 0.34);
}

.orb-b {
    width: 280px;
    height: 280px;
    bottom: 10rem;
    left: -6rem;
    background: rgba(27, 89, 78, 0.22);
}

.hero-landing,
.hero-card {
    position: relative;
    display: grid;
    gap: 1rem;
    padding: 1.4rem;
    border-radius: 34px;
    background:
        linear-gradient(145deg, rgba(19, 52, 47, 0.95), rgba(21, 70, 61, 0.88)),
        linear-gradient(135deg, rgba(166, 237, 72, 0.18), rgba(239, 157, 47, 0.08));
    color: #eff8f1;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-landing::after,
.hero-card::after {
    content: "";
    position: absolute;
    inset: auto -2rem -2rem auto;
    width: 160px;
    height: 160px;
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(166, 237, 72, 0.3), rgba(255, 255, 255, 0.04));
    transform: rotate(18deg);
}

.hero-copy,
.hero-panel,
.hero-metrics,
.hero-card > * {
    position: relative;
    z-index: 1;
}

.hero-copy h1,
.hero-card h2 {
    font-size: clamp(2.1rem, 5vw, 3.8rem);
    max-width: 12ch;
}

.hero-copy p,
.hero-card p {
    max-width: 56ch;
    color: rgba(239, 248, 241, 0.78);
}

.hero-actions,
.action-grid,
.recipe-grid,
.chip-row,
.macro-inline,
.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-panel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    padding: 1rem;
    backdrop-filter: blur(14px);
    color: #eff8f1;
}

.landing-stack {
    display: grid;
    gap: 1.25rem;
}

.hero-metrics > div {
    min-width: 94px;
    padding: 0.9rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-metrics strong {
    display: block;
    font-size: 1.3rem;
}

.hero-metrics span {
    color: rgba(239, 248, 241, 0.72);
    font-size: 0.9rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: rgba(239, 248, 241, 0.7);
}

.app-shell {
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 1rem);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 1rem;
    backdrop-filter: blur(18px);
    background: linear-gradient(180deg, rgba(245, 242, 234, 0.95), rgba(245, 242, 234, 0.7));
}

.topbar-copy h1 {
    font-size: 1.2rem;
}

.topbar-copy .eyebrow {
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-pill,
.avatar-large {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--accent), #d5ff9a);
    color: var(--bg-deep);
    font-weight: 700;
}

.avatar-pill {
    width: 44px;
    height: 44px;
    border-radius: 16px;
}

.avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 24px;
    font-size: 1.35rem;
}

.language-pill button,
.button,
.icon-button,
.bottom-nav a,
.bottom-nav button,
.action-tile {
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.button,
.language-pill button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.85rem 1.15rem;
    border: none;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--accent), #d8ff8b);
    color: #19322c;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(120, 191, 31, 0.22);
    cursor: pointer;
}

.button:hover,
.language-pill button:hover,
.action-tile:hover,
.bottom-nav a:hover,
.bottom-nav button:hover,
.recipe-card:hover {
    transform: translateY(-1px);
}

.button--ghost,
.icon-button--ghost {
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    border: 1px solid rgba(19, 52, 47, 0.08);
    box-shadow: none;
}

.icon-button {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.icon-button i {
    font-size: 1.3rem;
    line-height: 1;
}

.card,
.recipe-card,
.table-row,
.flash {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.44);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.card {
    padding: 1.15rem;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.flash {
    padding: 1rem 1.1rem;
}

.flash--error {
    border-color: rgba(222, 90, 68, 0.26);
    background: rgba(255, 240, 237, 0.95);
}

.flash--warning {
    border-color: rgba(239, 157, 47, 0.28);
    background: rgba(255, 246, 230, 0.95);
}

.flash ul {
    margin: 0.65rem 0 0;
    padding-left: 1.1rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

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

.grid--split,
.recipe-hero {
    grid-template-columns: 1fr;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.stat-card strong {
    font-size: 1.55rem;
    font-family: "Space Grotesk", sans-serif;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-head a {
    color: var(--muted);
}

.info-list {
    display: grid;
    gap: 0.75rem;
}

.info-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(19, 52, 47, 0.06);
    border-radius: 16px;
}

.info-list span {
    color: var(--muted);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-tile {
    display: flex;
    align-items: flex-end;
    min-height: 110px;
    padding: 1rem;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(21, 70, 61, 0.98), rgba(29, 88, 76, 0.82));
    color: #eef9f1;
    box-shadow: 0 16px 30px rgba(19, 52, 47, 0.18);
}

.recipe-grid {
    display: grid;
    grid-template-columns: 1fr;
}

.recipe-card {
    overflow: hidden;
}

.recipe-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.recipe-card--no-image > div {
    padding-top: 1.15rem;
}

.recipe-card > div {
    padding: 1rem;
}

.recipe-card h4,
.recipe-card h3 {
    margin-bottom: 0.35rem;
}

.recipe-card p {
    color: var(--muted);
}

.recipe-card--large {
    display: grid;
}

.recipe-card--large img {
    height: 220px;
}

.macro-inline {
    color: var(--muted);
    font-size: 0.9rem;
}

.stack-list,
.stack-form {
    display: grid;
    gap: 1rem;
}

.search-row,
.generate-inline,
.form-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.search-row input,
.search-row select {
    flex: 1 1 190px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.95rem;
}

.field-span-2 {
    grid-column: span 1;
}

label {
    display: grid;
    gap: 0.5rem;
}

label span,
label small {
    color: var(--muted);
}

input,
textarea,
select {
    width: 100%;
    min-height: 48px;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(19, 52, 47, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
}

textarea {
    resize: vertical;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(19, 52, 47, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
}

.toggle-row input {
    width: auto;
    min-height: auto;
}

.auth-shell {
    display: grid;
    gap: 1rem;
    max-width: 980px;
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.form-card {
    display: grid;
    gap: 1rem;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: min(86vw, 320px);
    height: 100vh;
    padding: 1rem;
    display: grid;
    align-content: start;
    gap: 1rem;
    background: rgba(19, 52, 47, 0.96);
    color: #eff8f1;
    box-shadow: 24px 0 50px rgba(5, 15, 13, 0.26);
    transform: translateX(-102%);
    transition: transform 0.24s ease;
}

.sidebar.is-open {
    transform: translateX(0);
}

.sidebar-head,
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-head {
    justify-content: space-between;
}

.sidebar-profile p {
    color: rgba(239, 248, 241, 0.66);
}

.sidebar-nav {
    display: grid;
    gap: 0.35rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: rgba(239, 248, 241, 0.78);
}

.sidebar-nav i {
    width: 1.25rem;
    font-size: 1.1rem;
    text-align: center;
    flex: 0 0 auto;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-profile--footer {
    margin-top: auto;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-profile-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar-profile-copy strong,
.sidebar-profile-copy p {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-form {
    margin-left: auto;
}

.sidebar-close,
.sidebar-logout {
    background: rgba(255, 255, 255, 0.08);
    color: #eff8f1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.sidebar-close:hover,
.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.14);
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 15, 13, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 25;
}

.drawer-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.bottom-nav {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 0.8rem;
    z-index: 22;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
    padding: 0.55rem;
    border-radius: 26px;
    background: rgba(17, 48, 43, 0.92);
    box-shadow: 0 20px 36px rgba(6, 20, 18, 0.28);
}

.bottom-nav a,
.bottom-nav button {
    display: grid;
    place-items: center;
    gap: 0.18rem;
    min-height: 56px;
    border: none;
    border-radius: 18px;
    background: transparent;
    color: rgba(239, 248, 241, 0.76);
    cursor: pointer;
}

.bottom-nav i {
    font-size: 1.35rem;
    line-height: 1;
}

.bottom-nav a.active,
.bottom-nav button.active {
    background: rgba(166, 237, 72, 0.14);
    color: #fff;
}

.bottom-nav small {
    font-size: 0.68rem;
}

.badge,
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
}

.chip {
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(19, 52, 47, 0.08);
}

.badge--yes {
    background: rgba(120, 191, 31, 0.14);
    color: #366d12;
}

.badge--sometimes {
    background: rgba(239, 157, 47, 0.14);
    color: #8a5314;
}

.badge--no,
.badge--avoid {
    background: rgba(222, 90, 68, 0.14);
    color: #8b3022;
}

.table-list {
    display: grid;
    gap: 0.7rem;
}

.table-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.table-row p {
    color: var(--muted);
}

.table-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-end;
    color: var(--muted);
}

.milestone-grid {
    display: grid;
    gap: 0.8rem;
}

.milestone-card {
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(19, 52, 47, 0.06);
}

.milestone-card.is-complete {
    background: rgba(166, 237, 72, 0.18);
}

.recipe-detail {
    display: grid;
    gap: 1rem;
}

.recipe-hero img {
    border-radius: 30px;
    min-height: 240px;
    object-fit: cover;
}

.recipe-hero > .card:only-child {
    grid-column: 1 / -1;
}

.clean-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.65rem;
}

.clean-list--ordered {
    padding-left: 1.35rem;
}

.prose-card {
    display: grid;
    gap: 1rem;
}

.suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.suggestion-pill {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(19, 52, 47, 0.08);
    background: rgba(255, 255, 255, 0.66);
    cursor: pointer;
}

.card-copy {
    margin: 1rem 0;
    color: var(--muted);
}

.is-hidden {
    display: none !important;
}

@media (min-width: 760px) {
    .guest-header,
    .topbar,
    .guest-main,
    .app-main,
    .guest-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .hero-landing,
    .hero-card,
    .auth-shell {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: stretch;
    }

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

    .grid--cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .grid--split,
    .recipe-hero {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .field-span-2 {
        grid-column: span 2;
    }

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

    .recipe-grid--list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .table-metrics {
        flex-direction: row;
    }
}

@media (min-width: 1100px) {
    .app-shell {
        padding-left: 300px;
        padding-bottom: 2rem;
    }

    .sidebar {
        transform: translateX(0);
    }

    .drawer-backdrop,
    .bottom-nav {
        display: none;
    }
}
