:root {
    --bg: #f6efe5;
    --bg-accent: radial-gradient(circle at top left, rgba(225, 123, 72, 0.25), transparent 36%),
        radial-gradient(circle at top right, rgba(84, 120, 91, 0.18), transparent 28%),
        linear-gradient(180deg, #f9f3ea 0%, #f3eadf 100%);
    --panel: rgba(255, 251, 247, 0.92);
    --panel-strong: rgba(255, 248, 241, 0.98);
    --border: rgba(117, 84, 57, 0.16);
    --text: #2f241e;
    --muted: #6d5b4e;
    --accent: #e94b13;
    --accent-deep: #a72a0a;
    --accent-soft: rgba(233, 75, 19, 0.12);
    --sage: #5f7b63;
    --sage-soft: rgba(95, 123, 99, 0.14);
    --shadow: 0 20px 55px rgba(81, 51, 31, 0.12);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background: var(--bg-accent);
}

html {
    scroll-behavior: smooth;
}

body.store-mode-open,
body.chef-mode-open {
    overflow: hidden;
}

button,
textarea,
input {
    font: inherit;
}

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

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.home-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(255, 251, 247, 0.82);
    color: var(--accent-deep);
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(81, 51, 31, 0.08);
}

.home-link:hover {
    color: var(--accent);
}

.nav-auth-status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    max-width: min(520px, 100%);
    border: 1px solid rgba(95, 123, 99, 0.2);
    border-radius: 999px;
    padding: 7px 8px 7px 10px;
    background: rgba(255, 251, 247, 0.88);
    box-shadow: 0 8px 18px rgba(81, 51, 31, 0.08);
}

.signed-in-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--sage);
    color: #fff;
    font-weight: 900;
}

.nav-user-email {
    min-width: 0;
    max-width: 28ch;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-signout-button {
    flex: 0 0 auto;
    min-height: 32px;
    border: 0;
    border-radius: 999px;
    padding: 6px 11px;
    background: var(--sage-soft);
    color: var(--sage);
    cursor: pointer;
    font-weight: 900;
}

.nav-signout-button:hover {
    background: rgba(95, 123, 99, 0.22);
}

.hero {
    margin-bottom: 24px;
}

.hero-copy,
.panel {
    backdrop-filter: blur(8px);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hero-copy {
    border-radius: var(--radius-lg);
    padding: 24px 34px 28px;
}

.hero-copy h1 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: clamp(2.2rem, 4vw, 4rem);
    line-height: 0.98;
    max-width: 12ch;
}

.hero-logo {
    display: block;
    width: min(100%, 920px);
    height: auto;
    margin: 0 auto 22px;
}

.eyebrow,
.section-label {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 700;
}

.eyebrow,
.section-label {
    color: var(--accent);
}

.quick-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.quick-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    border: 1px solid rgba(95, 123, 99, 0.16);
    border-radius: 16px;
    padding: 13px 15px;
    background: var(--panel-strong);
    color: var(--text);
    font-weight: 900;
    line-height: 1.2;
    text-decoration: none;
}

.quick-nav a::after {
    content: "↓";
    flex: 0 0 auto;
    color: var(--sage);
    font-size: 1rem;
    font-weight: 900;
}

.quick-nav a:hover {
    border-color: rgba(95, 123, 99, 0.34);
    color: var(--accent-deep);
}

