/* MoodFood AI workspace
   Design source: docs/design-system, docs/components, docs/screens.
   Scoped to .moodfood-page so existing auth and supporting pages keep their styles. */

h1 , h2, h3{
    color: var(--mf-primary-700);
}

.page-shell.moodfood-shell {
    padding: 0;
}

.moodfood-page {
    --mf-primary-50: #faf6f2;
    --mf-primary-100: #f4ece3;
    --mf-primary-200: #e7d8c3;
    --mf-primary-300: #d6be9a;
    --mf-primary-400: #c39e6f;
    --mf-primary-500: #a67c52;
    --mf-primary-600: #8b6542;
    --mf-primary-700: #7a5a3a;
    --mf-primary-800: #5d432b;
    --mf-primary-900: #3c2a1a;
    --mf-sage-50: #f5f7f1;
    --mf-sage-100: #e9eedf;
    --mf-sage-200: #d8e1c6;
    --mf-sage-400: #a6b18a;
    --mf-sage-600: #6b785e;
    --mf-sage-700: #536049;
    --mf-neutral-0: #fff;
    --mf-neutral-50: #fffdf8;
    --mf-neutral-100: #faf8f3;
    --mf-neutral-200: #f5f1eb;
    --mf-neutral-300: #e7e2d8;
    --mf-neutral-400: #cfc8bb;
    --mf-neutral-500: #9b9386;
    --mf-neutral-600: #766d60;
    --mf-neutral-700: #5c584f;
    --mf-neutral-800: #3d3a34;
    --mf-neutral-900: #24231f;
    --mf-success: #3f7652;
    --mf-warning: #9a6515;
    --mf-danger: #a3463a;
    --mf-focus: #6b785e;
    --mf-theme-soft: #edf1e4;
    --mf-theme-mid: #9cad75;
    --mf-theme-strong: #607b38;
    --mf-theme-glow: rgb(156 173 117 / 48%);
    --mf-shadow-sm: 0 2px 8px rgb(60 42 26 / 8%);
    --mf-shadow-md: 0 10px 28px rgb(60 42 26 / 12%);
    --mf-shadow-lg: 0 20px 48px rgb(60 42 26 / 16%);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--mf-neutral-900);
    color-scheme: light;
    background:
        radial-gradient(circle at 4% 12%, var(--mf-theme-glow), transparent 22rem),
        linear-gradient(180deg, var(--mf-neutral-50), var(--mf-neutral-100));
    font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
    line-height: 1.65;
    transition: background-color 320ms ease, color 200ms ease;
}

.moodfood-page[data-theme="afternoon"] {
    --mf-theme-soft: #fbecd9;
    --mf-theme-mid: #dda75e;
    --mf-theme-strong: #c47725;
    --mf-theme-glow: rgb(221 167 94 / 44%);
}

.moodfood-page[data-theme="evening"] {
    --mf-theme-soft: #fae3d8;
    --mf-theme-mid: #e68755;
    --mf-theme-strong: #cf4f0d;
    --mf-theme-glow: rgb(230 135 85 / 42%);
}

.moodfood-page[data-theme="night"] {
    --mf-theme-soft: #e4eaee;
    --mf-theme-mid: #6f8493;
    --mf-theme-strong: #193448;
    --mf-theme-glow: rgb(67 94 113 / 36%);
}

.moodfood-page *,
.moodfood-page *::before,
.moodfood-page *::after {
    box-sizing: border-box;
}

.moodfood-page [hidden] {
    display: none;
}

.moodfood-page button,
.moodfood-page input,
.moodfood-page select {
    font: inherit;
}

.moodfood-page button,
.moodfood-page a {
    -webkit-tap-highlight-color: transparent;
}

.moodfood-page :focus-visible {
    outline: 3px solid var(--mf-focus);
    outline-offset: 3px;
}

.moodfood-page .container-xl {
    width: min(calc(100% - 32px), 1200px);
    max-width: none;
    margin-inline: auto;
    padding-inline: 0;
}

.moodfood-page .container-fluid {
    width: min(calc(100% - 32px), 1280px);
    margin-inline: auto;
    padding-inline: 0;
}

/* Navigation */

.moodfood-nav {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    color: var(--mf-neutral-900);
}

.moodfood-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.moodfood-brand strong {
    color: var(--mf-primary-700);
}

.brand-sprout {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--mf-sage-100);
}

.brand-sprout b {
    position: absolute;
    left: 16px;
    bottom: 7px;
    width: 2px;
    height: 16px;
    border-radius: 2px;
    background: var(--mf-sage-700);
    transform: rotate(-5deg);
}

.brand-sprout i {
    position: absolute;
    top: 8px;
    width: 11px;
    height: 7px;
    border-radius: 100% 0 100% 0;
    background: var(--mf-sage-600);
}

.brand-sprout i:first-child {
    left: 7px;
    transform: rotate(12deg);
}

.brand-sprout i:nth-child(2) {
    right: 6px;
    transform: scaleX(-1) rotate(12deg);
}

.moodfood-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.moodfood-nav-actions > a,
.moodfood-account,
.moodfood-ghost-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    color: var(--mf-neutral-700);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.moodfood-nav-actions > a:hover,
.moodfood-ghost-button:hover {
    color: var(--mf-primary-800);
    background: var(--mf-primary-100);
}

.moodfood-account {
    max-width: 180px;
    overflow: hidden;
    color: var(--mf-primary-800);
    background: var(--mf-primary-50);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.moodfood-nav-actions form {
    margin: 0;
}

.moodfood-ghost-button {
    cursor: pointer;
}

/* Time theme and progress */

.moodfood-timebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 56px;
    margin-top: 8px;
    padding: 8px 12px 8px 18px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 16px;
    background: rgb(255 255 255 / 76%);
    box-shadow: var(--mf-shadow-sm);
    backdrop-filter: blur(12px);
}

.moodfood-timebar p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--mf-neutral-700);
    font-size: 13px;
}

.moodfood-timebar small {
    color: var(--mf-neutral-600);
}

.timebar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mf-theme-strong);
    box-shadow: 0 0 0 5px var(--mf-theme-soft);
}

.timebar-options {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timebar-chip {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--mf-neutral-600);
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.timebar-chip:hover {
    color: var(--mf-theme-strong);
    background: var(--mf-theme-soft);
}

.timebar-chip.is-active {
    border-color: var(--mf-theme-mid);
    color: var(--mf-theme-strong);
    background: var(--mf-theme-soft);
}

.moodfood-progress {
    position: relative;
    margin-top: 24px;
    margin-bottom: 32px;
    padding-inline: 48px;
}

.moodfood-progress ol {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
    padding: 0;
    list-style: none;
}

.moodfood-progress li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--mf-neutral-500);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.moodfood-progress li b {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 2px solid var(--mf-neutral-300);
    border-radius: 50%;
    color: var(--mf-neutral-600);
    background: var(--mf-neutral-50);
    transition: border-color 200ms ease, color 200ms ease, background-color 200ms ease;
}

.moodfood-progress li.is-current,
.moodfood-progress li.is-complete {
    color: var(--mf-primary-800);
}

.moodfood-progress li.is-current b {
    border-color: var(--mf-primary-700);
    color: var(--mf-neutral-0);
    background: var(--mf-primary-700);
    box-shadow: 0 0 0 5px var(--mf-primary-100);
}

.moodfood-progress li.is-complete b {
    border-color: var(--mf-sage-600);
    color: var(--mf-neutral-0);
    background: var(--mf-sage-600);
}

.progress-line {
    position: absolute;
    z-index: 1;
    top: 15px;
    right: calc(12.5% + 16px);
    left: calc(12.5% + 16px);
    height: 2px;
    overflow: hidden;
    background: var(--mf-neutral-300);
}

.progress-line span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--mf-sage-600);
    transition: width 320ms cubic-bezier(.2, 0, 0, 1);
}

/* Workspace and shared controls */

.moodfood-page .moodfood-workspace {
    display: block;
    max-width: none;
    margin-inline: auto;
    padding: 0 0 64px;
}

.moodfood-page .moodfood-stage {
    position: relative;
    animation: moodfood-stage-in 240ms cubic-bezier(.2, 0, 0, 1) both;
}

.moodfood-page .moodfood-alert {
    margin: 0 0 24px;
    padding: 14px 16px;
    border: 1px solid rgb(163 70 58 / 35%);
    border-radius: 12px;
    color: var(--mf-danger);
    background: #fff5f3;
    font-size: 14px;
}

.moodfood-kicker {
    display: inline-block;
    color: var(--mf-primary-700);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.moodfood-page h1,
.moodfood-page h2,
.moodfood-page p {
    overflow-wrap: anywhere;
}

.moodfood-page .live-btn {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.moodfood-page .live-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.moodfood-page .live-btn:active:not(:disabled) {
    transform: scale(.98);
}

.moodfood-page .live-btn:disabled {
    border-color: var(--mf-neutral-300);
    color: var(--mf-neutral-600);
    background: var(--mf-neutral-200);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

.moodfood-page .live-btn-dark,
.moodfood-page .moodfood-primary {
    border-color: var(--mf-primary-700);
    color: var(--mf-neutral-0);
    background: var(--mf-primary-700);
    box-shadow: 0 8px 18px rgb(122 90 58 / 20%);
}

.moodfood-page .live-btn-dark:hover:not(:disabled),
.moodfood-page .moodfood-primary:hover:not(:disabled) {
    border-color: var(--mf-primary-800);
    background: var(--mf-primary-800);
}

.moodfood-page .live-btn-light {
    border-color: var(--mf-neutral-400);
    color: var(--mf-neutral-800);
    background: var(--mf-neutral-0);
}

.moodfood-page .live-btn-light:hover:not(:disabled) {
    border-color: var(--mf-primary-400);
    color: var(--mf-primary-800);
    background: var(--mf-primary-50);
}

.moodfood-text-button,
.moodfood-page .live-link-btn {
    align-self: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    color: var(--mf-neutral-600);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

.moodfood-text-button:hover,
.moodfood-page .live-link-btn:hover {
    color: var(--mf-primary-800);
}

/* Home */

.moodfood-home-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
    gap: 24px;
}

.moodfood-hero {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    border-radius: 24px;
    background: var(--mf-theme-soft);
    box-shadow: var(--mf-shadow-md);
    isolation: isolate;
}

.moodfood-hero-image,
.moodfood-hero-tint {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.moodfood-hero-image {
    z-index: -3;
    object-fit: cover;
    object-position: center;
    filter: saturate(.72) sepia(.08);
}

.moodfood-hero-tint {
    z-index: -2;
    background:
        linear-gradient(90deg, rgb(36 35 31 / 66%), rgb(36 35 31 / 12%) 64%),
        linear-gradient(0deg, rgb(60 42 26 / 24%), transparent 44%);
}

.moodfood-sun {
    position: absolute;
    z-index: -1;
    top: 52px;
    right: 68px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--mf-theme-mid);
    box-shadow: 0 0 0 24px rgb(255 255 255 / 8%), 0 0 64px var(--mf-theme-glow);
    opacity: .86;
}

.moodfood-leaf {
    position: absolute;
    color: rgb(255 255 255 / 58%);
    font-size: 76px;
    line-height: 1;
}

.moodfood-leaf-left {
    left: -12px;
    bottom: 24px;
    transform: rotate(-24deg);
}

.moodfood-leaf-right {
    right: 24px;
    bottom: 20px;
    transform: rotate(26deg) scale(.72);
}

.moodfood-greeting {
    position: static;
    top: 50%;
    left: clamp(24px, 7vw, 72px);
    width: min(80%, 560px);
    color: var(--mf-neutral-0);
    transform: none;
}

.moodfood-greeting .moodfood-kicker {
    color: var(--mf-primary-100);
}

.moodfood-greeting h1 {
    margin: 12px 0 12px;
    color: inherit;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(38px, 5.5vw, 68px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.035em;
    text-shadow: 0 2px 16px rgb(0 0 0 / 22%);
}

.moodfood-greeting h1 i {
    color: var(--mf-theme-mid);
    font-style: normal;
}

.moodfood-greeting p {
    margin: 0;
    color: rgb(255 255 255 / 88%);
    font-size: 18px;
}

.moodfood-start-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    min-height: 560px;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid var(--mf-neutral-300);
    border-radius: 24px;
    background: rgb(255 255 255 / 92%);
    box-shadow: var(--mf-shadow-md);
}

.moodfood-start-panel h2 {
    margin: 10px 0 12px;
    color: var(--mf-neutral-900);
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.28;
}

.moodfood-start-panel > div > p {
    margin: 0;
    color: var(--mf-neutral-700);
    font-size: 16px;
}

.moodfood-location-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 16px;
    background: var(--mf-neutral-100);
}

.location-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    color: var(--mf-primary-800);
    background: var(--mf-primary-100);
    font-size: 22px;
}

.location-copy {
    min-width: 0;
}

.location-copy strong {
    display: block;
    color: var(--mf-neutral-900);
    font-size: 14px;
}

.moodfood-page .moodfood-location-card .live-btn {
    grid-column: 1 / -1;
    min-height: 44px;
}

.moodfood-page .live-location-status,
.moodfood-page .live-location-error {
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    color: var(--mf-success);
    background: transparent;
    font-size: 13px;
    text-align: left;
}

.moodfood-page .live-location-error {
    color: var(--mf-danger);
}

.moodfood-page .moodfood-primary {
    min-height: 56px;
}

.moodfood-pending {
    grid-column: 1 / -1;
    margin-top: 24px;
    padding: 32px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 24px;
    background: var(--mf-neutral-0);
    box-shadow: var(--mf-shadow-sm);
}

.pending-heading {
    margin-bottom: 20px;
}

.pending-heading h2 {
    margin: 6px 0 0;
    color: var(--mf-neutral-900);
    font-size: 24px;
}

.moodfood-page .live-pending-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.moodfood-page .live-pending-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 16px;
    color: var(--mf-neutral-900);
    background: var(--mf-neutral-50);
    box-shadow: none;
}

