:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #20231f;
    background: #f1f3ee;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at top left, rgba(170, 206, 163, 0.35), transparent 34rem),
        #f1f3ee;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: #335e3f;
}

.page-shell {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 72px;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #5f6d60;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.hero-title:focus {
    outline: none;
}

h2 {
    margin-bottom: 18px;
    font-size: 1.35rem;
}

h3 {
    margin-bottom: 6px;
}

.hero-copy {
    max-width: 620px;
    margin-bottom: 0;
    color: #596059;
    font-size: 1.04rem;
}

.hero-count {
    min-width: 112px;
    padding: 16px 18px;
    border: 1px solid #d8ddd4;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    text-align: center;
    box-shadow: 0 8px 30px rgba(43, 54, 42, 0.05);
}

.hero-count strong,
.hero-count span {
    display: block;
}

.hero-count strong {
    font-size: 1.8rem;
}

.hero-count span {
    color: #687168;
    font-size: 0.82rem;
}

.panel {
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid #dce0d8;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 44px rgba(45, 55, 45, 0.06);
    backdrop-filter: blur(12px);
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px auto;
    gap: 14px;
    align-items: end;
}

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

.field label {
    color: #525b52;
    font-size: 0.86rem;
    font-weight: 700;
}

.text-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cfd6cb;
    border-radius: 12px;
    background: #fff;
    color: #20231f;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.text-input:focus {
    border-color: #63856a;
    box-shadow: 0 0 0 3px rgba(99, 133, 106, 0.14);
}

.validation-message {
    color: #a33a35;
    font-size: 0.78rem;
}

.form-actions,
.item-actions {
    display: flex;
    gap: 8px;
}

.button,
.icon-button {
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
}

.button {
    padding: 0 16px;
}

.button-primary {
    background: #335e3f;
    color: #fff;
}

.button-primary:hover {
    background: #284e33;
}

.button-secondary {
    background: #e9ede6;
    color: #354036;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-heading h2 {
    margin-bottom: 0;
}

.item-list {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.fridge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px;
    border: 1px solid #e1e5de;
    border-radius: 16px;
    background: #fff;
}

.item-main {
    min-width: 0;
}

.item-main h3 {
    overflow-wrap: anywhere;
    font-size: 1.03rem;
}

.expiry-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #687168;
    font-size: 0.86rem;
}

.expiry-badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 750;
}

.expiry-expired {
    background: #f9d9d5;
    color: #8f2d28;
}

.expiry-today {
    background: #f9e5bd;
    color: #80541a;
}

.expiry-soon {
    background: #f4edcf;
    color: #6e5b21;
}

.expiry-ok {
    background: #dfeee0;
    color: #335e3f;
}

.icon-button {
    padding: 0 12px;
    background: #edf0eb;
    color: #3d493e;
}

.icon-button:hover {
    background: #e2e7df;
}

.icon-button.danger {
    background: #f8e9e7;
    color: #913a34;
}

.empty-state {
    padding: 34px 12px;
    text-align: center;
    color: #687168;
}

.empty-state h1,
.empty-state h3 {
    color: #2a302a;
}

.empty-icon {
    margin-bottom: 10px;
    font-size: 2.2rem;
}

.muted,
.boot-screen {
    color: #687168;
}

.boot-screen {
    padding: 48px;
    text-align: center;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
    padding: 14px 16px;
    border-radius: 12px;
    background: #ffe2de;
    color: #6e201b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

#blazor-error-ui .dismiss {
    float: right;
    cursor: pointer;
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 20px, 980px);
        padding-top: 28px;
    }

    .hero {
        align-items: flex-start;
    }

    .hero-count {
        min-width: 92px;
    }

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

    .form-actions {
        margin-top: 2px;
    }
}

@media (max-width: 560px) {
    .hero {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .hero-copy {
        grid-column: 1 / -1;
    }

    .panel {
        padding: 18px;
        border-radius: 18px;
    }

    .fridge-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .item-actions {
        width: 100%;
    }

    .icon-button {
        flex: 1;
    }
}
