:root {
    --bg: #f6f0e8;
    --paper: rgba(255, 252, 248, 0.8);
    --paper-strong: rgba(255, 252, 248, 0.92);
    --paper-quiet: rgba(255, 252, 249, 0.64);
    --ink: #2e241e;
    --ink-soft: #6c5f56;
    --line: rgba(70, 50, 36, 0.1);
    --line-strong: rgba(70, 50, 36, 0.16);
    --brand: #c55d2e;
    --brand-deep: #a5481d;
    --brand-soft: rgba(197, 93, 46, 0.12);
    --green: #5a7a5c;
    --green-soft: rgba(90, 122, 92, 0.12);
    --blue: #456d8e;
    --blue-soft: rgba(69, 109, 142, 0.12);
    --gold: #d0a04c;
    --danger: #af513f;
    --danger-soft: rgba(175, 81, 63, 0.12);
    --shadow: 0 18px 42px rgba(66, 46, 31, 0.08);
    --shadow-soft: 0 10px 24px rgba(66, 46, 31, 0.06);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --container: min(1240px, calc(100vw - 40px));
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.46;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(circle at 12% 12%, rgba(208, 160, 76, 0.12), transparent 22%),
        radial-gradient(circle at 84% 14%, rgba(90, 122, 92, 0.1), transparent 24%),
        linear-gradient(180deg, #fbf7f2 0%, #f6f0e8 56%, #f3ece4 100%);
}

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

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none !important;
}

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

.ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.mesh,
.grain {
    position: absolute;
}

.mesh {
    border-radius: 50%;
    filter: blur(26px);
    opacity: 0.48;
}

.mesh-a {
    width: 340px;
    height: 340px;
    top: -80px;
    left: -120px;
    background: radial-gradient(circle, rgba(197, 93, 46, 0.24), transparent 70%);
    animation: floatA 18s ease-in-out infinite alternate;
}

.mesh-b {
    width: 420px;
    height: 420px;
    right: -140px;
    top: 18%;
    background: radial-gradient(circle, rgba(90, 122, 92, 0.22), transparent 70%);
    animation: floatB 22s ease-in-out infinite alternate;
}

.mesh-c {
    width: 320px;
    height: 320px;
    left: 26%;
    bottom: -120px;
    background: radial-gradient(circle, rgba(208, 160, 76, 0.2), transparent 70%);
    animation: floatC 16s ease-in-out infinite alternate;
}

.grain {
    inset: 0;
    background-image:
        linear-gradient(rgba(70, 50, 36, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(70, 50, 36, 0.02) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 92%);
}

.lock-screen,
.app-shell {
    position: relative;
    z-index: 1;
}

.hidden {
    display: none !important;
}

.lock-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.lock-card,
.panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    min-width: 0;
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.46);
    backdrop-filter: blur(14px);
}

.lock-card {
    width: min(520px, 100%);
    padding: 34px 28px;
    text-align: center;
}

.lock-mark,
.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--brand), #d98b45);
    color: #fffaf5;
    font-family: "STKaiti", "KaiTi", "Kaiti SC", serif;
    font-size: 1.56rem;
    box-shadow: 0 12px 28px rgba(197, 93, 46, 0.2);
}

.eyebrow,
.brand-eyebrow,
.section-copy,
.form-hint,
.meta-pill,
.pill {
    color: var(--ink-soft);
}