.moodfood-page .live-pending-photo {
    width: 92px;
    height: 100%;
    min-height: 128px;
    object-fit: cover;
}

.moodfood-page .live-pending-photo-empty {
    display: grid;
    place-items: center;
    padding: 8px;
    color: var(--mf-neutral-600);
    background: var(--mf-neutral-200);
    font-size: 12px;
    text-align: center;
}

.moodfood-page .live-pending-body {
    min-width: 0;
    padding: 14px 14px 14px 0;
}

.moodfood-page .live-pending-name {
    display: block;
    color: var(--mf-neutral-900);
    font-weight: 700;
}

.moodfood-page .live-pending-stars {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 8px;
}

.moodfood-page .live-star {
    display: grid;
    /* width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px; */
    place-items: center;
    padding: 0;
    border: 0;
    color: var(--mf-primary-500);
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.moodfood-page .live-star:hover,
.moodfood-page .live-star-filled {
    color: #9a6515;
    transform: scale(1.08);
}

.moodfood-page .live-pending-thanks {
    margin: 8px 0 0;
    color: var(--mf-success);
    font-size: 13px;
}

.moodfood-page .live-pending-error {
    margin: 8px 0 0;
    color: var(--mf-danger);
    font-size: 13px;
}

/* Profile and query */

.moodfood-form-stage {
    display: grid;
    grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
    align-items: stretch;
    gap: 24px;
}

.moodfood-stage-aside {
    position: relative;
    display: flex;
    min-height: 620px;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: clamp(28px, 5vw, 56px);
    border-radius: 24px;
    color: var(--mf-neutral-0);
    background:
        radial-gradient(circle at 16% 16%, rgb(255 255 255 / 16%), transparent 13rem),
        linear-gradient(145deg, var(--mf-sage-700), var(--mf-primary-900));
    box-shadow: var(--mf-shadow-md);
}

.moodfood-stage-aside::after {
    content: "❆";
    position: absolute;
    right: -18px;
    bottom: -22px;
    color: rgb(255 255 255 / 12%);
    font-size: 180px;
    line-height: 1;
    transform: rotate(18deg);
}

.moodfood-stage-aside .moodfood-kicker {
    color: var(--mf-primary-200);
}

.moodfood-stage-aside h2 {
    position: relative;
    z-index: 1;
    margin: 10px 0 16px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.22;
}

.moodfood-stage-aside p {
    position: relative;
    z-index: 1;
    max-width: 28em;
    margin: 0;
    color: rgb(255 255 255 / 78%);
}

.moodfood-bot {
    position: relative;
    width: 108px;
    height: 96px;
    margin-bottom: 32px;
}

.bot-screen {
    position: absolute;
    inset: 18px 0 0;
    border: 4px solid rgb(255 255 255 / 78%);
    border-radius: 30px;
    background: rgb(255 255 255 / 12%);
    box-shadow: inset 0 0 24px rgb(255 255 255 / 8%);
}

.bot-screen i {
    position: absolute;
    top: 30px;
    width: 9px;
    height: 12px;
    border-radius: 50%;
    background: var(--mf-primary-200);
}

.bot-screen i:first-child {
    left: 27px;
}

.bot-screen i:nth-child(2) {
    right: 27px;
}

.bot-screen b {
    position: absolute;
    left: 50%;
    bottom: 15px;
    width: 30px;
    height: 12px;
    border-bottom: 3px solid var(--mf-primary-200);
    border-radius: 50%;
    transform: translateX(-50%);
}

.bot-antenna {
    position: absolute;
    top: 0;
    left: 53px;
    width: 3px;
    height: 22px;
    background: rgb(255 255 255 / 78%);
}

.bot-antenna::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--mf-primary-300);
}

.moodfood-page .moodfood-card {
    display: flex;
    min-height: 620px;
    flex-direction: column;
    gap: 24px;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid var(--mf-neutral-300);
    border-radius: 24px;
    color: var(--mf-neutral-900);
    background: var(--mf-neutral-0);
    box-shadow: var(--mf-shadow-md);
}

.moodfood-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--mf-neutral-300);
}

.moodfood-step-number {
    display: inline-flex;
    min-width: 58px;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--mf-primary-800);
    background: var(--mf-primary-100);
    font-size: 13px;
    font-weight: 800;
}

.moodfood-card-heading h1 {
    margin: 0 0 6px;
    color: var(--mf-primary-700);
    font-size: clamp(26px, 3vw, 32px);
    line-height: 1.25;
}

.moodfood-card-heading p {
    margin: 0;
    color: var(--mf-neutral-700);
    font-size: 14px;
}

.moodfood-page .live-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.moodfood-page .live-field,
.moodfood-page .live-field-group {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
    color: var(--mf-neutral-700);
    font-size: 14px;
}

.moodfood-page .live-field > span,
.moodfood-field-title {
    color: var(--mf-neutral-800);
    font-size: 14px;
    font-weight: 700;
}

.moodfood-page .live-field small,
.moodfood-field-title small {
    color: var(--mf-neutral-600);
    font-weight: 500;
}

.moodfood-field-title i {
    color: var(--mf-primary-700);
    font-style: normal;
}

.moodfood-page .live-field input,
.moodfood-page .live-field select {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--mf-neutral-400);
    border-radius: 12px;
    color: var(--mf-neutral-900);
    background: var(--mf-neutral-0);
}

.moodfood-page .live-field input:hover,
.moodfood-page .live-field select:hover {
    border-color: var(--mf-primary-400);
}

.moodfood-page .live-toggle-grid {
    display: grid;
    gap: 8px;
}

.moodfood-page .live-toggle-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.moodfood-page .live-toggle-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.moodfood-page .live-toggle {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 12px;
    color: var(--mf-neutral-800);
    background: var(--mf-neutral-50);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.moodfood-page .live-toggle:hover {
    border-color: var(--mf-primary-400);
    color: var(--mf-primary-800);
    background: var(--mf-primary-50);
    transform: translateY(-1px);
}

.moodfood-page .live-toggle-selected {
    border-color: var(--mf-primary-700);
    color: var(--mf-primary-900);
    background: var(--mf-primary-100);
    box-shadow: inset 0 0 0 1px var(--mf-primary-700);
}

.moodfood-page .mood-grid .live-toggle {
    justify-content: flex-start;
    min-height: 56px;
    padding-inline: 16px;
}

.moodfood-page .mood-grid .live-toggle i {
    font-size: 18px;
    font-style: normal;
}

.moodfood-inline-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.moodfood-distance input[type="range"] {
    width: 100%;
    min-height: 44px;
    accent-color: var(--mf-primary-700);
}

.range-hints {
    display: flex;
    justify-content: space-between;
    color: var(--mf-neutral-600);
    font-size: 12px;
}

.moodfood-page .live-warning-text {
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid var(--mf-warning);
    border-radius: 8px;
    color: var(--mf-warning);
    background: #fff9ed;
    font-size: 13px;
}

.moodfood-page .moodfood-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 24px 0 0;
    color: var(--mf-neutral-700);
    font-size: 14px;
}

.moodfood-loading span {
    width: 20px;
    height: 20px;
    border: 3px solid var(--mf-primary-200);
    border-top-color: var(--mf-primary-700);
    border-radius: 50%;
    animation: moodfood-spin 800ms linear infinite;
}

/* Results */

.moodfood-results-stage {
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid var(--mf-neutral-300);
    border-radius: 24px;
    background: rgb(255 255 255 / 90%);
    box-shadow: var(--mf-shadow-md);
}

.moodfood-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--mf-neutral-300);
}

.moodfood-results-heading h1 {
    margin: 6px 0 6px;
    color: var(--mf-primary-700);
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.2;
}

.moodfood-results-heading p {
    margin: 0;
    color: var(--mf-neutral-700);
}

.results-leaf {
    color: var(--mf-sage-400);
    font-size: 72px;
    line-height: 1;
    transform: rotate(18deg);
}

.moodfood-page .live-result-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.moodfood-page .live-opening {
    max-width: 760px;
    margin: 0;
    color: var(--mf-primary-800);
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 18px;
    font-style: normal;
    line-height: 1.7;
}

.moodfood-page .live-relaxed-note {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--mf-warning);
    background: #fff9ed;
    font-size: 13px;
}

.moodfood-page .live-restaurant-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;
    margin-top: 8px;
}

.moodfood-page .live-card {
    display: flex;
    min-width: 0;
    height: auto;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 16px;
    color: var(--mf-neutral-900);
    background: var(--mf-neutral-0);
    box-shadow: var(--mf-shadow-sm);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.moodfood-page .live-card:hover {
    border-color: var(--mf-primary-300);
    box-shadow: var(--mf-shadow-md);
    transform: translateY(-2px);
}

.moodfood-page .live-card-photo {
    display: block;
    width: 100%;
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--mf-neutral-200);
}

.moodfood-page .live-card-photo-empty {
    display: grid;
    place-items: center;
    color: var(--mf-neutral-600);
    font-size: 13px;
}

.moodfood-page .live-card-body {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.moodfood-page .live-card-topline,
.moodfood-page .live-card-title-row,
.moodfood-page .live-card-meta {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.moodfood-page .live-card-topline {
    justify-content: space-between;
}

.moodfood-page .live-card-title-row {
    min-width: 0;
}

.moodfood-page .live-card-name {
    min-width: 0;
    color: var(--mf-neutral-900);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.moodfood-page .live-card-distance {
    flex: 0 0 auto;
    color: var(--mf-neutral-600);
    font-size: 12px;
    white-space: nowrap;
}

.moodfood-page .live-favorite-btn {
    display: grid;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    place-items: center;
    margin: -9px -8px -9px 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--mf-primary-700);
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.moodfood-page .live-favorite-btn:hover,
.moodfood-page .live-favorite-btn-active {
    border-color: var(--mf-primary-200);
    color: var(--mf-danger);
    background: var(--mf-primary-50);
    box-shadow: none;
    transform: none;
}

.moodfood-page .live-card-meta {
    flex-wrap: wrap;
}

.moodfood-page .live-pill {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--mf-neutral-700);
    background: var(--mf-neutral-200);
    font-size: 12px;
    font-weight: 700;
}

.moodfood-page .live-pill-open {
    color: var(--mf-neutral-0);
    background: var(--mf-success);
}

.moodfood-page .live-card-address {
    color: var(--mf-neutral-600);
    font-size: 14px;
    line-height: 1.6;
}

.moodfood-page .live-card-reason {
    flex: 1;
    margin: 0;
    padding: 12px;
    border-left: 3px solid var(--mf-sage-400);
    border-radius: 8px;
    color: var(--mf-neutral-700);
    background: var(--mf-sage-50);
    font-size: 14px;
    line-height: 1.65;
}

.moodfood-page .live-card-reason span {
    color: var(--mf-sage-700);
    font-weight: 700;
}

.moodfood-page .live-btn-select,
.moodfood-page .live-btn-nav {
    margin-top: auto;
}

.moodfood-page .live-btn-select {
    border-color: var(--mf-primary-700);
    color: var(--mf-primary-800);
    background: var(--mf-primary-50);
}

.moodfood-page .live-btn-select:hover {
    color: var(--mf-neutral-0);
    background: var(--mf-primary-700);
}

.moodfood-page .live-btn-nav {
    border-color: var(--mf-success);
    color: var(--mf-neutral-0);
    background: var(--mf-success);
}

.moodfood-page .live-external-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.moodfood-page .live-external-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 12px;
    color: var(--mf-neutral-700);
    background: var(--mf-neutral-50);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.moodfood-page .live-external-link:hover {
    border-color: var(--mf-primary-400);
    color: var(--mf-primary-800);
    background: var(--mf-primary-50);
}

.moodfood-page .live-rescue-prompt {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
    padding: 20px;
    border: 1px solid rgb(154 101 21 / 28%);
    border-radius: 16px;
    background: #fff9ed;
}

.moodfood-page .live-rescue-prompt p {
    margin: 0;
    color: var(--mf-warning);
    font-size: 14px;
}

.moodfood-page .live-toggle-row {
    display: flex;
    gap: 12px;
}

.moodfood-page .live-flex {
    flex: 1;
}

.moodfood-page .moodfood-more-button {
    width: auto;
    margin: 24px auto 0;
}

.moodfood-page .live-round2-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--mf-neutral-300);
}