.workspace {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.panel {
    border-radius: var(--radius-lg);
    padding: 24px;
}

.panel-status {
    background: linear-gradient(180deg, rgba(49, 38, 31, 0.96) 0%, rgba(34, 27, 22, 0.96) 100%);
    color: #f6eee7;
}

.panel-status-bottom {
    margin-top: 22px;
}

.panel-status .section-label,
.panel-status h2,
.panel-status .status-summary {
    color: inherit;
}

.panel-heading {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin: 4px 0 0;
    font-family: "Fraunces", serif;
    font-size: 1.6rem;
    line-height: 1.1;
}

.field-label {
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 0.95rem;
}

.text-input {
    width: 100%;
    border: 1px solid rgba(90, 69, 54, 0.16);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
}

.text-input:focus {
    outline: 2px solid rgba(197, 91, 44, 0.18);
    border-color: rgba(197, 91, 44, 0.34);
}

.auth-panel {
    margin-bottom: 24px;
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(140px, 0.35fr) minmax(0, 1fr);
    gap: 12px 14px;
    align-items: center;
}

.auth-actions,
.auth-signed-in {
    display: flex;
    gap: 10px;
    align-items: center;
}

.auth-actions {
    grid-column: 2;
}

.auth-signed-in {
    justify-content: space-between;
}

.auth-signed-in span {
    font-weight: 800;
    overflow-wrap: anywhere;
}

.text-area {
    width: 100%;
    border: 1px solid rgba(90, 69, 54, 0.16);
    border-radius: 18px;
    padding: 16px 18px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.text-area:focus,
.ingredient-input:focus {
    outline: 2px solid rgba(197, 91, 44, 0.18);
    border-color: rgba(197, 91, 44, 0.34);
}

.helper-row,
.groups-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.helper-row p,
.groups-meta {
    margin: 0;
}

.button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.button-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #fff9f5;
    box-shadow: 0 12px 24px rgba(167, 42, 10, 0.22);
}

.button-secondary {
    background: var(--sage-soft);
    color: #27412b;
}

.button-ghost {
    background: transparent;
    color: var(--accent-deep);
    border: 1px solid rgba(233, 75, 19, 0.18);
    padding: 8px 12px;
}

.button-danger {
    background: rgba(144, 45, 31, 0.1);
    color: #7d2117;
    border: 1px solid rgba(144, 45, 31, 0.18);
    padding: 8px 12px;
}

.shopping-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    background: rgba(47, 36, 30, 0.08);
    color: var(--text);
}

.badge-muted {
    background: rgba(255, 255, 255, 0.12);
    color: #fff0e7;
}

.badge-success {
    background: rgba(118, 193, 146, 0.18);
    color: #bbf1cd;
}

.badge-warning {
    background: rgba(255, 211, 127, 0.18);
    color: #ffe5a7;
}

.badge-error {
    background: rgba(255, 142, 142, 0.18);
    color: #ffc8c8;
}

.status-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.status-toggle-button {
    display: none;
    min-height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff0e7;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 800;
}

.status-summary {
    margin-bottom: 14px;
    color: #dfd3ca;
}

.status-log {
    margin: 0;
    min-height: 148px;
    max-height: 220px;
    overflow: auto;
    padding: 16px;
    border-radius: 18px;
    background: rgba(14, 11, 9, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #bdf7ce;
    line-height: 1.55;
    font-family: "Consolas", "SFMono-Regular", monospace;
    white-space: pre-wrap;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    margin-top: 16px;
}

.calendar-day {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 46px;
    border: 1px solid rgba(95, 123, 99, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
}

.calendar-day-planned {
    border-color: rgba(95, 123, 99, 0.34);
    background: rgba(95, 123, 99, 0.12);
    color: var(--text);
}

.calendar-day-letter {
    font-weight: 900;
    line-height: 1;
}

.calendar-day-marker {
    position: absolute;
    bottom: 6px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--sage);
}

.calendar-day-count {
    position: absolute;
    top: 4px;
    right: 5px;
    min-width: 15px;
    min-height: 15px;
    border-radius: 999px;
    background: var(--sage);
    color: #fff;
    font-size: 0.64rem;
    font-weight: 900;
    line-height: 15px;
    text-align: center;
}

.planner-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-top: 20px;
}

.planner-heading h3 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: 1.25rem;
}

.planner-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.planner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: none;
}

.planner-actions-bottom {
    margin-top: 14px;
    justify-content: flex-end;
}

.library-header-actions,
.library-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.library-add-menu {
    position: relative;
}

.library-add-choices {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 5;
    display: grid;
    min-width: 190px;
    gap: 8px;
    border: 1px solid rgba(90, 69, 54, 0.14);
    border-radius: 16px;
    background: rgba(255, 252, 247, 0.98);
    box-shadow: 0 16px 34px rgba(62, 43, 31, 0.16);
    padding: 8px;
}

.library-add-choices[hidden],
.library-tools[hidden] {
    display: none;
}

.library-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 190px) minmax(160px, 210px);
    margin-top: 14px;
}

.recipe-create-form {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    padding: 14px;
}

.recipe-create-grid {
    display: grid;
    gap: 10px;
}

.recipe-import-destination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.recipe-import-destination .field-label {
    align-self: end;
}