.eyebrow,
.brand-eyebrow {
    margin: 0 0 6px;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lock-card h1,
.site-header h1,
.section-head h2,
.section-mini-head h3,
.calendar-toolbar h3 {
    margin: 0;
    font-family: "STZhongsong", "Songti SC", "Noto Serif CJK SC", serif;
}

.lock-card h1 {
    font-size: clamp(2.8rem, 7vw, 4.4rem);
    line-height: 1;
}

.lock-copy {
    max-width: 28rem;
    margin: 12px auto 0;
    line-height: 1.65;
    color: var(--ink-soft);
}

.lock-form,
.stack-form {
    display: grid;
    gap: 10px;
}

.lock-form {
    margin-top: 22px;
}

.lock-hint {
    margin: 12px 0 0;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

.app-shell {
    padding-bottom: 24px;
}

.site-header,
.page-shell {
    width: var(--container);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 10px;
    z-index: 12;
    margin-top: 12px;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav actions";
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(70, 50, 36, 0.08);
    border-radius: 20px;
    background: rgba(255, 252, 249, 0.84);
    box-shadow:
        0 12px 28px rgba(66, 46, 31, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
}

.site-nav {
    grid-area: nav;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease,
        color 160ms ease;
}

.nav-link:hover {
    transform: translateY(-1px);
    border-color: rgba(197, 93, 46, 0.22);
    background: rgba(255, 249, 244, 0.92);
    color: var(--brand-deep);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(197, 93, 46, 0.15), rgba(217, 139, 69, 0.2));
    border-color: rgba(197, 93, 46, 0.3);
    color: var(--brand-deep);
    box-shadow: inset 0 0 0 1px rgba(197, 93, 46, 0.08);
}

.brand-block {
    grid-area: brand;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    margin: 0;
    width: 42px;
    height: 42px;
    font-size: 1.18rem;
}

.site-header h1 {
    font-size: 1.08rem;
}

.quick-summary,
.header-actions,
.mode-stats,
.status-grid,
.banner-pills,
.token-list,
.event-actions,
.recipe-actions,
.ingredient-actions,
.event-meta,
.recipe-meta,
.ingredient-meta,
.selector-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-shell {
    padding-top: 14px;
}

.header-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.quick-summary {
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.quick-summary::-webkit-scrollbar {
    display: none;
}

.workbench-main,
.workbench-side {
    display: grid;
    gap: 12px;
}

.section {
    margin-top: clamp(12px, 1.6vw, 18px);
}

.section-head,
.section-mini-head,
.row-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.section-head {
    margin-bottom: 10px;
}

.section-mini-head {
    margin-bottom: 8px;
}

.section-head > *,
.section-mini-head > *,
.row-between > * {
    min-width: 0;
}

.section-head h2 {
    font-size: clamp(1.34rem, 2.3vw, 1.9rem);
}

.section-copy {
    margin: 0;
    max-width: 33rem;
    font-size: 0.88rem;
    line-height: 1.58;
}

.panel {
    padding: clamp(12px, 1.2vw, 16px);
}

.panel-quiet {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 245, 239, 0.62));
    box-shadow:
        var(--shadow-soft),
        inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.panel-editor {
    background:
        radial-gradient(circle at top right, rgba(197, 93, 46, 0.09), transparent 34%),
        linear-gradient(180deg, rgba(255, 250, 245, 0.94), rgba(251, 245, 238, 0.86));
    border-color: rgba(197, 93, 46, 0.12);
}

.panel-feature {
    background:
        radial-gradient(circle at top right, rgba(208, 160, 76, 0.18), transparent 30%),
        radial-gradient(circle at bottom left, rgba(90, 122, 92, 0.1), transparent 28%),
        linear-gradient(180deg, rgba(255, 252, 248, 0.94), rgba(250, 245, 238, 0.82));
    border-color: rgba(208, 160, 76, 0.16);
}

.lane-grid,
.two-col,
.builder-row,
.inline-form,
.workbench-grid {
    display: grid;
    gap: 12px;
}

.planner-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.26fr) minmax(320px, 0.78fr);
    gap: 12px;
    align-items: start;
}

.planner-rail {
    display: grid;
    gap: 12px;
    align-content: start;
}

.calendar-panel {
    align-self: start;
}

#selectedDayEvents {
    max-height: min(340px, calc(100vh - 290px));
    overflow: auto;
    padding-right: 2px;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.calendar-toolbar h3 {
    flex: 1;
    text-align: center;
    font-size: clamp(0.96rem, 1.2vw, 1.16rem);
}

.weekday-row,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(3px, 0.44vw, 6px);
}

.weekday-row {
    margin-bottom: 6px;
    text-align: center;
    color: var(--ink-soft);
    font-size: clamp(0.62rem, 0.7vw, 0.74rem);
}

.calendar-day {
    min-height: clamp(66px, 6.8vw, 88px);
    padding: clamp(4px, 0.52vw, 7px);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.4vw, 5px);
    text-align: left;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.calendar-day:hover {
    transform: translateY(-1px);
    border-color: rgba(197, 93, 46, 0.22);
}