.moodfood-page .live-section-title {
    margin: 0;
    color: var(--mf-neutral-800);
    font-size: 20px;
}

.moodfood-page .live-empty-state {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    padding: 32px;
    text-align: center;
}

.moodfood-page .live-sorry-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
}

/* Footer */

.moodfood-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 96px;
    padding-block: 24px;
    border-top: 1px solid var(--mf-neutral-300);
    color: var(--mf-neutral-600);
    text-align: center;
}

.moodfood-footer p {
    margin: 0;
    font-size: 13px;
}

.moodfood-footer > span {
    color: var(--mf-sage-600);
}

@keyframes moodfood-stage-in {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes moodfood-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1023px) {
    .moodfood-nav-actions {
        position: absolute;
        top: 68px;
        right: 0;
        display: none;
        width: min(320px, calc(100vw - 32px));
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px;
        border: 1px solid var(--mf-neutral-300);
        border-radius: 16px;
        background: var(--mf-neutral-0);
        box-shadow: var(--mf-shadow-lg);
    }

    .moodfood-nav-actions > a,
    .moodfood-account,
    .moodfood-ghost-button {
        width: 100%;
        justify-content: flex-start;
        padding-inline: 14px;
    }

    .moodfood-nav-actions form {
        width: 100%;
    }

    .moodfood-home-stage,
    .moodfood-form-stage {
        grid-template-columns: 1fr;
    }

    .moodfood-hero,
    .moodfood-start-panel,
    .moodfood-stage-aside,
    .moodfood-page .moodfood-card {
        min-height: auto;
    }

    .moodfood-hero {
        min-height: 480px;
    }

    .moodfood-start-panel {
        padding: 32px;
    }

    .moodfood-stage-aside {
        min-height: 360px;
    }

    .moodfood-page .live-pending-list,
    .moodfood-page .live-restaurant-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .moodfood-page .container-xl,
    .moodfood-page .container-fluid {
        width: min(calc(100% - 32px), 1200px);
    }

    .moodfood-timebar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .moodfood-timebar small {
        display: none;
    }

    .timebar-options {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .timebar-chip {
        flex: 1 0 auto;
    }

    .moodfood-progress {
        padding-inline: 0;
    }

    .moodfood-progress li span {
        font-size: 11px;
    }

    .moodfood-hero {
        min-height: 420px;
    }

    .moodfood-greeting {
        top: auto;
        right: 24px;
        bottom: 48px;
        left: 24px;
        width: auto;
        transform: none;
    }

    .moodfood-greeting h1 {
        font-size: clamp(36px, 12vw, 52px);
    }

    .moodfood-start-panel,
    .moodfood-stage-aside,
    .moodfood-page .moodfood-card,
    .moodfood-results-stage,
    .moodfood-pending {
        padding: 24px;
        border-radius: 20px;
    }

    .moodfood-stage-aside {
        min-height: 320px;
    }

    .moodfood-bot {
        margin-bottom: 20px;
        transform: scale(.86);
        transform-origin: left bottom;
    }

    .moodfood-page .live-pending-list,
    .moodfood-page .live-restaurant-list {
        grid-template-columns: 1fr;
    }

    .moodfood-page .live-form-row,
    .moodfood-inline-fields {
        grid-template-columns: 1fr;
    }

    .moodfood-results-heading {
        align-items: flex-start;
    }

    .results-leaf {
        display: none;
    }
}

@media (max-width: 639px) {
    .moodfood-brand > span:last-child {
        display: flex;
        flex-direction: column;
        gap: 0;
        line-height: 1.2;
    }

    .moodfood-progress {
        margin-top: 20px;
        margin-bottom: 24px;
    }

    .moodfood-progress li span {
        max-width: 54px;
        line-height: 1.3;
    }

    .moodfood-progress li b {
        width: 30px;
        height: 30px;
    }

    .progress-line {
        top: 14px;
    }

    .moodfood-page .moodfood-workspace {
        padding-bottom: 48px;
    }

    .moodfood-hero {
        min-height: 380px;
    }

    .moodfood-sun {
        top: 36px;
        right: 36px;
        width: 72px;
        height: 72px;
    }

    .moodfood-greeting p {
        font-size: 16px;
    }

    .moodfood-start-panel,
    .moodfood-stage-aside,
    .moodfood-page .moodfood-card,
    .moodfood-results-stage,
    .moodfood-pending {
        padding: 20px;
    }

    .moodfood-card-heading {
        flex-direction: column;
    }

    .moodfood-page .live-toggle-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .moodfood-page .live-pending-card {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .moodfood-page .live-pending-photo {
        width: 80px;
    }

    .moodfood-page .live-toggle-row,
    .moodfood-page .live-external-links {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .moodfood-page .live-flex,
    .moodfood-page .moodfood-more-button {
        width: 100%;
    }

    .moodfood-footer {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .moodfood-page *,
    .moodfood-page *::before,
    .moodfood-page *::after {
        scroll-behavior: auto;
        animation-duration: .01ms;
        animation-iteration-count: 1;
        transition-duration: .01ms;
    }

    .moodfood-page .live-btn:hover:not(:disabled),
    .moodfood-page .live-toggle:hover,
    .moodfood-page .live-card:hover,
    .moodfood-page .live-star:hover {
        transform: none;
    }
}

/* Final meal-record component sizing (kept last to override legacy rules). */
.moodfood-content-page .mr-stats-nav { width: 100%; justify-content: space-between; }
.moodfood-content-page .mr-stats-nav .live-btn { width: 48px; min-width: 48px; min-height: 48px; padding: 0; border-radius: 24px; }
.moodfood-content-page .mr-stat-row { gap: 8px; }
.moodfood-content-page .mr-stat { min-width: 0; padding: 12px 6px; border-radius: 18px; background: var(--mf-primary-50); }
.moodfood-content-page .mr-stat-value { overflow-wrap: anywhere; color: var(--mf-primary-700); font-size: 16px; }
.moodfood-content-page .mr-stat small,
.moodfood-content-page .mr-photo-hint,
.moodfood-content-page .mr-photo-caption { font-size: 16px; }
.moodfood-content-page .mr-photo-picker { align-items: stretch; flex-direction: column; }
.moodfood-content-page #mr-add-photo-btn,
.moodfood-content-page .mr-submit-btn { width: 100%; }
.moodfood-content-page .mr-icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.moodfood-content-page .mr-icon-button svg,
.moodfood-content-page .mr-retake-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.moodfood-content-page .mr-previews { display: grid; gap: 8px; }
.moodfood-content-page .mr-preview img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 18px; object-fit: cover; }
.moodfood-content-page .mr-preview-remove { width: 32px !important; height: 32px !important; min-height: 32px; }
.moodfood-content-page .mr-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.moodfood-content-page .mr-photo-grid-1 { grid-template-columns: 1fr; }
.moodfood-content-page .mr-photo { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 18px; object-fit: cover; }
.moodfood-content-page .mr-retake-btn { display: inline-flex; min-width: 48px; min-height: 48px; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border-radius: 24px; font-size: 16px; }
.moodfood-content-page .mr-actions,
.moodfood-content-page .mr-edit-form .mp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.moodfood-content-page .mr-delete { border: 1px solid var(--mf-danger); color: var(--mf-danger); background: #fff; }

.moodfood-content-page #mr-add-form .live-field > input,
.moodfood-content-page .mr-edit-form .live-field > input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 56px;
    min-height: 56px;
    padding: 0 20px;
    border-radius: 18px;
}

.moodfood-content-page #mr-add-form input[type="date"],
.moodfood-content-page .mr-edit-form input[type="date"] {
    inline-size: 100%;
    block-size: 56px;
}

@media (max-width: 639px) {
    .moodfood-content-page #mr-add-form .live-form-row,
    .moodfood-content-page .mr-edit-form .live-form-row {
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
    }

    .moodfood-content-page #mr-add-form .live-field,
    .moodfood-content-page .mr-edit-form .live-field {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .moodfood-content-page #mr-add-form input[type="date"],
    .moodfood-content-page .mr-edit-form input[type="date"] {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        -webkit-appearance: none;
        appearance: none;
    }

    .moodfood-content-page input[type="date"]::-webkit-date-and-time-value {
        min-width: 0;
        text-align: left;
    }

    .moodfood-content-page input[type="date"]::-webkit-calendar-picker-indicator {
        width: 24px;
        height: 24px;
        flex: 0 0 24px;
        margin: 0;
        padding: 0;
    }
}


/* Keep native date controls the same size as adjacent amount inputs. */
.moodfood-content-page #mr-add-form .live-field > input,
.moodfood-content-page .mr-edit-form .live-field > input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 56px;
    min-height: 56px;
    padding: 0 20px;
    border-radius: 18px;
}

.moodfood-content-page #mr-add-form input[type="date"],
.moodfood-content-page .mr-edit-form input[type="date"] {
    inline-size: 100%;
    block-size: 56px;
}

/* Meal photo / record screen follows the same 390px product system. */
.moodfood-content-page .mr-stats-panel,
.moodfood-content-page #mr-add-form,
.moodfood-content-page .mr-edit-form {
    gap: 16px;
}

.moodfood-content-page .mr-stats-head {
    align-items: flex-start;
}

.moodfood-content-page .mr-stats-nav {
    width: 100%;
    justify-content: space-between;
}

.moodfood-content-page .mr-stats-nav .live-btn {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 24px;
}

.moodfood-content-page .mr-stat-row {
    gap: 8px;
}

.moodfood-content-page .mr-stat {
    min-width: 0;
    padding: 12px 6px;
    border-radius: 18px;
    background: var(--mf-primary-50);
}

.moodfood-content-page .mr-stat-value {
    overflow-wrap: anywhere;
    color: var(--mf-primary-700);
    font-size: 16px;
}

.moodfood-content-page .mr-stat small,
.moodfood-content-page .mr-photo-hint,
.moodfood-content-page .mr-photo-caption {
    font-size: 16px;
}

.moodfood-content-page .mr-photo-picker {
    align-items: stretch;
    flex-direction: column;
}

.moodfood-content-page #mr-add-photo-btn,
.moodfood-content-page .mr-submit-btn {
    width: 100%;
}

.moodfood-content-page .mr-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.moodfood-content-page .mr-icon-button svg,
.moodfood-content-page .mr-retake-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.moodfood-content-page .mr-previews {
    display: grid;
    gap: 8px;
}

.moodfood-content-page .mr-preview img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 18px;
    object-fit: cover;
}

.moodfood-content-page .mr-preview-remove {
    width: 32px !important;
    height: 32px !important;
    min-height: 32px;
}

.moodfood-content-page .mr-photo-grid {
    gap: 10px;
}

.moodfood-content-page .mr-photo-grid-1 {
    grid-template-columns: 1fr;
}

.moodfood-content-page .mr-photo {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    object-fit: cover;
}

.moodfood-content-page .mr-retake-btn {
    width: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mf-primary-700) !important;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 24px;
    font-size: 16px;
}

.moodfood-content-page .mr-actions,
.moodfood-content-page .mr-edit-form .mp-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.moodfood-content-page .mr-delete {
    border: 1px solid var(--mf-danger);
    color: var(--mf-danger);
    background: #fff;
}

@media (max-width: 360px) {
    .moodfood-content-page .mr-stat-row {
        grid-template-columns: 1fr;
    }

    .moodfood-content-page .mr-photo-grid {
        grid-template-columns: 1fr;
    }
}

@media (forced-colors: active) {
    .moodfood-page .live-toggle-selected,
    .moodfood-progress li.is-current b,
    .moodfood-progress li.is-complete b {
        border: 2px solid CanvasText;
    }

    .moodfood-page :focus-visible {
        outline-color: Highlight;
    }
}

/* ========================================================================== */
/* Mobile canvas correction                                                    */
/* The product is intentionally presented as a 572:1024 mobile experience,    */
/* even when previewed from a desktop browser.                                 */
/* ========================================================================== */

.moodfood-page {
    width: min(100%, 390px);
    min-height: unset !important;
    margin-inline: auto;
    border-inline: 1px solid var(--mf-neutral-300);
    box-shadow: 0 0 48px rgb(36 35 31 / 18%);
}

.moodfood-page .container-xl,
.moodfood-page .container-fluid {
    width: calc(100% - 24px);
    max-width: 100%;
}

.moodfood-nav {
    min-height: 64px;
    gap: 12px;
}

.moodfood-nav-actions {
    position: absolute;
    top: 58px;
    right: 0;
    display: none;
    width: min(300px, calc(100vw - 24px));
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 16px;
    background: var(--mf-neutral-0);
    box-shadow: var(--mf-shadow-lg);
}

.moodfood-nav-actions > a,
.moodfood-account,
.moodfood-ghost-button {
    width: 100%;
    justify-content: flex-start;
    padding-inline: 14px;
}

.moodfood-nav-actions form {
    width: 100%;
}

.moodfood-timebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    min-height: auto;
    margin-top: 4px;
    padding: 10px 12px;
}