.recipe-plan-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.weekly-day-card {
    border: 1px solid rgba(90, 69, 54, 0.13);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    padding: 12px;
}

.weekly-day-header,
.weekly-recipe-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.weekly-day-header h4 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: 1.06rem;
}

.weekly-day-empty {
    margin: 8px 0 10px;
    color: var(--muted);
    font-size: 0.88rem;
}

.weekly-recipe-item {
    margin-top: 10px;
    border-top: 1px solid rgba(90, 69, 54, 0.09);
    padding-top: 10px;
}

.weekly-recipe-name {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.weekly-recipe-name strong {
    overflow-wrap: anywhere;
}

.weekly-recipe-name span {
    color: var(--muted);
    font-size: 0.78rem;
}

.weekly-recipe-name .scale-picker {
    margin-top: 4px;
}

.weekly-recipe-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(80px, 1fr));
    gap: 7px;
    min-width: 178px;
}

.weekly-recipe-actions .button {
    min-height: 36px;
    padding: 8px 10px;
}

.weekly-picker {
    display: grid;
    gap: 9px;
    margin-top: 12px;
    border-top: 1px solid rgba(90, 69, 54, 0.09);
    padding-top: 12px;
}

.weekly-picker-list {
    display: grid;
    gap: 7px;
}

.weekly-picker-option {
    width: 100%;
    border: 1px solid rgba(90, 69, 54, 0.13);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 10px 12px;
    text-align: left;
}

.weekly-picker-option:hover {
    border-color: rgba(95, 123, 99, 0.3);
    background: rgba(95, 123, 99, 0.08);
}

.weekly-picker-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.recipe-plan-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(90, 69, 54, 0.13);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    padding: 10px;
}