.calendar-day.outside {
    opacity: 0.5;
}

.calendar-day.selected {
    border-color: rgba(197, 93, 46, 0.42);
    background: rgba(255, 247, 240, 0.94);
    box-shadow: inset 0 0 0 1px rgba(197, 93, 46, 0.1);
}

.calendar-day.today .day-number {
    color: var(--brand-deep);
}

.day-number {
    font-weight: 700;
    font-size: clamp(0.72rem, 0.82vw, 0.84rem);
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
}

.day-pill,
.pill,
.meta-pill,
.summary-chip {
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.day-pill,
.pill,
.meta-pill,
.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    font-size: 0.74rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-pill,
.calendar-day .meta-pill {
    width: 100%;
    justify-content: flex-start;
    padding: 3px 6px;
    font-size: clamp(0.56rem, 0.58vw, 0.64rem);
}

.day-pill.outside {
    background: var(--brand-soft);
    color: var(--brand-deep);
}

.day-pill.home {
    background: var(--green-soft);
    color: var(--green);
}

.event-stack {
    display: grid;
    gap: 8px;
}

.event-card,
.menu-card,
.requirement-card,
.recipe-card,
.ingredient-card,
.log-card,
.empty-state {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(250, 244, 238, 0.64));
    padding: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
    content-visibility: auto;
    contain-intrinsic-size: 180px;
}

.accent-card {
    box-shadow: inset 0 0 0 1px rgba(90, 122, 92, 0.22);
    background: rgba(248, 252, 248, 0.76);
}

.warn-card {
    border-color: rgba(175, 81, 63, 0.22);
    background: rgba(255, 248, 246, 0.86);
}

.event-card h4,
.menu-card h4,
.requirement-card h4,
.recipe-card h4,
.ingredient-card h4 {
    margin: 0;
    font-size: 0.94rem;
    overflow-wrap: anywhere;
}

.menu-card:hover,
.recipe-card:hover,
.ingredient-card:hover,
.event-card:hover,
.requirement-card:hover {
    transform: translateY(-1px);
    border-color: rgba(70, 50, 36, 0.16);
}

.event-card > p,
.menu-card > p,
.requirement-card > p,
.recipe-card > p,
.ingredient-card > p,
.log-card > p {
    margin: 8px 0 0;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--ink-soft);
}

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

.studio-banner {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 12px;
}

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

.studio-banner h3 {
    margin: 0 0 4px;
    font-family: "STZhongsong", "Songti SC", "Noto Serif CJK SC", serif;
    font-size: 1.08rem;
}

.selector-panel {
    margin-bottom: 12px;
}

.selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.selector-card {
    width: 100%;
    min-width: 0;
    padding: 12px 13px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(249, 244, 237, 0.7));
    text-align: left;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.selector-card:hover {
    transform: translateY(-1px);
    border-color: rgba(90, 122, 92, 0.24);
}

.selector-card.active {
    border-color: rgba(90, 122, 92, 0.42);
    background: linear-gradient(180deg, rgba(245, 251, 246, 0.98), rgba(238, 247, 240, 0.88));
    box-shadow:
        var(--shadow-soft),
        inset 0 0 0 1px rgba(90, 122, 92, 0.12);
}

.selector-card strong {
    font-size: 0.92rem;
    line-height: 1.4;
}

.selector-meta {
    margin-top: 6px;
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.workbench-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    align-items: start;
}

.inline-form {
    grid-template-columns: minmax(0, 1.2fr) 0.6fr auto;
    align-items: end;
    margin-bottom: 10px;
}

.compact-inline {
    grid-template-columns: minmax(0, 1fr) auto;
}

.list-panel {
    min-height: 0;
}

.sub-panel {
    padding: 10px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.46);
    border: 1px dashed rgba(70, 50, 36, 0.14);
}

.check-grid {
    display: grid;
    gap: 8px;
}

.choice-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 11px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.66);
}

.choice-card input {
    width: auto;
    margin-top: 4px;
}

.builder-row {
    grid-template-columns: 1.2fr 0.75fr 0.7fr auto;
}

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