.moodfood-timebar p {
    width: 100%;
}

.moodfood-timebar small {
    display: none;
}

.timebar-options {
    width: 100%;
    gap: 2px;
}

.timebar-chip {
    min-width: 0;
    flex: 1 1 25%;
    padding-inline: 6px;
}

.moodfood-progress {
    margin-top: 20px;
    margin-bottom: 24px;
    padding-inline: 0;
}

.moodfood-progress li span {
    max-width: 58px;
    font-size: 11px;
    line-height: 1.3;
}

.moodfood-progress li b {
    width: 30px;
    height: 30px;
}

.progress-line {
    top: 14px;
}

.moodfood-page .moodfood-workspace {
    padding-bottom: 40px;
}

/* Home keeps the user-provided portrait artwork as the primary canvas. */

.moodfood-home-stage {
    position: relative;
    display: block;
}

.moodfood-home-canvas {
    position: relative;
}

.moodfood-hero {
    width: 100%;
    min-height: 0;
    aspect-ratio: 572 / 1024;
    border-radius: 20px;
}

.moodfood-hero-image {
    object-fit: cover;
    object-position: center;
    filter: none;
}

.moodfood-hero-tint {
    background:
        linear-gradient(180deg, rgb(36 35 31 / 34%), transparent 34%),
        linear-gradient(0deg, rgb(36 35 31 / 36%), transparent 34%);
}

.moodfood-sun,
.moodfood-leaf {
    display: none;
}

.moodfood-greeting {
    top: 32px;
    right: 24px;
    bottom: auto;
    left: 24px;
    width: auto;
    transform: none;
}

.moodfood-greeting h1 {
    margin-block: 8px;
    font-size: clamp(34px, 10vw, 48px);
    line-height: 1.08;
}

.moodfood-greeting p {
    font-size: 15px;
}

.moodfood-start-panel {
    position: static;
    z-index: 4;
    right: auto;
    bottom: 18px;
    left: 16px;
    display: flex;
    width: min(14rem, calc(100% - 32px));
    min-height: 0;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.moodfood-start-panel > div:first-child {
    display: none;
}

.moodfood-location-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
}

.location-icon {
    display: none;
}

.location-copy strong {
    display: none;
}

.moodfood-page .moodfood-location-card .live-btn {
    width: 100%;
    min-height: 44px;
    padding-inline: 12px;
    font-size: 13px;
}

.moodfood-page .moodfood-location-card .live-location-status,
.moodfood-page .moodfood-location-card .live-location-error {
    padding: 7px 10px;
    border-radius: 10px;
    color: var(--mf-neutral-0);
    background: rgb(36 35 31 / 78%);
    text-align: center;
    backdrop-filter: blur(8px);
}

.moodfood-page .moodfood-location-card .live-location-error {
    background: rgb(163 70 58 / 92%);
}

.moodfood-page .moodfood-primary {
    min-height: 50px;
}

.moodfood-text-button {
    min-height: 36px;
    padding-block: 4px;
    color: var(--mf-neutral-0);
    background: rgb(36 35 31 / 48%);
    border-radius: 10px;
    font-size: 12px;
    text-shadow: 0 1px 4px rgb(0 0 0 / 35%);
    backdrop-filter: blur(6px);
}

.moodfood-pending {
    margin-top: 16px;
    padding: 18px;
    border-radius: 18px;
}

.pending-heading h2 {
    font-size: 20px;
}

.moodfood-page .live-pending-list,
.moodfood-page .live-restaurant-list {
    grid-template-columns: 1fr;
}

/* Profile and query use the second portrait artwork as a phone background. */

.moodfood-form-stage {
    display: block;
    overflow: hidden;
    border-radius: 20px;
    background:
        linear-gradient(rgb(255 253 248 / 72%), rgb(255 253 248 / 88%)),
        url("img/selectfoodbg.jpg") top center / cover no-repeat;
    box-shadow: var(--mf-shadow-md);
}

.moodfood-stage-aside {
    display: none;
}

.moodfood-page .moodfood-card {
    min-height: 0;
    gap: 20px;
    padding: 20px;
    border-radius: 18px;
    background: rgb(255 255 255 / 90%);
    box-shadow: 0 8px 28px rgb(60 42 26 / 14%);
    backdrop-filter: blur(8px);
}

.moodfood-card-heading {
    flex-direction: column;
    gap: 10px;
    padding-bottom: 18px;
}

.moodfood-card-heading h1 {
    font-size: 26px;
}

.moodfood-page .live-form-row,
.moodfood-inline-fields {
    grid-template-columns: 1fr;
}

.moodfood-page .live-toggle-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.moodfood-page .moodfood-loading {
    margin-top: 16px;
}

/* Results remain a single, readable mobile feed. */

.moodfood-results-stage {
    padding: 18px;
    border-radius: 20px;
}

.moodfood-results-heading {
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 18px;
}

.moodfood-results-heading h1 {
    font-size: 32px;
}

.results-leaf {
    display: none;
}

.moodfood-page .live-card:hover {
    transform: none;
}

.moodfood-page .live-toggle-row {
    flex-direction: column;
}

.moodfood-page .live-flex,
.moodfood-page .moodfood-more-button {
    width: 100%;
}

.moodfood-footer {
    min-height: 80px;
    align-items: flex-start;
    padding-inline: 12px;
}

@media (max-width: 420px) {
    .moodfood-brand > span:last-child {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
    }

    .timebar-chip span {
        display: none;
    }

    .moodfood-greeting {
        top: 24px;
        right: 18px;
        left: 18px;
    }

    .moodfood-greeting h1 {
        font-size: clamp(32px, 11vw, 42px);
    }

    .moodfood-start-panel {
        right: auto;
        bottom: 12px;
        left: 10px;
        width: min(13rem, calc(100% - 20px));
        padding: 0;
    }

    .moodfood-location-card {
        display: flex;
    }

    .moodfood-page .moodfood-location-card .live-btn {
        width: 100%;
    }

    .moodfood-page .moodfood-card,
    .moodfood-results-stage,
    .moodfood-pending {
        padding: 16px;
    }
}

/* Home ends with the mobile navigation; do not extend a white canvas below it. */
.page-shell.moodfood-shell:has(#live-step-home:not([hidden])),
.moodfood-page:has(#live-step-home:not([hidden])) {
    min-height: 0;
}

.moodfood-page:has(#live-step-home:not([hidden])) {
    background: transparent;
}

/* Time-of-day artwork and reference-screen alignment. */

.moodfood-timebar,
.moodfood-progress {
    display: none;
}

.moodfood-page .moodfood-workspace {
    width: calc(100% - 16px);
    padding-top: 8px;
}

.moodfood-hero-tint {
    background: linear-gradient(180deg, rgb(255 253 248 / 12%), transparent 36%, rgb(36 35 31 / 12%));
}

.moodfood-page[data-theme="morning"] .moodfood-greeting,
.moodfood-page[data-theme="afternoon"] .moodfood-greeting,
.moodfood-page[data-theme="evening"] .moodfood-greeting {
    color: var(--mf-primary-900);
}

.moodfood-page[data-theme="morning"] .moodfood-greeting .moodfood-kicker,
.moodfood-page[data-theme="afternoon"] .moodfood-greeting .moodfood-kicker,
.moodfood-page[data-theme="evening"] .moodfood-greeting .moodfood-kicker,
.moodfood-page[data-theme="morning"] .moodfood-greeting p,
.moodfood-page[data-theme="afternoon"] .moodfood-greeting p,
.moodfood-page[data-theme="evening"] .moodfood-greeting p {
    color: var(--mf-primary-900);
    text-shadow: 0 1px 8px rgb(255 253 248 / 80%);
}

.moodfood-page[data-theme="night"] .moodfood-greeting,
.moodfood-page[data-theme="night"] .moodfood-greeting .moodfood-kicker,
.moodfood-page[data-theme="night"] .moodfood-greeting p {
    color: var(--mf-neutral-0);
    text-shadow: 0 2px 12px rgb(0 0 0 / 54%);
}

.moodfood-start-panel {
    right: 16px;
    left: 16px;
    width: auto;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgb(255 255 255 / 70%);
    border-radius: 22px;
    background: rgb(255 253 248 / 91%);
    box-shadow: 0 14px 36px rgb(60 42 26 / 20%);
    backdrop-filter: blur(12px);
}

.moodfood-start-panel > div:first-child {
    display: block;
}

.moodfood-start-panel > div:first-child .moodfood-kicker {
    font-size: 10px;
}

.moodfood-start-panel h2 {
    margin: 4px 0;
    font-size: 18px;
    line-height: 1.35;
}

.moodfood-start-panel > div > p {
    display: none;
}

.moodfood-location-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.location-copy {
    display: none;
}

.moodfood-page .moodfood-location-card .live-btn {
    grid-column: 1 / -1;
}

.moodfood-text-button {
    color: var(--mf-neutral-600);
    background: transparent;
    text-shadow: none;
    backdrop-filter: none;
}

@media (max-width: 420px) {
    .moodfood-start-panel {
        right: 10px;
        left: 10px;
        width: auto;
        padding: 13px;
    }

    .moodfood-start-panel h2 {
        font-size: 16px;
    }
}

/* Final mobile reference layout: overlay header, AI card, bottom navigation. */

.moodfood-page {
    position: relative;
}

.moodfood-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.moodfood-nav {
    position: absolute;
    z-index: 30;
    top: 14px;
    right: 18px;
    left: 18px;
    width: auto;
    min-height: 44px;
    margin: 0;
    pointer-events: none;
}

.moodfood-brand {
    display: none;
}

.moodfood-nav-actions {
    top: 50px;
    right: 0;
    pointer-events: auto;
}

.moodfood-page .moodfood-workspace {
    width: 100%;
    padding: 0;
}

.moodfood-page .moodfood-alert {
    position: absolute;
    z-index: 40;
    top: 68px;
    right: 16px;
    left: 16px;
    margin: 0;
}

.moodfood-hero {
    border-radius: 0 0 24px 24px;
    box-shadow: none;
}

.moodfood-greeting {
    top: 25%;
    right: 48px;
    left: 48px;
}

.moodfood-greeting .moodfood-kicker {
    display: none;
}

.moodfood-greeting h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 9vw, 42px);
    line-height: 1.12;
}

.moodfood-greeting p {
    margin: 0;
    max-width: 23em;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    transform: none;
}