.recipe-plan-row-editing {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.recipe-plan-row-selected {
    border-color: rgba(95, 123, 99, 0.42);
    background: rgba(95, 123, 99, 0.08);
}

.recipe-plan-row-compact {
    grid-template-columns: minmax(0, 1fr) 180px;
}

.recipe-link-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.recipe-link-text a,
.recipe-title-button {
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-align: left;
    text-decoration: none;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.recipe-link-text span {
    color: var(--muted);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recipe-link-text .recipe-import-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    color: var(--muted);
    font-size: 0.72rem;
}

.import-quality {
    display: inline-flex;
    align-items: center;
    overflow: visible;
    min-height: 22px;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 900;
    text-overflow: clip;
    white-space: nowrap;
}

.import-quality-low {
    background: rgba(255, 211, 127, 0.22);
    color: #76501a;
}

.recipe-row-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}

.recipe-action-buttons {
    display: grid;
    gap: 7px;
}

.recipe-scale-field {
    display: grid;
    gap: 5px;
}

.recipe-rating-field {
    display: grid;
    gap: 6px;
}

.rating-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.rating-choice {
    min-height: 34px;
    padding: 7px 6px;
}

.rating-choice-active {
    border-color: rgba(197, 91, 44, 0.42);
    background: rgba(197, 91, 44, 0.13);
    color: var(--rust-dark);
}

.rating-clear {
    min-height: 32px;
}

.scale-picker {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.scale-picker-toggle {
    width: 100%;
}

.scale-picker-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.scale-picker-options[hidden] {
    display: none;
}

.scale-choice {
    min-height: 34px;
    padding: 7px 8px;
}

.scale-choice-active {
    border-color: rgba(95, 123, 99, 0.42);
    background: rgba(95, 123, 99, 0.16);
    color: var(--green);
}

.recipe-detail-actions .scale-picker,
.chef-mode-header-actions .scale-picker {
    width: auto;
}

.recipe-row-actions .button {
    width: 100%;
    min-height: 34px;
    padding: 8px 10px;
}

.recipe-edit-form {
    display: grid;
    gap: 10px;
}

.recipe-edit-ingredients {
    min-height: 180px;
}

.recipe-edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.recipe-detail {
    margin-top: 14px;
    border: 1px solid rgba(90, 69, 54, 0.13);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    padding: 14px;
}

.recipe-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.recipe-detail-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.recipe-detail-header h3 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: 1.22rem;
}

.recipe-detail-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.shared-recipe-panel {
    border-color: rgba(95, 123, 99, 0.26);
    background: rgba(255, 255, 255, 0.86);
}

.shared-recipe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.shared-recipe-meta {
    margin: 0 0 14px;
    color: var(--muted);
    font-weight: 800;
}

.recipe-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.recipe-detail-card {
    min-width: 0;
    border: 1px solid rgba(90, 69, 54, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 12px;
}

.recipe-detail-card h4 {
    margin: 0 0 8px;
    font-size: 0.92rem;
}

.recipe-detail-card p,
.recipe-detail-card li,
.recipe-detail-card a {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.recipe-detail-card p,
.recipe-detail-card ul,
.recipe-detail-card ol {
    margin: 0;
}

.recipe-detail-card ul,
.recipe-detail-card ol {
    padding-left: 18px;
}

.day-select {
    width: 100%;
    border: 1px solid rgba(90, 69, 54, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
    font-weight: 700;
}

.day-select:focus {
    outline: 2px solid rgba(95, 123, 99, 0.2);
    border-color: rgba(95, 123, 99, 0.34);
}

.planner-empty {
    border: 1px dashed rgba(117, 84, 57, 0.24);
    border-radius: 16px;
    color: var(--muted);
    padding: 16px;
    line-height: 1.5;
}

.group-card,
.empty-state {
    min-width: 0;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.76);
    padding: 18px;
}

.group-card h3 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: 1.28rem;
}

.group-meta {
    margin: 6px 0 16px;
    color: var(--muted);
    font-size: 0.9rem;
}

.ingredient-list {
    display: grid;
    gap: 10px;
}

.ingredient-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ingredient-input {
    min-width: 0;
    width: 100%;
    border: 1px solid rgba(90, 69, 54, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    padding: 11px 12px;
    color: var(--text);
}

.remove-button {
    width: auto;
    white-space: nowrap;
}

.empty-state {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    background: linear-gradient(180deg, rgba(255, 248, 242, 0.9) 0%, rgba(249, 241, 233, 0.85) 100%);
}

.empty-state h3 {
    margin: 0 0 10px;
    font-family: "Fraunces", serif;
    font-size: 1.5rem;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    max-width: 42ch;
    line-height: 1.6;
}

.store-mode {
    position: fixed;
    inset: 0;
    z-index: 50;
    overflow: auto;
    background: #fbf8f3;
    color: var(--text);
}

.chef-mode {
    position: fixed;
    inset: 0;
    z-index: 60;
    overflow: auto;
    background: #fbf8f3;
    color: var(--text);
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.chef-mode[hidden] {
    display: none;
}

.chef-mode-shell {
    width: min(100%, 1060px);
    min-height: calc(100vh - 36px);
    margin: 0 auto;
    border-radius: var(--radius-lg);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    padding: 22px;
}

.chef-mode-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 248, 241, 0.98);
    box-shadow: 0 12px 24px rgba(81, 51, 31, 0.1);
    margin-bottom: 14px;
    padding: 14px;
}

.chef-mode-header h2 {
    margin: 5px 0 0;
    font-family: "Fraunces", serif;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.chef-mode-meta {
    margin: 6px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.chef-mode-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chef-tips {
    border: 1px solid rgba(197, 91, 44, 0.16);
    border-radius: 14px;
    background: rgba(255, 247, 238, 0.82);
    padding: 12px;
    margin-bottom: 14px;
}

.chef-tips h3,
.chef-ingredients h3 {
    margin: 0 0 8px;
    font-family: "Fraunces", serif;
    font-size: 1.05rem;
}

.chef-tips p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.chef-mode-layout {
    display: grid;
    grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.chef-ingredients {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    padding: 12px;
}

.chef-ingredients ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 18px;
}

.chef-ingredients li {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.chef-steps {
    display: grid;
    gap: 10px;
}

.chef-step {
    border: 1px solid rgba(90, 69, 54, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    padding: 0;
    overflow: hidden;
}

.chef-step summary {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    list-style: none;
}

.chef-step summary::-webkit-details-marker {
    display: none;
}

.chef-step-label {
    color: var(--accent-deep);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.chef-step-preview {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chef-step[open] summary {
    border-bottom: 1px solid rgba(90, 69, 54, 0.1);
}

.chef-step-text {
    margin: 0;
    padding: 12px 12px 8px;
    color: var(--text);
    line-height: 1.55;
}

.chef-note-input {
    min-height: 96px;
    margin: 0 12px 12px;
    width: calc(100% - 24px);
}

.chef-step .field-label {
    display: block;
    margin: 0 12px 6px;
}

.chef-step-editor {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    padding: 12px;
}

.chef-empty {
    border: 1px dashed rgba(117, 84, 57, 0.24);
    border-radius: 14px;
    color: var(--muted);
    padding: 16px;
    line-height: 1.45;
}

.store-mode[hidden] {
    display: none;
}

.store-mode-shell {
    width: min(900px, calc(100% - 24px));
    margin: 0 auto;
    padding: 12px 0 24px;
}

.store-mode-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 10px;
    padding: 10px 0;
    background: #fbf8f3;
    border-bottom: 1px solid var(--border);
}

.store-mode-header h2 {
    margin: 3px 0 0;
    font-family: "Fraunces", serif;
    font-size: 1.75rem;
    line-height: 1;
}

.store-mode-progress {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.store-mode-progress-bar {
    width: min(360px, 100%);
    height: 8px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(90, 69, 54, 0.12);
}

.store-mode-progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--sage);
    transition: width 180ms ease;
}

.store-mode-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.store-mode-header-actions .button {
    width: auto;
}

.store-extra-form {
    display: grid;
    gap: 7px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    padding: 10px;
}

.store-extra-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.store-extra-row .store-extra-input {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: block;
    height: 46px;
    min-height: 0;
    font-size: 16px;
    line-height: 24px;
    overflow: hidden;
    padding: 10px 14px;
    resize: none;
    vertical-align: top;
}

.store-staples {
    display: grid;
    gap: 7px;
}

.store-staples[hidden] {
    display: none;
}

.store-staples-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.store-staples-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.store-staple-button {
    border: 1px solid rgba(90, 69, 54, 0.14);
    border-radius: 999px;
    background: rgba(95, 123, 99, 0.1);
    color: #27412b;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    min-height: 32px;
    padding: 5px 10px;
}

.store-staple-button:hover {
    border-color: rgba(95, 123, 99, 0.32);
    background: rgba(95, 123, 99, 0.16);
}

.store-mode-list {
    display: grid;
    gap: 9px;
}

.store-mode-empty {
    border: 1px dashed var(--border);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.62);
    padding: 18px;
    line-height: 1.5;
}

.store-mode-section {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    padding: 10px;
}

.store-mode-section h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 7px;
    font-family: "Fraunces", serif;
    font-size: 1.02rem;
}

.store-mode-section-count {
    border-radius: 999px;
    background: var(--sage-soft);
    color: #27412b;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 3px 8px;
    white-space: nowrap;
}

.store-mode-section-complete {
    background: rgba(90, 69, 54, 0.08);
    color: var(--muted);
}

.store-mode-items {
    display: grid;
    gap: 5px;
}

.store-mode-item-row {
    min-width: 0;
}

.store-mode-movable-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    position: relative;
}

.store-mode-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 40px;
    width: 100%;
    border: 1px solid rgba(90, 69, 54, 0.14);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    padding: 7px 9px;
    text-align: left;
    cursor: pointer;
}

.store-mode-label {
    min-width: 0;
    line-height: 1.25;
}

.store-mode-move,
.store-mode-remove {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 900;
    padding: 4px 8px;
    text-decoration: none;
}

.store-mode-move {
    background: var(--sage-soft);
    color: #27412b;
}

.store-mode-remove {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.store-mode-extra-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

.store-mode-move-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 4;
    min-width: min(260px, calc(100vw - 42px));
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(47, 36, 30, 0.14);
}

.store-mode-move-menu[hidden] {
    display: none;
}

.store-mode-move-option {
    border: 1px solid rgba(90, 69, 54, 0.16);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 5px 8px;
}

.store-mode-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(95, 123, 99, 0.36);
    border-radius: 999px;
    color: transparent;
    font-size: 0.78rem;
    font-weight: 900;
}

.store-mode-item[aria-pressed="true"] {
    border-color: rgba(95, 123, 99, 0.26);
    background: rgba(95, 123, 99, 0.07);
    color: rgba(47, 36, 30, 0.54);
    text-decoration: line-through;
}

.store-mode-item-row-checked .store-mode-extra-controls {
    opacity: 0.45;
}

.store-mode-item[aria-pressed="true"] .store-mode-check {
    background: var(--sage);
    border-color: var(--sage);
    color: #fff;
}

@media (max-width: 920px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .quick-nav {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 18px, 1180px);
        padding-top: 18px;
    }

    .top-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-auth-status {
        width: 100%;
    }

    .nav-user-email {
        flex: 1 1 auto;
    }

    .hero-copy,
    .panel {
        padding: 20px;
    }

    .hero-copy {
        padding: 16px;
    }

    .hero-logo {
        width: 100%;
        margin-bottom: 16px;
    }

    .panel-heading,
    .helper-row,
    .groups-meta,
    .planner-heading,
    .library-header-actions,
    .shopping-actions,
    .auth-actions,
    .auth-signed-in {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-badges {
        justify-content: flex-start;
    }

    .status-toggle-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .status-body {
        display: none;
    }

    .panel-status.is-expanded .status-body {
        display: block;
    }

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

    .auth-actions {
        grid-column: auto;
        width: 100%;
    }

    .recipe-plan-row {
        grid-template-columns: 1fr;
        padding: 9px;
    }

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

    .calendar-day {
        min-height: 40px;
        border-radius: 11px;
    }

    .recipe-edit-actions {
        flex-direction: column;
    }

    .planner-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .weekly-recipe-item {
        display: grid;
        gap: 9px;
    }

    .weekly-recipe-actions {
        min-width: 0;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .weekly-recipe-actions .button {
        min-height: 34px;
        padding: 7px 6px;
    }

    .library-tools,
    .recipe-detail-grid {
        grid-template-columns: 1fr;
    }

    .library-header-actions {
        width: 100%;
        align-items: stretch;
    }

    .library-add-menu {
        width: 100%;
    }

    .library-add-choices {
        position: static;
        margin-top: 8px;
        width: 100%;
        min-width: 0;
    }

    .recipe-detail-header,
    .chef-mode-header {
        flex-direction: column;
    }

    .recipe-detail-actions,
    .shared-recipe-actions,
    .chef-mode-header-actions {
        width: 100%;
    }

    .recipe-detail-actions .scale-picker,
    .chef-mode-header-actions .scale-picker {
        width: 100%;
    }

    .chef-mode {
        padding: max(9px, env(safe-area-inset-top)) max(9px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left));
    }

    .chef-mode-shell {
        min-height: calc(100vh - 18px);
        border-radius: 20px;
        padding: 12px;
    }

    .chef-mode-layout {
        grid-template-columns: 1fr;
    }

    .chef-ingredients {
        position: static;
    }

    .chef-step summary {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .button {
        width: 100%;
        justify-content: center;
    }

    .store-mode-header {
        flex-direction: column;
        gap: 9px;
        margin-bottom: 8px;
        padding: 8px 0;
    }

    .store-mode-header h2 {
        font-size: 1.45rem;
    }

    .store-mode-progress {
        margin-top: 5px;
        font-size: 0.9rem;
    }

    .store-mode-progress-bar {
        height: 6px;
        margin-top: 7px;
    }

    .store-mode-header-actions {
        width: 100%;
        gap: 6px;
    }

    .store-mode-header-actions .button {
        flex: 1 1 100px;
        width: auto;
        min-height: 34px;
        padding: 7px 8px;
        font-size: 0.88rem;
    }

    .store-extra-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .store-extra-row:focus-within {
        gap: 28px;
    }

    .store-extra-row .store-extra-input {
        height: 44px;
        min-height: 0;
        line-height: 24px;
        padding: 9px 12px;
    }

    .store-staples-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .store-staple-button {
        flex: 0 0 auto;
    }

    .store-extra-form {
        margin-bottom: 8px;
        padding: 9px;
    }

    .store-mode-section {
        padding: 8px;
    }

    .store-mode-section h3 {
        font-size: 0.98rem;
    }

    .store-mode-item {
        grid-template-columns: 22px minmax(0, 1fr);
        gap: 7px;
        min-height: 36px;
        padding: 6px 8px;
    }

    .store-mode-movable-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }

    .store-mode-extra-controls {
        justify-content: flex-end;
    }

    .store-mode-check {
        width: 18px;
        height: 18px;
        font-size: 0.68rem;
    }

    .store-mode-remove {
        padding: 3px 7px;
    }

    .ingredient-row {
        align-items: stretch;
    }
}