label {
    display: grid;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 0.86rem;
}

input,
select,
textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(70, 50, 36, 0.14);
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(197, 93, 46, 0.34);
    box-shadow: 0 0 0 4px rgba(197, 93, 46, 0.08);
}

input[readonly] {
    background: rgba(247, 242, 235, 0.95);
    color: var(--ink-soft);
}

textarea {
    resize: vertical;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row input {
    width: auto;
}

.primary-btn,
.ghost-btn {
    border-radius: 999px;
    min-height: 34px;
    padding: 7px 12px;
    font-weight: 700;
    font-size: 0.84rem;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.calendar-day:hover,
.selector-card:hover {
    transform: translateY(-1px);
}

.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.nav-link:focus-visible,
.calendar-day:focus-visible,
.selector-card:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 0;
    box-shadow:
        0 0 0 2px rgba(255, 251, 247, 0.94),
        0 0 0 5px rgba(197, 93, 46, 0.2);
}

.primary-btn {
    background: linear-gradient(135deg, var(--brand), #d98643);
    color: #fffaf5;
    box-shadow: 0 16px 32px rgba(197, 93, 46, 0.22);
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    border: 1px solid var(--line);
}

.small {
    padding: 6px 10px;
    font-size: 0.78rem;
}

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

.summary-chip {
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.66);
}

.recipe-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(197, 93, 46, 0.18), rgba(208, 160, 76, 0.22)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
    margin-bottom: 8px;
}

.recipe-cover img {
    height: 100%;
    object-fit: cover;
}

.recipe-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-family: "STZhongsong", "Songti SC", "Noto Serif CJK SC", serif;
    font-size: 1.24rem;
    color: rgba(46, 36, 30, 0.78);
}

.pantry-shell,
.pantry-section,
.pantry-side-column {
    display: grid;
    gap: 12px;
}

.pantry-grid {
    display: grid;
    gap: 12px;
    align-items: start;
}

.pantry-grid-recipes {
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
}

.pantry-grid-stock {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) minmax(260px, 312px);
}

.pantry-form-panel,
.pantry-library-panel,
.pantry-stock-panel,
.pantry-side-column > .panel,
.pantry-side-column > form {
    min-width: 0;
}

#ingredientList {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    align-items: start;
    gap: 10px;
}

#ingredientList .ingredient-card {
    height: 100%;
}

#inventoryLogList {
    max-height: 380px;
    overflow: auto;
    padding-right: 2px;
}

#recipeList {
    display: block;
    column-width: 240px;
    column-gap: 10px;
    align-items: start;
}

#recipeList .recipe-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 8px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-areas:
        "cover head"
        "cover summary"
        "cover tokens"
        "actions actions";
    gap: 6px 8px;
    align-items: start;
}

#recipeList .recipe-card > .recipe-cover {
    grid-area: cover;
    width: 56px;
    aspect-ratio: 1 / 1;
    margin-bottom: 0;
    border-radius: 8px;
}

#recipeList .recipe-card > .row-between {
    grid-area: head;
}

#recipeList .recipe-card > p {
    grid-area: summary;
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--ink-soft);
}

#recipeList .recipe-card > .token-list {
    grid-area: tokens;
    margin-top: 0;
}

#recipeList .recipe-card > .recipe-actions {
    grid-area: actions;
    margin-top: 2px;
}

#recipeList .recipe-card .recipe-meta {
    gap: 4px;
}

#recipeList .recipe-card .recipe-placeholder {
    font-size: 0.74rem;
}

.token-list {
    margin-top: 8px;
}

.token {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    max-width: 100%;
    font-size: 0.74rem;
}

.stock-meter {
    height: 7px;
    margin-top: 10px;
    border-radius: 999px;
    background: rgba(70, 50, 36, 0.08);
    overflow: hidden;
}

.stock-meter-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(90, 122, 92, 0.8), rgba(112, 151, 116, 0.96));
}

.stock-meter-fill.warn {
    background: linear-gradient(90deg, rgba(175, 81, 63, 0.8), rgba(206, 119, 93, 0.96));
}

.stock-legend {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    color: var(--ink-soft);
    font-size: 0.76rem;
}