.moodfood-start-panel {
    right: 18px;
    bottom: 34px;
    left: 18px;
    display: block;
    padding: 18px 72px 18px 18px;
    border-radius: 24px;
}

.moodfood-ai-card-copy {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
}

.moodfood-ai-pot {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 14px;
    color: var(--mf-theme-strong);
    background: var(--mf-theme-soft);
    font-size: 22px;
}

.moodfood-start-panel .moodfood-kicker {
    color: var(--mf-neutral-600);
    font-size: 9px;
    letter-spacing: .1em;
}

.moodfood-start-panel h2 {
    margin: 2px 0;
    color: var(--mf-neutral-900);
    font-size: 17px;
    line-height: 1.35;
}

.moodfood-start-panel .moodfood-ai-card-copy p {
    display: block;
    margin: 0;
    color: var(--mf-neutral-700);
    font-size: 11px;
    line-height: 1.5;
}

.moodfood-location-card {
    position: static;
    top: 50%;
    right: 16px;
    display: block;
    width: 46px;
    height: 46px;
    transform: none;
}

.moodfood-page .moodfood-location-card .live-btn,
.moodfood-page #live-start-btn {
    display: grid;
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--mf-neutral-0);
    background: var(--mf-theme-strong);
    box-shadow: 0 6px 16px rgb(60 42 26 / 24%);
    font-size: 22px;
}

.moodfood-page #live-start-btn {
    position: static;
    z-index: 2;
    top: 50%;
    right: 16px;
    transform: none;
}

.moodfood-page #live-start-btn:hover:not(:disabled) {
    background: var(--mf-theme-strong);
    transform: none;
}

.moodfood-page .moodfood-location-card .live-btn:hover:not(:disabled) {
    background: var(--mf-theme-strong);
    transform: scale(1.04);
}

.moodfood-page #live-start-btn:disabled {
    display: none;
}

.moodfood-page #live-start-btn:not(:disabled) {
    display: grid;
}

.moodfood-text-button {
    position: absolute;
    right: 18px;
    bottom: 4px;
    min-height: 24px;
    padding: 2px 4px;
    color: var(--mf-neutral-600);
    font-size: 9px;
    text-decoration: none;
}

.moodfood-bottom-nav {
    position: sticky;
    z-index: 24;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 96px;
    overflow: hidden;
    border-top: 1px solid var(--mf-neutral-300);
    border-radius: 22px 22px 0 0;
    background: rgb(255 253 248 / 96%);
    box-shadow: 0 -8px 24px rgb(60 42 26 / 10%);
    backdrop-filter: blur(12px);
}

.moodfood-bottom-nav a,
.moodfood-bottom-nav button {
    display: flex;
    min-width: 0;
    min-height: 80px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 8px 4px;
    padding: 7px 4px;
    border: 0;
    border-radius: 24px;
    color: var(--mf-neutral-700);
    background: transparent;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.moodfood-bottom-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
}

.moodfood-bottom-icon svg {
    width: 39px;
    height: 39px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.moodfood-bottom-nav small {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.moodfood-bottom-nav .is-current {
    color: var(--mf-primary-700);
    background: var(--mf-primary-100);
}

.moodfood-bottom-nav .is-current small {
    font-weight: 800;
}

.moodfood-account-dialog {
    width: min(420px, calc(100% - 32px));
    padding: 24px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 26px;
    color: var(--mf-neutral-900);
    background: var(--mf-neutral-50);
    box-shadow: var(--mf-shadow-lg);
}

.moodfood-account-dialog::backdrop {
    background: rgb(36 35 31 / 46%);
    backdrop-filter: blur(3px);
}

.moodfood-account-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--mf-neutral-300);
}

.moodfood-account-dialog-header h2 {
    margin: 4px 0 0;
    color: var(--mf-primary-700);
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 28px;
}

.moodfood-account-close {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 50%;
    color: var(--mf-neutral-700);
    background: var(--mf-neutral-0);
    font-size: 28px;
    line-height: 1;
}

.moodfood-account-details {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.moodfood-account-details div {
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--mf-primary-50);
}

.moodfood-account-details dt {
    color: var(--mf-neutral-600);
    font-size: 12px;
    font-weight: 700;
}

.moodfood-account-details dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    font-size: 16px;
    font-weight: 800;
}

.moodfood-account-status {
    min-height: 1.5em;
    margin: 0 0 8px;
    color: var(--mf-success);
    font-size: 13px;
}

.moodfood-account-actions {
    display: grid;
    gap: 10px;
}

.moodfood-account-actions form {
    margin: 0;
}

.moodfood-account-secondary,
.moodfood-account-logout {
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
}

.moodfood-account-secondary {
    border: 1px solid var(--mf-primary-300);
    color: var(--mf-primary-700);
    background: var(--mf-neutral-0);
}

.moodfood-account-logout {
    border: 1px solid var(--mf-primary-700);
    color: var(--mf-neutral-0);
    background: var(--mf-primary-700);
}

.moodfood-footer {
    display: none;
}

@media (max-width: 420px) {
    .moodfood-greeting {
        top: 25%;
        right: 34px;
        left: 34px;
    }

    .moodfood-start-panel {
        right: 12px;
        bottom: 24px;
        left: 12px;
        width: auto;
        padding: 14px 64px 14px 14px;
    }

    .moodfood-ai-card-copy {
        gap: 9px;
    }

    .moodfood-ai-pot {
        width: 36px;
        height: 36px;
        font-size: 19px;
    }

    .moodfood-start-panel h2 {
        font-size: 15px;
    }

    .moodfood-start-panel .moodfood-ai-card-copy p {
        font-size: 10px;
    }

    .moodfood-location-card,
    .moodfood-page #live-start-btn {
        right: 12px;
    }
}

/* Approved composition: separate location card and recommendation card. */

.moodfood-location-card {
    position: static;
    z-index: 5;
    top: auto;
    right: auto;
    bottom: 232px;
    left: 18px;
    display: grid;
    width: calc(100% - 36px);
    height: auto;
    grid-template-columns: 30px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    padding: 13px 16px;
    border: 1px solid rgb(255 255 255 / 68%);
    border-radius: 20px;
    background: rgb(255 253 248 / 90%);
    box-shadow: 0 10px 28px rgb(60 42 26 / 18%);
    transform: none;
    backdrop-filter: blur(12px);
}

.location-icon {
    display: grid;
    width: 28px;
    height: 32px;
    place-items: center;
    color: var(--mf-theme-strong);
}

.location-icon svg {
    width: 24px;
    height: 24px;
    fill: currentcolor;
}

.location-copy {
    display: block;
    min-width: 0;
}

.location-copy strong {
    display: block;
    color: var(--mf-neutral-900);
    font-size: 17px;
    line-height: 1.35;
    transform: none;
}

.location-copy .location-description,
.moodfood-page .moodfood-location-card .live-location-status,
.moodfood-page .moodfood-location-card .live-location-error {
    margin: 2px 0 0;
    padding: 0;
    border-radius: 0;
    color: var(--mf-neutral-700);
    background: transparent;
    font-size: 12px;
    text-align: left;
    backdrop-filter: none;
}

.moodfood-page .moodfood-location-card .live-location-status {
    color: var(--mf-success);
}

.moodfood-page .moodfood-location-card .live-location-error {
    color: var(--mf-danger);
}

.moodfood-page .moodfood-location-card .live-btn {
    display: grid;
    grid-column: auto;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--mf-theme-strong);
    background: transparent;
    box-shadow: none;
}

.moodfood-page .moodfood-location-card .live-btn:hover:not(:disabled) {
    color: var(--mf-theme-strong);
    background: var(--mf-theme-soft);
    transform: scale(1.04);
}

.moodfood-locate-target {
    width: 32px;
    height: 32px;
    overflow: visible;
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-width: 2.2;
}

.moodfood-locate-target .target-dot {
    fill: currentcolor;
    stroke: none;
}

.moodfood-start-panel {
    right: 18px;
    bottom: 26px;
    left: 18px;
    display: block;
    padding: 18px 18px 16px;
    border-radius: 24px;
    background: rgb(255 253 248 / 94%);
}

.moodfood-start-panel > .moodfood-ai-card-copy {
    display: grid;
    min-height: 78px;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding-right: 58px;
}

.moodfood-ai-pot {
    display: grid;
    width: 56px;
    height: 64px;
    place-items: center;
    border-radius: 0;
    background: transparent;
    line-height: 1;
}

.moodfood-ai-pot svg {
    width: 56px;
    height: 64px;
    overflow: visible;
}

.moodfood-ai-pot .plant-stem {
    fill: none;
    stroke: #7d765f;
    stroke-linecap: round;
    stroke-width: 2;
}

.moodfood-ai-pot .plant-leaf-a {
    fill: var(--mf-theme-mid);
}

.moodfood-ai-pot .plant-leaf-b {
    fill: var(--mf-theme-strong);
    opacity: .72;
}

.moodfood-ai-pot .plant-rim {
    fill: #9d795d;
    stroke: #5e5249;
    stroke-width: 1.2;
}

.moodfood-ai-pot .plant-pot {
    fill: #b58b69;
    stroke: #5e5249;
    stroke-width: 1.2;
}

.moodfood-start-panel h2 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
}

.moodfood-start-panel .moodfood-ai-card-copy p {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
}

.moodfood-ai-arrow {
    position: absolute;
    top: 40px;
    right: 18px;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    color: var(--mf-neutral-0);
    background: var(--mf-theme-strong);
    box-shadow: 0 6px 16px rgb(60 42 26 / 20%);
    font-size: 27px;
    line-height: 1;
}

.moodfood-page #live-start-btn,
.moodfood-page #live-start-btn:disabled,
.moodfood-page #live-start-btn:not(:disabled) {
    position: static;
    display: flex;
    width: 100%;
    min-width: 0;
    height: 58px;
    min-height: 58px;
    margin-top: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    color: var(--mf-neutral-0);
    background: var(--mf-theme-strong);
    box-shadow: 0 8px 20px rgb(60 42 26 / 20%);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .04em;
    opacity: 1;
    transform: none;
}

.moodfood-page #live-start-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.moodfood-page #live-start-btn:hover:not(:disabled) {
    background: var(--mf-theme-strong);
    transform: none;
}

.moodfood-nav-actions .moodfood-text-button {
    position: static;
    width: 100%;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--mf-neutral-700);
    background: transparent;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
}

.moodfood-nav-actions .moodfood-text-button:hover {
    color: var(--mf-primary-800);
    background: var(--mf-primary-100);
}

@media (max-width: 420px) {
    .moodfood-location-card {
        right: auto;
        bottom: 232px;
        left: 12px;
        width: calc(100% - 24px);
        grid-template-columns: 26px minmax(0, 1fr) 34px;
        padding: 13px 14px;
    }

    .location-icon {
        width: 24px;
        height: 30px;
    }

    .moodfood-page .moodfood-location-card .live-btn {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
    }

    .moodfood-start-panel {
        right: 12px;
        bottom: 18px;
        left: 12px;
        height: 187px;
        padding: 18px 16px 16px;
    }

    .moodfood-start-panel > .moodfood-ai-card-copy {
        min-height: 78px;
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 12px;
        padding-right: 0;
    }

    .moodfood-ai-pot {
        width: 56px;
        height: 66px;
    }

    .moodfood-ai-pot svg {
        width: 56px;
        height: 66px;
    }

    .moodfood-start-panel h2 {
        margin-bottom: 8px;
        font-size: 19px;
    }

    .moodfood-start-panel .moodfood-ai-card-copy p {
        font-size: 13px;
        line-height: 1.55;
    }

    .moodfood-ai-arrow {
        top: 52px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 27px;
    }

    .moodfood-page #live-start-btn,
    .moodfood-page #live-start-btn:disabled,
    .moodfood-page #live-start-btn:not(:disabled) {
        height: 54px;
        min-height: 54px;
        margin-top: 12px;
        font-size: 21px;
    }
}

/* Keep the recommendation illustration and copy on one row.  The home ID is
   intentional: it outranks the legacy `div:first-child` mobile rule above. */
#live-step-home .moodfood-start-panel > .moodfood-ai-card-copy {
    display: grid;
}


/* Fifth book · Profile Setup production screen */
#live-step-profile {
    min-height: 0;
    padding: 76px 14px 18px;
    border-radius: 0;
    background:
        radial-gradient(circle at 92% 8%, var(--mf-theme-glow), transparent 12rem),
        radial-gradient(circle at 5% 88%, var(--mf-theme-soft), transparent 15rem),
        #fffaf2;
    box-shadow: none;
}

