:root {
    --ink: #243e35; --muted: #6a7c72; --green: #315e49; --green-dark: #214532;
    --paper: #f8faf6; --line: #e0e8dd; --sage: #e8efe3; --white: #fff; --danger: #a33f36;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Segoe UI", system-ui, sans-serif; font-size: 15px; caret-color: transparent; }
input, textarea, :read-write { caret-color: auto; }
a { color: var(--green); text-underline-offset: 4px; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .55; cursor: wait; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 3px solid #87ac65; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.035em; }
h1 { font-size: clamp(2.7rem, 5vw, 4.3rem); line-height: 1.06; margin-bottom: 20px; }
h2 { font-size: 1.9rem; line-height: 1.2; margin-bottom: 12px; }
h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; }
p { line-height: 1.65; }
h1:focus { outline: none; }
.app-header { max-width: 1320px; margin: auto; min-height: 90px; display: flex; justify-content: space-between; align-items: center; padding: 20px 48px; border-bottom: 1px solid var(--line); gap: 20px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-size: 25px; font-weight: 650; letter-spacing: -1px; color: var(--ink); }
.brand-mark { display: inline-flex; height: 36px; width: 36px; border-radius: 11px; justify-content: center; align-items: center; background: var(--green); color: white; font-family: Georgia, serif; font-size: 28px; letter-spacing: -3px; padding-right: 4px; }
.brand-dot { color: #8ba269; }
.app-header nav { display: flex; align-items: center; gap: 25px; }
.app-header nav > a:not(.button), .text-button { text-decoration: none; color: var(--muted); font-size: .92rem; }
.app-header nav > a.active { color: var(--green); font-weight: 650; }
.app-main { max-width: 1224px; min-height: calc(100vh - 190px); padding: 44px 48px 70px; margin: auto; }
.app-footer { max-width: 1224px; margin: auto; padding: 25px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; display: flex; justify-content: space-between; gap: 12px; }
.button { border-radius: 9px; border: 1px solid transparent; padding: 12px 21px; font-weight: 600; font-size: .94rem; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: background .15s, box-shadow .15s; min-height: 46px; }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); color: white; }
.secondary { background: white; color: var(--green); border-color: #cbd8c5; }
.secondary:hover { background: var(--sage); }
.small { padding: 8px 17px; min-height: 38px; }
.full { width: 100%; }
.text-button { background: transparent; border: none; padding: 8px 0; color: var(--green); }
.text-button:hover { text-decoration: underline; }
.danger, .danger-text { color: var(--danger); }
.danger-button { border: 1px solid #e5b8b1; background: #fff4f1; color: var(--danger); }
.surface { background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 4px 18px #24412c04; }
.eyebrow { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .15em; color: #668458; font-weight: 700; margin-bottom: 20px; }
.muted { color: var(--muted); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 26px; }
.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-actions .button { white-space: nowrap; }
.item-dialog { width: min(480px, calc(100% - 36px)); max-height: calc(100dvh - 36px); overflow-y: auto; padding: 30px; color: var(--ink); }
.item-dialog::backdrop { background: #243e3580; }
.item-dialog h2 { overflow-wrap: anywhere; }
.page-heading h1 { font-size: 3.4rem; margin-bottom: 12px; }
.page-heading .eyebrow { margin-bottom: 14px; }
.page-heading p { margin-bottom: 0; }
.notice { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; line-height: 1.55; font-size: .92rem; overflow-wrap: anywhere; }
.notice.error { background: #fff1ed; border: 1px solid #efd0c7; color: #8f3d32; }
.notice.success { background: #edf5e9; border: 1px solid #d5e6cb; color: #345c37; }
.notice.warning { background: #fcf6e8; border: 1px solid #eee0bb; color: #7f6530; }
label { display: block; margin: 20px 0 8px; font-size: .9rem; font-weight: 600; }
input { width: 100%; border: 1px solid #d7e0d3; background: #fff; border-radius: 9px; padding: 12px 14px; min-height: 46px; color: var(--ink); }
input::placeholder { color: #95a093; }
input:focus { border-color: #79986a; }
.field-help { color: var(--muted); font-size: .82rem; line-height: 1.55; margin: 9px 0 16px; }
form > .button.full { margin-top: 24px; }
.optional { font-weight: 400; color: var(--muted); }
.welcome-hero { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 70px; padding: 35px 0 60px; }
.welcome-hero p { max-width: 460px; font-size: 1.1rem; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; }
.hero-note { display: block; font-size: .8rem; color: var(--muted); margin-top: 18px; }
.hero-fridge { position: relative; background: #e7eddf; border: 1px solid #d7e0cd; width: 290px; height: 370px; border-radius: 32px; margin: 0 auto; box-shadow: 22px 20px 0 #eef2e9; overflow: hidden; transform: rotate(3deg); }
.hero-fridge > span { font-family: Georgia, serif; font-size: 2.3rem; line-height: 1; position: absolute; top: 40px; left: 32px; color: #728b58; }
.fridge-handle { position: absolute; width: 7px; height: 65px; border-radius: 5px; right: 21px; top: 60px; background: #a8b89b; }
.fridge-shelf { display: flex; gap: 16px; padding: 0 25px 12px; align-items: end; border-bottom: 4px solid #aaba98; position: absolute; width: 100%; bottom: 100px; }
.fridge-shelf i { display: block; height: 70px; width: 45px; border-radius: 10px 10px 4px 4px; background: #faf8ea; border-top: 9px solid #849875; }
.fridge-shelf i:nth-child(2) { background: #a5b981; width: 60px; height: 60px; border-top-color: #637a4d; }
.fridge-shelf i:nth-child(3) { background: #e1aa71; border-top-color: #c28049; height: 52px; }
.fridge-shelf.second { bottom: 20px; }.fridge-shelf.second i { height: 50px; width: 80px; background: #d0d9b8; border-top-color: #8b9d70; }
.feature-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.feature-grid article { padding: 28px; }.feature-grid p { margin: 0; color: var(--muted); font-size: .94rem; }
.feature-number { display: block; font-size: .72rem; color: #85996f; letter-spacing: .12em; margin-bottom: 22px; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 75px; align-items: start; max-width: 1050px; margin: 18px auto; }
.auth-story { padding-top: 18px; }.auth-story > p { color: var(--muted); font-size: 1.05rem; max-width: 400px; }
.story-card { display: flex; gap: 16px; margin-top: 25px; }.story-card p { font-size: .87rem; color: var(--muted); margin: 6px 0 0; }.story-icon { background: var(--sage); color: #738957; height: 38px; min-width: 38px; display: grid; place-items: center; border-radius: 12px; font-size: .8rem; }
.auth-panel { padding: 34px; }.auth-panel .eyebrow { margin-bottom: 15px; }.auth-panel h1 { font-size: 2.15rem; }
.auth-links { text-align: center; font-size: .88rem; padding-top: 23px; display: grid; gap: 10px; }.auth-links p { margin: 0; }
.fresh-illustration { position: relative; height: 160px; margin-top: 24px; overflow: hidden; }.fresh-illustration > span { position: absolute; font-family: Georgia, serif; font-style: italic; color: #91a77e; font-size: 1.6rem; bottom: 0; right: 30px; }
.illustration-jar { position: absolute; bottom: 20px; left: 45px; width: 66px; height: 95px; background: #dce6cd; border-radius: 15px 15px 8px 8px; border-top: 12px solid #7e9966; transform: rotate(-8deg); }
.illustration-orange { position: absolute; bottom: 22px; left: 145px; height: 70px; width: 75px; border-radius: 50%; background: #e5b37c; }.illustration-leaf { position: absolute; bottom: 63px; left: 160px; width: 37px; height: 65px; border-radius: 50% 0 50% 0; background: #9ab67d; transform: rotate(35deg); z-index: 1; }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin: 28px 0; }.stat { display: flex; justify-content: space-between; align-items: center; background: #eef3e9; border: 1px solid #dfe8d5; padding: 22px 26px; border-radius: 14px; }.stat span { color: var(--muted); font-size: .9rem; }.stat strong { font-size: 2rem; font-weight: 500; }.stat.attention { background: #fbf5e8; border-color: #ece1c6; }
.inventory-toolbar { display: flex; justify-content: space-between; gap: 20px; margin: 25px 0; }.segmented { display: flex; border-radius: 10px; padding: 4px; background: #eaf0e5; }.segmented button { border: 0; border-radius: 7px; padding: 9px 18px; color: var(--muted); background: transparent; font-size: .88rem; white-space: nowrap; }.segmented .selected { background: white; color: var(--green); box-shadow: 0 1px 4px #234b2520; font-weight: 600; }.search-input { max-width: 300px; }
.item-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }.item-card { padding: 25px; }.item-card.highlight { outline: 3px solid #9cb486; }.item-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 20px; }.item-monogram { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; background: var(--sage); font-family: Georgia, serif; font-size: 1.6rem; color: #70865b; }.item-date { font-size: .85rem; color: var(--muted); }.status-pill { display: inline-flex; padding: 5px 10px; border-radius: 25px; font-size: .72rem; font-weight: 650; white-space: nowrap; }.fresh { color: #567544; background: #edf3e5; }.soon { color: #927332; background: #faf2dd; }.warning { color: #927332; background: #faf2dd; }.expired { color: #a3574c; background: #fbebe5; }
.item-details { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; font-size: .79rem; color: var(--muted); margin: 20px 0; }.item-details dt { font-weight: 500; }.item-details dd { margin: 0; overflow-wrap: anywhere; text-align: right; }.item-actions { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; gap: 8px; }
.item-actions { flex-wrap: wrap; }
.item-dates { margin-bottom: 18px; }.item-dates .item-date { margin-bottom: 5px; }
.item-dialog > .button + .button { margin-top: 12px; }
.empty-state { text-align: center; padding: 60px 24px; color: var(--muted); }.empty-state h2 { color: var(--ink); }.empty-icon { width: 65px; height: 65px; background: var(--sage); color: #83986d; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; margin: 0 auto 22px; }
.back-link { display: inline-block; margin-bottom: 25px; font-size: .85rem; text-decoration: none; color: var(--muted); }
.add-grid { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 32px; max-width: 950px; }
.steps { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.step { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: #ffffff80; }
.step-number { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1px solid #cbd8c5; border-radius: 50%; font-size: .85rem; font-weight: 650; background: white; }
.step.active { color: var(--green-dark); border-color: #9eb592; background: var(--sage); box-shadow: 0 2px 8px #24412c08; }
.step.active .step-number { background: var(--green); color: white; border-color: var(--green); }
.step.complete .step-number { color: var(--green); background: var(--sage); }
.step strong { font-size: .9rem; }.step p { font-size: .78rem; margin: 4px 0 0; }
.scan-tip { background: #eff3e9; padding: 20px; border-radius: 12px; font-size: .83rem; margin-top: 24px; color: var(--muted); }.scan-tip p { margin: 8px 0 0; }
.add-panel { padding: 35px; }.camera-area { height: 200px; border: 1px dashed #cad8bf; border-radius: 12px; background: #f6f8f1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; margin: 20px 0; color: var(--muted); font-size: .85rem; overflow: hidden; }.camera-area video { width: 100%; height: 100%; object-fit: cover; }.barcode-art { width: 90px; height: 45px; background: repeating-linear-gradient(90deg,#738963 0 2px,transparent 2px 5px,#738963 5px 9px,transparent 9px 12px,#738963 12px 13px,transparent 13px 17px); }
.form-actions { display: flex; justify-content: space-between; gap: 15px; margin-top: 28px; }.item-summary { display: grid; gap: 5px; background: #f2f6ed; padding: 20px; border-radius: 10px; margin-top: 25px; }.item-summary span { font-size: .85rem; color: var(--muted); }
.barcode-illustration { display: grid; place-items: center; padding: 28px; margin: 22px 0; border-radius: 16px; background: #f2f6ed; }
.barcode-illustration .barcode-art { width: 112px; height: 56px; }
.camera-area[hidden] { display: none; }
.scan-actions { display: grid; gap: 12px; }
.add-panel .button { border-radius: 12px; min-height: 50px; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }.account-card { padding: 30px; }.account-card > .eyebrow { margin-bottom: 14px; }.account-email { font-size: 1.2rem; overflow-wrap: anywhere; }.account-card .status-pill { margin: 5px 0 16px; }.account-card hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }.account-card form > button { margin-top: 20px; }.totp-qr { margin: 15px 0; background: white; max-width: 210px; }.totp-qr svg { display: block; width: 100%; height: auto; }.setup-secret { display: block; padding: 12px; background: var(--sage); word-break: break-all; margin-top: 12px; }.account-card details { font-size: .9rem; margin-bottom: 20px; }
#blazor-error-ui { background: #fff1ed; border-top: 1px solid #d9b6ac; bottom: 0; display: none; left: 0; padding: 14px 25px; position: fixed; width: 100%; z-index: 1000; } #blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 20px; }
.loading-progress { position: absolute; width: 90px; height: 90px; inset: 25vh 0 auto; margin: auto; }.loading-progress circle { fill: none; stroke: #dce7d4; stroke-width: 5px; }.loading-progress circle:last-child { stroke: var(--green); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%; }.loading-progress-text { position: absolute; text-align: center; inset: calc(25vh + 105px) 0 auto; color: var(--muted); }.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Getting things fresh..."); }
@media (max-width: 1000px) {
    .app-main { padding: 35px 28px 50px; }.app-header { padding: 18px 28px; }.app-footer { padding: 22px 28px; }
    .auth-grid { gap: 35px; }.item-grid { grid-template-columns: repeat(2,1fr); }.welcome-hero { gap: 30px; }.hero-fridge { width: 250px; height: 335px; }.add-grid { gap: 25px; grid-template-columns: 220px 1fr; }
}
@media (max-width: 680px) {
    .app-header { padding: 18px; min-height: 74px; flex-wrap: wrap; }.brand { font-size: 22px; }.app-header nav { gap: 15px; }.app-header nav .small { padding: 7px 11px; }.app-main { padding: 30px 18px 45px; }.app-footer { padding: 22px 18px; flex-direction: column; }
    .auth-grid, .welcome-hero, .account-grid, .add-grid { grid-template-columns: 1fr; }.auth-story { display: none; }.auth-panel, .account-card, .add-panel { padding: 25px; }.auth-grid { margin: 0; }
    .welcome-hero { padding: 15px 0 35px; }.hero-fridge { display: none; }.feature-grid { grid-template-columns: 1fr; }.feature-grid article { padding: 24px; }.feature-number { margin-bottom: 12px; }
    .page-heading { align-items: start; flex-direction: column; gap: 18px; }.page-heading h1 { font-size: 2.8rem; }.stats-grid { gap: 8px; }.stat { flex-direction: column; align-items: start; padding: 15px; gap: 7px; }.stat span { font-size: .75rem; }.stat strong { font-size: 1.6rem; }
    .inventory-toolbar { flex-direction: column; gap: 12px; }.search-input { max-width: none; }.segmented button { flex: 1; }.item-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }.step { flex-direction: column; gap: 8px; padding: 12px 6px; text-align: center; }.step strong { font-size: .76rem; }.step p, .scan-tip { display: none; }.add-grid { gap: 20px; }.hero-actions { flex-wrap: wrap; }
    .add-panel .form-actions { flex-wrap: wrap; gap: 10px; }.add-panel .form-actions .button { flex: 1 1 130px; }
}