.meta-pill.good {
    background: var(--green-soft);
    color: var(--green);
}

.meta-pill.warn {
    background: var(--danger-soft);
    color: var(--danger);
}

.empty-state {
    color: var(--ink-soft);
    line-height: 1.8;
}

.toast-stack {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 30;
    display: grid;
    gap: 8px;
}

.toast {
    min-width: 220px;
    max-width: min(360px, calc(100vw - 36px));
    padding: 10px 12px;
    border-radius: 14px;
    color: #fffaf5;
    box-shadow: 0 18px 32px rgba(46, 36, 30, 0.24);
    animation: toastIn 220ms ease forwards;
}

.toast.info {
    background: linear-gradient(135deg, var(--brand), #d98643);
}

.toast.success {
    background: linear-gradient(135deg, var(--green), #6e8c73);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger), #ce775d);
}

.event-actions,
.recipe-actions,
.ingredient-actions {
    margin-top: 8px;
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 420ms ease, transform 420ms ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes floatA {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(42px, 20px, 0) scale(1.12);
    }
}

@keyframes floatB {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(-34px, 18px, 0) scale(1.08);
    }
}

@keyframes floatC {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(20px, -28px, 0) scale(1.1);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 1360px) {
    .site-header {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "brand actions"
            "nav nav";
        align-items: start;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .quick-summary {
        justify-content: flex-start;
    }
}

@media (max-width: 1120px) {
    .site-header,
    .planner-stage,
    .lane-grid,
    .workbench-grid,
    .workbench-main,
    .workbench-side {
        grid-template-columns: 1fr;
    }

    .site-header {
        position: static;
        grid-template-areas:
            "brand"
            "nav"
            "actions";
    }

    .header-actions {
        grid-template-columns: 1fr;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .pantry-grid-recipes,
    .pantry-grid-stock {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .inline-form,
    .two-col,
    .builder-row {
        grid-template-columns: 1fr;
    }

    .studio-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .banner-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        justify-content: flex-start;
    }

    .banner-pills {
        justify-content: flex-start;
    }

    .calendar-toolbar {
        flex-wrap: wrap;
    }

    .calendar-toolbar h3 {
        order: -1;
        width: 100%;
        text-align: left;
    }

    #selectedDayEvents,
    #inventoryLogList {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    #recipeList {
        column-width: auto;
        column-count: 2;
    }
}

@media (min-width: 1121px) {
    .planner-rail,
    .workbench-side,
    .pantry-grid-recipes > .pantry-form-panel,
    .pantry-grid-stock > .pantry-form-panel {
        position: sticky;
        top: 92px;
    }
}

@media (max-width: 760px) {
    :root {
        --container: min(100vw - 16px, 1280px);
    }

    .lock-card,
    .panel {
        padding: 12px;
        border-radius: 16px;
    }

    .site-header {
        margin-top: 8px;
        padding: 10px 12px;
        border-radius: 16px;
    }

    .brand-mark,
    .lock-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .site-header h1 {
        font-size: 0.98rem;
    }

    .nav-link {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 0.82rem;
    }

    .summary-chip,
    .pill,
    .meta-pill,
    .token {
        padding: 5px 8px;
        font-size: 0.7rem;
    }

    .weekday-row,
    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        min-height: 60px;
        padding: 4px;
        border-radius: 10px;
    }

    .day-pill,
    .calendar-day .meta-pill {
        padding: 2px 5px;
        border-radius: 8px;
    }

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

    #recipeList {
        column-count: 1;
    }

    .toast-stack {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .site-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .site-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        flex: 0 0 auto;
    }

    .weekday-row {
        font-size: 0.56rem;
    }

    .calendar-day {
        min-height: 56px;
        padding: 3px;
    }

    .day-number {
        font-size: 0.64rem;
    }

    .day-pill,
    .calendar-day .meta-pill {
        font-size: 0.52rem;
    }

    .row-between {
        flex-direction: column;
        align-items: flex-start;
    }

    .choice-card,
    .event-card,
    .menu-card,
    .requirement-card,
    .recipe-card,
    .ingredient-card,
    .log-card,
    .empty-state {
        padding: 10px;
    }
}