#live-step-profile .moodfood-card {
    gap: 18px;
    padding: 18px;
    border: 0;
    border-radius: 24px;
    background: rgb(255 253 248 / 92%);
    box-shadow: 0 14px 38px rgb(60 42 26 / 12%);
}

#live-step-profile .moodfood-card-heading {
    align-items: center;
    gap: 8px;
    padding: 0 8px 16px;
    border: 0;
    text-align: center;
}

#live-step-profile .moodfood-step-number {
    min-width: 68px;
    color: var(--mf-theme-strong);
    background: var(--mf-theme-soft);
}

#live-step-profile .moodfood-card-heading h1 {
    margin-bottom: 5px;
    font-size: 24px;
}

#live-step-profile .moodfood-card-heading p {
    font-size: 13px;
    line-height: 1.55;
}

#live-step-profile .live-form-row,
#live-step-profile .live-field-group {
    padding: 14px;
    border: 1px solid rgb(231 226 216 / 80%);
    border-radius: 18px;
    background: rgb(255 255 255 / 78%);
    box-shadow: 0 6px 18px rgb(60 42 26 / 6%);
}

#live-step-profile .live-form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#live-step-profile .moodfood-field-title,
#live-step-profile .live-field > span {
    color: var(--mf-neutral-900);
    font-size: 14px;
}

#live-step-profile .live-field input,
#live-step-profile .live-field select {
    min-height: 46px;
    border-color: var(--mf-neutral-300);
    border-radius: 14px;
    background: #fffdf8;
}

#live-step-profile .live-toggle {
    min-height: 46px;
    border-radius: 14px;
    background: #fffaf2;
}

#live-step-profile .live-toggle-selected {
    border-color: var(--mf-theme-strong);
    color: #fff;
    background: var(--mf-theme-strong);
    box-shadow: 0 6px 14px var(--mf-theme-glow);
}

#live-step-profile .moodfood-primary {
    min-height: 54px;
    border-radius: 999px;
    background: var(--mf-theme-strong);
    font-size: 17px;
    font-weight: 800;
}

@media (max-width: 360px) {
    #live-step-profile {
        padding-inline: 10px;
    }

    #live-step-profile .moodfood-card {
        padding: 14px;
    }

    #live-step-profile .live-form-row {
        grid-template-columns: 1fr;
    }
}

/* Shared MoodFood pages --------------------------------------------------- */

.moodfood-support-page {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow-x: hidden;
    border: 0;
    box-shadow: none;
}

.moodfood-support-page .moodfood-nav {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: min(calc(100% - 32px), 1280px);
    min-height: 76px;
    margin: 0 auto 24px;
    pointer-events: auto;
}

.moodfood-support-page .moodfood-brand {
    display: inline-flex;
    min-width: 210px;
}

.moodfood-support-page .moodfood-nav-actions {
    position: static;
    display: flex;
    min-width: 0;
    margin-left: auto;
    pointer-events: auto;
}

.moodfood-support-page .moodfood-nav-actions > a,
.moodfood-support-page .moodfood-account,
.moodfood-support-page .moodfood-ghost-button {
    width: auto;
    white-space: nowrap;
}

.moodfood-support-page img,
.moodfood-support-page canvas {
    max-width: 100%;
}

.moodfood-support-page .moodfood-nav-actions > a.is-active {
    color: var(--mf-theme-strong);
    background: var(--mf-theme-soft);
}

.moodfood-support-main {
    width: min(calc(100% - 32px), 1120px);
    margin-inline: auto;
}

.moodfood-page-heading {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 34px 38px;
    overflow: hidden;
    border: 1px solid rgb(231 226 216 / 84%);
    border-radius: 30px;
    background:
        radial-gradient(circle at 92% 18%, var(--mf-theme-glow), transparent 13rem),
        linear-gradient(135deg, rgb(255 253 248 / 97%), var(--mf-theme-soft));
    box-shadow: var(--mf-shadow-md);
}

.moodfood-page-heading::after {
    position: absolute;
    right: 32px;
    bottom: -34px;
    color: rgb(255 255 255 / 64%);
    font-size: 130px;
    line-height: 1;
    content: "❆";
    transform: rotate(16deg);
}

.moodfood-page-heading > * {
    position: relative;
    z-index: 1;
}

.moodfood-page-heading .moodfood-kicker,
.moodfood-auth-card .moodfood-kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--mf-theme-strong);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.moodfood-page-heading h1 {
    margin: 0;
    color: var(--mf-primary-700);
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2rem, 4vw, 3.3rem);
    font-weight: 700;
    letter-spacing: -.04em;
}

.moodfood-page-heading p {
    max-width: 680px;
    margin: 9px 0 0;
    color: var(--mf-neutral-700);
}

.moodfood-page-heading-icon {
    display: grid;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 72%);
    border-radius: 24px;
    color: var(--mf-theme-strong);
    background: rgb(255 255 255 / 66%);
    box-shadow: var(--mf-shadow-sm);
    font-size: 34px;
}

.moodfood-content-surface {
    padding: 30px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 28px;
    background: rgb(255 253 248 / 92%);
    box-shadow: var(--mf-shadow-md);
}

.moodfood-content-page .favorites-page.panel {
    max-width: none;
    margin: 0;
    padding: 30px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 28px;
    background: rgb(255 253 248 / 92%);
    box-shadow: var(--mf-shadow-md);
}

.moodfood-content-page .favorites-heading {
    margin-bottom: 24px;
}

.moodfood-content-page .favorites-heading .eyebrow {
    margin-bottom: 6px;
    color: var(--mf-theme-strong);
    font-weight: 900;
    letter-spacing: .15em;
}

.moodfood-collection-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 999px;
    background: rgb(255 253 248 / 90%);
    box-shadow: var(--mf-shadow-sm);
}

.moodfood-collection-tabs a {
    min-width: 0;
    flex: 1;
    padding: 11px 16px;
    border-radius: 999px;
    color: var(--mf-neutral-700);
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.moodfood-collection-tabs a.is-current {
    color: var(--mf-neutral-0);
    background: var(--mf-primary-700);
}

.moodfood-content-page .favorite-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.moodfood-content-page .favorite-card {
    display: grid;
    min-width: 0;
    grid-template-columns: 180px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 24px;
    background: var(--mf-neutral-0);
    box-shadow: var(--mf-shadow-sm);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.moodfood-content-page .favorite-card:hover {
    border-color: var(--mf-primary-300);
    box-shadow: var(--mf-shadow-md);
    transform: translateY(-3px);
}

.moodfood-content-page .favorite-photo {
    width: 100%;
    height: 100%;
    min-height: 220px;
    border-radius: 0;
    object-fit: cover;
}

.moodfood-content-page .favorite-photo-empty {
    display: grid;
    place-items: center;
    padding: 20px;
    color: var(--mf-neutral-600);
    background: var(--mf-primary-50);
    text-align: center;
}

.moodfood-content-page .favorite-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
}

.moodfood-content-page .favorite-topline h2 {
    color: var(--mf-primary-900);
    font-size: 1.25rem;
    line-height: 1.35;
}

.moodfood-content-page .live-pill {
    border: 1px solid var(--mf-primary-200);
    color: var(--mf-primary-800);
    background: var(--mf-primary-50);
}

.moodfood-content-page .favorite-address {
    color: var(--mf-neutral-600);
    line-height: 1.65;
}

.moodfood-content-page .favorite-remove-btn {
    color: var(--mf-danger);
    background: #fff4f1;
}

.moodfood-content-page .live-btn,
.moodfood-content-page .mp-actions .live-btn {
    min-height: 44px;
    border-radius: 999px;
    font-weight: 800;
}

.moodfood-content-page .live-btn-nav {
    margin-top: auto;
    color: #fff;
    background: var(--mf-theme-strong);
}

.moodfood-content-page .empty-state,
.moodfood-content-page .mood-empty-state {
    padding: 54px 24px;
    border: 1px dashed var(--mf-primary-300);
    border-radius: 24px;
    color: var(--mf-neutral-700);
    background: var(--mf-primary-50);
    text-align: center;
}

.moodfood-content-page .empty-state::before {
    display: block;
    margin-bottom: 10px;
    color: var(--mf-theme-strong);
    font-size: 40px;
    content: "✿";
}

.moodfood-support-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.moodfood-support-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: min(calc(100% - 32px), 1120px);
    margin: 28px auto 0;
    color: var(--mf-neutral-600);
    font-size: 13px;
    text-align: center;
}

.moodfood-support-footer span {
    color: var(--mf-theme-strong);
}

/* Authentication */

.moodfood-auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
}

.moodfood-auth-wrap {
    width: min(100%, 980px);
    min-width: 0;
    max-width: 100%;
}

.moodfood-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    color: var(--mf-primary-900);
    font-size: 19px;
    font-weight: 900;
    text-decoration: none;
}

.moodfood-auth-layout {
    display: grid;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: minmax(260px, .85fr) minmax(360px, 1.15fr);
    overflow: hidden;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 32px;
    background: rgb(255 253 248 / 94%);
    box-shadow: var(--mf-shadow-lg);
}

.moodfood-auth-aside {
    display: flex;
    min-height: 560px;
    flex-direction: column;
    justify-content: flex-end;
    padding: 42px;
    color: #fff;
    background:
        radial-gradient(circle at 30% 20%, rgb(255 255 255 / 34%), transparent 10rem),
        linear-gradient(150deg, var(--mf-theme-mid), var(--mf-theme-strong));
}

.moodfood-auth-aside-icon {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    margin-bottom: auto;
    border: 1px solid rgb(255 255 255 / 48%);
    border-radius: 25px;
    background: rgb(255 255 255 / 18%);
    font-size: 36px;
}

.moodfood-auth-aside h2 {
    margin: 0 0 12px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
}

.moodfood-auth-aside p {
    margin: 0;
    color: rgb(255 255 255 / 86%);
}

.moodfood-auth-card.panel,
.moodfood-auth-card.register-panel {
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 48px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.moodfood-auth-card h1 {
    margin-bottom: 8px;
    color: var(--mf-primary-900);
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 2.25rem;
}

.moodfood-auth-card .summary {
    margin-bottom: 26px;
    color: var(--mf-neutral-600);
}

.moodfood-auth-card .filter-form {
    min-width: 0;
    gap: 18px;
}

.moodfood-auth-card .filter-form label {
    min-width: 0;
    color: var(--mf-neutral-800);
    font-size: 14px;
    font-weight: 800;
}

.moodfood-auth-card .filter-form input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 50px;
    margin-top: 7px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 14px;
    color: var(--mf-neutral-900);
    background: var(--mf-neutral-0);
}

.moodfood-auth-card .filter-form input:focus {
    border-color: var(--mf-theme-strong);
    box-shadow: 0 0 0 4px var(--mf-theme-glow);
}

.moodfood-auth-card .filter-form > button {
    min-height: 52px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--mf-theme-strong);
    box-shadow: 0 10px 22px var(--mf-theme-glow);
    font-weight: 900;
}

.moodfood-auth-card .form-errors,
.moodfood-auth-card .message-list {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 14px;
}

.moodfood-auth-card .form-errors {
    border: 1px solid rgb(163 70 58 / 24%);
    color: var(--mf-danger);
    background: #fff2ef;
}

.moodfood-auth-card .message-list {
    border: 1px solid rgb(63 118 82 / 24%);
    color: var(--mf-success);
    background: #eff8f1;
}

.moodfood-auth-card .auth-switch {
    color: var(--mf-neutral-600);
}

.moodfood-auth-card .auth-switch a {
    color: var(--mf-theme-strong);
    font-weight: 900;
}

.moodfood-auth-card .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Weekly mood */

.moodfood-content-page .mood-dashboard {
    width: auto;
    max-width: none;
    margin: 0;
}

.moodfood-content-page .mood-dashboard-header {
    margin-bottom: 20px;
    padding: 28px 30px;
    border: 1px solid var(--mf-neutral-300);
    border-radius: 28px;
    background: rgb(255 253 248 / 92%);
    box-shadow: var(--mf-shadow-md);
}

.moodfood-content-page .mood-title {
    color: var(--mf-primary-900);
    font-family: Georgia, "Noto Serif TC", serif;
}

.moodfood-content-page .mood-eyebrow {
    color: var(--mf-theme-strong);
}

.moodfood-content-page .mood-week-nav a {
    border-color: var(--mf-primary-200);
    color: var(--mf-theme-strong);
    background: var(--mf-primary-50);
}

.moodfood-content-page .mood-card,
.moodfood-content-page .ai-reminder-card {
    border: 1px solid var(--mf-neutral-300);
    border-radius: 24px;
    background: rgb(255 253 248 / 94%);
    box-shadow: var(--mf-shadow-sm);
}

.moodfood-content-page .ai-reminder-card {
    background: linear-gradient(135deg, var(--mf-theme-soft), var(--mf-neutral-0));
}

.moodfood-content-page .mood-timeline li {
    border-color: var(--mf-primary-200);
    background: var(--mf-primary-50);
}

/* Calorie records */

.moodfood-content-page .mp-kcal {
    display: inline-flex;
    align-self: flex-start;
    margin: 12px 0;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--mf-theme-strong);
    background: var(--mf-theme-soft);
    font-size: 15px;
    font-weight: 900;
}

.moodfood-content-page .mp-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.moodfood-content-page .mp-delete {
    border: 1px solid rgb(163 70 58 / 24%);
    color: var(--mf-danger);
    background: #fff2ef;
}

@media (max-width: 1023px) {
    .moodfood-support-page .moodfood-nav-actions {
        position: absolute;
        top: 68px;
        right: 0;
        display: none;
        width: min(320px, calc(100vw - 32px));
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px;
        border: 1px solid var(--mf-neutral-300);
        border-radius: 16px;
        background: var(--mf-neutral-0);
        box-shadow: var(--mf-shadow-lg);
    }

    .moodfood-support-page .moodfood-nav-actions > a,
    .moodfood-support-page .moodfood-account,
    .moodfood-support-page .moodfood-ghost-button {
        width: 100%;
        justify-content: flex-start;
    }

    .moodfood-content-page .favorite-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .moodfood-support-page {
        padding-bottom: 0;
    }

    .moodfood-support-page .moodfood-nav {
        width: calc(100% - 24px);
        min-height: 64px;
        margin: 0 auto 14px;
    }

    .moodfood-support-page .moodfood-nav-actions {
        top: 58px;
        width: min(300px, calc(100vw - 24px));
    }

    .moodfood-support-main {
        width: min(calc(100% - 24px), 1120px);
    }

    .moodfood-page-heading {
        align-items: flex-start;
        padding: 26px 24px;
        border-radius: 24px;
    }

    .moodfood-page-heading-icon {
        width: 54px;
        height: 54px;
        border-radius: 18px;
        font-size: 27px;
    }

    .moodfood-content-page .favorites-page.panel,
    .moodfood-content-surface {
        padding: 18px;
        border-radius: 22px;
    }

    .moodfood-support-page .moodfood-support-bottom-nav {
        position: sticky;
        display: grid;
        margin-top: 24px;
        grid-template-columns: repeat(5, 1fr);
        border-radius: 22px 22px 0 0;
    }

    .moodfood-support-footer {
        display: none;
    }

    .moodfood-auth-page {
        display: block;
        min-height: 100vh;
        padding: 18px 12px;
    }

    .moodfood-auth-brand {
        margin-left: 8px;
    }

    .moodfood-auth-layout {
        display: block;
        width: 100%;
        border-radius: 26px;
    }

    .moodfood-auth-aside {
        width: 100%;
        max-width: 100%;
        min-height: 230px;
        padding: 28px;
    }

    .moodfood-auth-aside-icon {
        width: 58px;
        height: 58px;
        margin-bottom: 32px;
        border-radius: 19px;
        font-size: 28px;
    }

    .moodfood-auth-aside h2 {
        font-size: 2rem;
    }

    .moodfood-auth-card.panel,
    .moodfood-auth-card.register-panel {
        width: 100%;
        max-width: 100%;
        padding: 30px 24px;
    }

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

    .moodfood-content-page .mood-dashboard-header {
        padding: 22px;
    }
}

@media (max-width: 560px) {
    .moodfood-support-page .moodfood-brand {
        min-width: 0;
    }

    .moodfood-support-page .moodfood-brand > span:last-child {
        display: none;
    }

    .moodfood-page-heading-icon {
        display: none;
    }

    .moodfood-content-page .favorite-card {
        grid-template-columns: 1fr;
    }

    .moodfood-content-page .favorite-photo {
        height: 210px;
        min-height: 0;
    }

    .moodfood-content-page .mp-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Fifth book · Mood and Needs production screen */
#live-step-query {
    min-height: 0;
    border-radius: 0;
    background:
        radial-gradient(circle at 8% 10%, var(--mf-theme-soft), transparent 13rem),
        radial-gradient(circle at 94% 82%, var(--mf-theme-glow), transparent 15rem),
        #fffaf2;
    box-shadow: none;
}

#live-step-query .moodfood-card {
    gap: 18px;
    padding: 18px;
    border: 0;
    border-radius: 24px;
    background: rgb(255 253 248 / 92%);
    box-shadow: 0 14px 38px rgb(60 42 26 / 12%);
}

#live-step-query .moodfood-card-heading {
    align-items: center;
    gap: 8px;
    padding: 0 8px 16px;
    border: 0;
    text-align: center;
}

#live-step-query .moodfood-step-number {
    min-width: 68px;
    color: var(--mf-theme-strong);
    background: var(--mf-theme-soft);
}

#live-step-query .moodfood-card-heading h1 {
    margin-bottom: 5px;
    font-size: 25px;
}

#live-step-query .moodfood-card-heading p {
    font-size: 13px;
    line-height: 1.55;
}

#live-step-query .live-field-group {
    padding: 14px;
    border: 1px solid rgb(231 226 216 / 80%);
    border-radius: 18px;
    background: rgb(255 255 255 / 78%);
    box-shadow: 0 6px 18px rgb(60 42 26 / 6%);
}

#live-step-query .moodfood-field-title {
    margin-bottom: 3px;
    color: var(--mf-neutral-900);
    font-size: 15px;
}

#live-step-query .live-toggle {
    min-height: 48px;
    border-radius: 15px;
    background: #fffaf2;
}

#live-step-query .mood-grid .live-toggle {
    min-height: 64px;
}

#live-step-query .live-toggle-selected {
    border-color: var(--mf-theme-strong);
    color: #fff;
    background: var(--mf-theme-strong);
    box-shadow: 0 6px 14px var(--mf-theme-glow);
}

#live-step-query .moodfood-inline-fields {
    grid-template-columns: 1fr;
    gap: 18px;
}

#live-step-query input[type="range"] {
    accent-color: var(--mf-theme-strong);
}

#live-step-query .moodfood-primary {
    min-height: 56px;
    border-radius: 999px;
    background: var(--mf-theme-strong);
    font-size: 18px;
    font-weight: 800;
}

#live-step-query .moodfood-primary:disabled {
    opacity: .48;
}

#live-step-query + .moodfood-loading,
#live-step-query .moodfood-loading {
    color: var(--mf-theme-strong);
}

@media (max-width: 360px) {
    #live-step-query {
        padding-inline: 10px;
    }

    #live-step-query .moodfood-card {
        padding: 14px;
    }

    #live-step-query .live-toggle-grid-2,
    #live-step-query .live-toggle-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ---- 飲食紀錄頁（meal_records.html） ---- */

.moodfood-content-page .mr-stats-panel {
    display: grid;
    gap: 16px;
}

.moodfood-content-page .mr-stats-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.moodfood-content-page .mr-stats-title {
    margin: 0;
    font-size: 1.3rem;
}

.moodfood-content-page .mr-stats-nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.moodfood-content-page .mr-stats-nav .live-btn {
    padding: 4px 14px;
    line-height: 1.4;
}

.moodfood-content-page .mr-week-label {
    min-width: 110px;
    text-align: center;
    font-weight: 700;
}

.moodfood-content-page .mr-stat-row {
    display: grid;
    gap: 12px;
}

.moodfood-content-page .mr-stat {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
}

.moodfood-content-page .mr-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
}

.moodfood-content-page .mr-stat small {
    opacity: 0.75;
}

.moodfood-content-page .mr-photo-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.moodfood-content-page .mr-photo-hint {
    font-size: 0.9rem;
    opacity: 0.75;
}

.moodfood-content-page .mr-previews {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.moodfood-content-page .mr-preview {
    position: relative;
}

.moodfood-content-page .mr-preview img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.moodfood-content-page .mr-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px !important;
    height: 24px !important;
    min-height: unset;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}

.moodfood-content-page .mr-submit-btn {
    margin-top: 6px;
}

.moodfood-content-page .mr-form-status {
    margin: 8px 0 0;
}

.moodfood-content-page .mr-card {
    flex-direction: column;
}

.moodfood-content-page .mr-photo-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.moodfood-content-page .mr-photo-item {
    position: relative;
    margin: 0;
}

.moodfood-content-page .mr-photo {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.moodfood-content-page .mr-photo-caption {
    font-size: 0.85rem;
    margin-top: 6px;
    opacity: 0.85;
}

.moodfood-content-page .mr-retake-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.88);
    cursor: pointer;
}

.moodfood-content-page .mr-edit-form {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

@media (max-width: 640px) {
    .moodfood-content-page .mr-stat-row {
        grid-template-columns: 1fr;
    }

    .moodfood-content-page .mr-photo {
        height: 130px;
    }
}

/* ========================================================================== */
/* MoodFood AI Mobile UI Guideline v1.0                                      */
/* Authoritative mobile-first normalization for all in-scope product screens. */
/* ========================================================================== */

html {
    background: #f5f1eb;
}

body.moodfood-site {
    margin: 0;
    color: #24231f;
    background: #f5f1eb;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei UI", sans-serif;
}

.page-shell.moodfood-shell,
.page-shell.auth-page-shell {
    width: 100%;
    max-width: 390px;
    margin-inline: auto;
    overflow: clip;
    background: #f5f1eb;
    box-shadow: 0 0 48px rgb(60 42 26 / 10%);
}

.moodfood-page {
    width: 100%;
    max-width: 390px;
    border: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei UI", sans-serif;
    font-size: 16px;
    animation: moodfood-v1-page-in .4s ease both;
}

.moodfood-page .container-xl,
.moodfood-page .container-fluid {
    width: 100%;
    max-width: none;
    padding-inline: 24px;
}

.moodfood-nav {
    min-height: 72px;
    padding-top: max(8px, env(safe-area-inset-top));
}

.moodfood-brand {
    min-height: 48px;
    font-size: 16px;
}

.moodfood-brand .brand-sprout {
    width: 40px;
    height: 40px;
}

.moodfood-nav-actions {
    display: none;
}

.moodfood-timebar,
.moodfood-progress {
    padding-inline: 24px;
}

.moodfood-timebar {
    margin-block: 8px 16px;
}

.timebar-options {
    gap: 8px;
}

.timebar-chip {
    min-width: 48px;
    min-height: 48px;
    border-radius: 24px;
}

.moodfood-workspace,
.moodfood-support-main {
    padding-inline: 24px;
}

.moodfood-workspace {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.moodfood-home-canvas,
.moodfood-stage,
.moodfood-form-stage,
.moodfood-results-stage {
    width: 100%;
}

.moodfood-hero {
    min-height: 360px;
    border-radius: 28px;
}

.moodfood-greeting {
    right: 24px;
    left: 24px;
}

.moodfood-greeting h1,
.moodfood-card-heading h1,
.moodfood-results-heading h1,
.moodfood-page-heading h1 {
    color: var(--mf-primary-700);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang TC", sans-serif;
    font-size: 30px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.moodfood-greeting h1 {
    font-size: 34px;
}

.moodfood-stage-aside h2,
.moodfood-page h2 {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang TC", sans-serif;
    font-size: 24px;
    line-height: 1.25;
}

.moodfood-field-title,
.moodfood-page-heading p,
.moodfood-page p,
.moodfood-page label,
.moodfood-page input,
.moodfood-page select,
.moodfood-page button,
.moodfood-page a {
    font-size: max(16px, 1em);
}

.moodfood-card,
.moodfood-location-card,
.moodfood-start-panel,
.moodfood-content-page .favorites-page.panel,
.moodfood-content-page .favorite-card,
.moodfood-content-page .mood-dashboard > section,
.moodfood-content-page .mood-dashboard-header,
.moodfood-page .live-card,
.moodfood-pending {
    border-radius: 24px;
    box-shadow: 0 12px 24px rgb(122 90 58 / 12%);
}

.moodfood-card,
.moodfood-content-page .favorites-page.panel,
.moodfood-content-page .mood-dashboard > section,
.moodfood-content-page .mood-dashboard-header {
    padding: 24px;
}

.moodfood-page .live-btn,
.moodfood-page .moodfood-primary,
.moodfood-page button[type="submit"] {
    min-height: 56px;
    border-radius: 24px;
    font-weight: 700;
}

.moodfood-page .moodfood-primary {
    width: 100%;
    color: #fff;
    background: var(--mf-primary-700);
    box-shadow: 0 12px 24px rgb(122 90 58 / 18%);
}

.moodfood-page .moodfood-primary.is-incomplete {
    opacity: 1;
}

.gacha-machine.is-spinning .g-knob-group {
    animation: gacha-knob-turn 0.8s linear infinite;
    transform-origin: 46px 118px;
}

.gacha-machine.is-spinning .g-egg {
    animation: gacha-egg-jiggle 0.4s ease-in-out infinite alternate;
}

.gacha-machine.is-spinning .g-egg-2 { animation-delay: 0.12s; }
.gacha-machine.is-spinning .g-egg-3 { animation-delay: 0.2s; }
.gacha-machine.is-spinning .g-egg-4 { animation-delay: 0.3s; }

@keyframes gacha-shake {
    0%, 100% { transform: rotate(0deg) translateX(0); }
    20% { transform: rotate(-2.5deg) translateX(-2px); }
    50% { transform: rotate(2.5deg) translateX(2px); }
    80% { transform: rotate(-1.5deg) translateX(-1px); }
}

@keyframes gacha-knob-turn {
    to { transform: rotate(360deg); }
}

@keyframes gacha-egg-jiggle {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

/* 掉出來的蛋 */
.gacha-egg {
    --egg-color: #e8927c;
    position: absolute;
    left: 50%;
    bottom: -34px;
    width: 74px;
    height: 92px;
    margin-left: -37px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}

.gacha-egg.is-dropping {
    animation: gacha-egg-drop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gacha-egg-drop {
    0% { transform: translateY(-110px) scale(0.6); opacity: 0; }
    55% { transform: translateY(6px) scale(1.02); opacity: 1; }
    75% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

.gacha-egg-top,
.gacha-egg-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    border: 3px solid #4a4238;
    transition: transform 0.55s ease, opacity 0.55s ease;
}

.gacha-egg-top {
    top: 0;
    background: var(--egg-color);
    border-radius: 37px 37px 6px 6px;
    border-bottom-style: dashed;
}

.gacha-egg-bottom {
    bottom: 0;
    background: #f6efe4;
    border-radius: 6px 6px 37px 37px;
    border-top: none;
}

.gacha-egg.is-open .gacha-egg-top {
    transform: translateY(-46px) rotate(-18deg);
    opacity: 0;
}

.gacha-egg.is-open .gacha-egg-bottom {
    transform: translateY(30px);
    opacity: 0;
}

.gacha-egg-hint {
    position: absolute;
    left: 50%;
    bottom: -26px;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 700;
    color: #b4513f;
    animation: gacha-hint-pulse 1.2s ease-in-out infinite;
}

@keyframes gacha-hint-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 排除類別 chips */
.gacha-filters {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.gacha-filters-title {
    margin: 0;
    color: #000;
    font-size: 0.88rem;
    font-weight: 700;
}

.gacha-filters-title small {
    font-weight: 400;
    opacity: 0.7;
}

.gacha-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.gacha-chip {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid rgba(0, 0, 0, 0.25);
    background: transparent;
    color: #000;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.gacha-chip.is-selected {
    background: #4a4238;
    border-color: #4a4238;
    color: #f9f4ea;
}

.gacha-message {
    margin: 0;
    font-size: 0.88rem;
    color: #b4513f;
}

.gacha-spin {
    min-width: 220px;
}

/* 結果卡片 */
.gacha-result {
    display: grid;
    gap: 12px;
    width: 100%;
    justify-items: center;
}

.gacha-result-kicker {
    margin: 0;
    font-weight: 800;
    color: #b4513f;
}

.gacha-result-card {
    width: 100%;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    padding: 14px;
    }
.moodfood-page input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
.moodfood-page select,
.moodfood-page textarea {
    min-height: 56px;
    padding-inline: 20px;
    border-radius: 18px;
    font-size: 16px;
}

.moodfood-page button,
.moodfood-page a,
.moodfood-page input[type="checkbox"],
.moodfood-page input[type="radio"] {
    touch-action: manipulation;
}

.moodfood-page .live-toggle {
    min-height: 48px;
    border-radius: 24px;
    font-size: 16px;
}

.moodfood-page .live-toggle-grid-2,
.moodfood-page .mood-grid {
    gap: 12px;
}

.moodfood-page .mood-grid .live-toggle {
    min-height: 96px;
    padding: 14px 10px;
    border-radius: 24px;
}


#live-price-group .live-toggle {
    min-height: 48px;
    border-radius: 24px;
}

.moodfood-page .live-card {
    overflow: hidden;
    border-radius: 28px;
}

.moodfood-page .live-card-photo {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
}

.moodfood-page .live-card-body {
    padding: 20px;
}



.moodfood-support-main {
    padding-top: 24px;
    padding-bottom: 24px;
}

.moodfood-page-heading {
    margin-bottom: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.moodfood-page-heading-icon {
    display: none;
}

.moodfood-collection-tabs {
    min-height: 56px;
    margin-bottom: 20px;
}

.moodfood-content-page .favorite-list {
    grid-template-columns: 1fr;
}

.moodfood-content-page .favorite-photo {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
    object-fit: cover;
}

.moodfood-content-page .mood-chart-wrap,
.moodfood-content-page .mood-chart-container {
    width: 240px;
    max-width: 100%;
    height: 240px;
    margin-inline: auto;
}

.moodfood-content-page .mood-legend {
    width: 100%;
    margin-top: 20px;
}

.moodfood-bottom-nav {
    position: sticky;
    z-index: 30;
    bottom: 0;
    min-height: calc(80px + env(safe-area-inset-bottom));
    padding: 4px 8px env(safe-area-inset-bottom);
    border-radius: 24px 24px 0 0;
    background: rgb(255 253 248 / 94%);
    box-shadow: 0 -8px 24px rgb(122 90 58 / 10%);
    backdrop-filter: blur(18px);
}

.moodfood-bottom-nav a,
.moodfood-bottom-nav button {
    min-height: 72px;
    margin: 0 2px;
    padding: 8px 2px;
    border-radius: 20px;
}

.moodfood-bottom-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}

.moodfood-bottom-icon svg {
    width: 24px;
    height: 24px;
}

.moodfood-bottom-nav small {
    font-size: 12px;
    line-height: 1.2;
}

.moodfood-account-dialog {
    width: calc(100% - 48px);
    max-width: 342px;
    padding: 24px;
    border-radius: 24px;
}

.moodfood-account-close,
.moodfood-account-secondary,
.moodfood-account-logout {
    min-height: 48px;
}

.moodfood-account-dialog[open] {
    animation: moodfood-v1-dialog-in .3s ease both;
}

.moodfood-footer,
.moodfood-support-footer {
    display: none;
}

@media (hover: hover) {
    .moodfood-page .live-btn:hover,
    .moodfood-page .moodfood-primary:hover,
    .moodfood-collection-tabs a:hover {
        transform: scale(1.02);
    }

    .moodfood-page .live-card:hover,
    .moodfood-content-page .favorite-card:hover {
        transform: translateY(-2px);
    }
}

@keyframes moodfood-v1-page-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes moodfood-v1-dialog-in {
    from { opacity: 0; transform: scale(.96); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 360px) {
    .moodfood-page .container-xl,
    .moodfood-page .container-fluid,
    .moodfood-workspace,
    .moodfood-support-main {
        padding-inline: 24px;
    }

    .moodfood-card,
    .moodfood-content-page .favorites-page.panel,
    .moodfood-content-page .mood-dashboard > section,
    .moodfood-content-page .mood-dashboard-header {
        padding: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .moodfood-page,
    .moodfood-account-dialog[open] {
        animation: none;
    }

    .moodfood-page *,
    .moodfood-page *::before,
    .moodfood-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Meal-record overrides must remain after the legacy component section. */
.moodfood-page .moodfood-nav .moodfood-nav-actions,
.moodfood-page.moodfood-support-page .moodfood-nav .moodfood-nav-actions {
    display: none;
}

.moodfood-content-page #mr-add-form .live-form-row,
.moodfood-content-page .mr-edit-form .live-form-row,
.moodfood-content-page #mr-add-form .live-field,
.moodfood-content-page .mr-edit-form .live-field {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.moodfood-content-page #mr-add-form .live-field > input,
.moodfood-content-page .mr-edit-form .live-field > input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 56px;
    min-height: 56px;
    padding: 0 20px;
    border-radius: 18px;
}

.moodfood-content-page #mr-add-form input[type="date"],
.moodfood-content-page .mr-edit-form input[type="date"] {
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    block-size: 56px;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.moodfood-content-page input[type="date"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
}

.moodfood-content-page input[type="date"]::-webkit-calendar-picker-indicator {
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
}

@media (max-width: 639px) {
    .moodfood-content-page #mr-add-form .live-form-row,
    .moodfood-content-page .mr-edit-form .live-form-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .moodfood-content-page #mr-add-form .live-field,
    .moodfood-content-page .mr-edit-form .live-field {
        overflow: hidden;
    }
}

.moodfood-content-page .mr-stats-nav { width: 100%; justify-content: space-between; }
.moodfood-content-page .mr-stats-nav .live-btn { width: 48px; min-width: 48px; min-height: 48px; padding: 0; border-radius: 24px; }
.moodfood-content-page .mr-stat-row { gap: 8px; }
.moodfood-content-page .mr-stat { min-width: 0; padding: 12px 6px; border-radius: 18px; background: var(--mf-primary-50); }
.moodfood-content-page .mr-stat-value { overflow-wrap: anywhere; color: var(--mf-primary-700); font-size: 16px; }
.moodfood-content-page .mr-stat small,
.moodfood-content-page .mr-photo-hint,
.moodfood-content-page .mr-photo-caption { font-size: 16px; }
.moodfood-content-page .mr-photo-picker { align-items: stretch; flex-direction: column; }
.moodfood-content-page #mr-add-photo-btn,
.moodfood-content-page .mr-submit-btn { width: 100%; }
.moodfood-content-page .mr-icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.moodfood-content-page .mr-icon-button svg,
.moodfood-content-page .mr-retake-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.moodfood-content-page .mr-previews { display: grid; gap: 8px; }
.moodfood-content-page .mr-preview img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 18px; object-fit: cover; }
.moodfood-content-page .mr-preview-remove { width: 32px !important; height: 32px !important; min-height: 32px; }
.moodfood-content-page .mr-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.moodfood-content-page .mr-photo-grid-1 { grid-template-columns: 1fr; }
.moodfood-content-page .mr-photo { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 18px; object-fit: cover; }
.moodfood-content-page .mr-retake-btn { display: inline-flex; min-width: 48px; min-height: 48px; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border-radius: 24px; font-size: 16px; }
.moodfood-content-page .mr-actions,
.moodfood-content-page .mr-edit-form .mp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.moodfood-content-page .mr-delete { border: 1px solid var(--mf-danger); color: var(--mf-danger); background: #fff; }

@media (max-width: 360px) {
    .moodfood-content-page .mr-stat-row,
    .moodfood-content-page .mr-photo-grid { grid-template-columns: 1fr; }
}

/* Fixed 390px app canvas: do not rely on the outer browser viewport. */
.moodfood-content-page .favorites-page.panel {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.moodfood-content-page .favorites-page.panel > *,
.moodfood-content-page .favorite-card,
.moodfood-content-page .favorite-body {
    min-width: 0;
    max-width: 100%;
}

.moodfood-content-page .favorite-card {
    grid-template-columns: minmax(0, 1fr);
}

.moodfood-content-page #mr-add-form .live-form-row,
.moodfood-content-page .mr-edit-form .live-form-row {
    grid-template-columns: minmax(0, 1fr);
}

.moodfood-content-page .mood-overview-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
}

.moodfood-content-page .mood-overview-grid > *,
.moodfood-content-page .mood-chart-wrapper,
.moodfood-content-page .mood-chart-wrapper canvas {
    min-width: 0;
    max-width: 100%;
}
