html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    color-scheme: dark;
    --bg: #0b1120;
    --bg-soft: #111827;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --field: rgba(255, 255, 255, 0.08);
    --field-strong: rgba(255, 255, 255, 0.12);
    --ink: #f8fafc;
    --ink-soft: #dbe4ef;
    --muted: #94a3b8;
    --line: rgba(226, 232, 240, 0.16);
    --line-strong: rgba(226, 232, 240, 0.28);
    --teal: #2dd4bf;
    --teal-strong: #14b8a6;
    --sky: #38bdf8;
    --amber: #fbbf24;
    --rose: #fb7185;
    --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}


body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(56, 189, 248, 0.08), transparent 38%),
        linear-gradient(135deg, #0b1120 0%, #111827 48%, #18181b 100%);
    font-family: "Inter", "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 72%);
}

button,
input,
select {
    font: inherit;
}

button,
a,
summary,
.checkbox-option,
.restaurant-card {
    transition: transform 200ms ease, border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease, color 200ms ease;
}

.page-shell {
    position: relative;
    z-index: 1;
    padding: 24px;
}

.auth-shell {
    display: grid;
    place-items: start center;
    padding-top: 64px;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(100%, 1220px);
    min-height: 58px;
    margin: 0 auto 20px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.66);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(45, 212, 191, 0.26);
    border-radius: 8px;
    background: rgba(20, 184, 166, 0.12);
    color: var(--ink);
    font-weight: 900;
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
    color: var(--muted);
    font-weight: 700;
}

.nav-actions form,
.top-nav form {
    margin: 0;
}

.top-nav a,
.auth-switch a,
.map-link {
    color: var(--teal);
    font-weight: 900;
    text-decoration: none;
}

.top-nav a:hover,
.auth-switch a:hover,
.map-link:hover {
    color: #99f6e4;
}

.account-name {
    max-width: 180px;
    overflow: hidden;
    color: var(--ink-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
    align-items: start;
    gap: 22px;
    width: min(100%, 1220px);
    margin: 0 auto;
}

.workspace-initial {
    grid-template-columns: minmax(320px, 560px);
    justify-content: center;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(22px);
}

.workspace > .panel {
    position: sticky;
    top: 24px;
    padding: 28px;
}

.workspace-initial > .panel {
    padding: 34px;
}

.results {
    min-width: 0;
}

.auth-panel {
    width: min(100%, 430px);
    padding: 30px;
}

.register-panel {
    width: min(100%, 920px);
    padding: 30px;
}

.preference-page {
    margin: 0 auto;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--amber);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 2.45rem;
    line-height: 1.08;
}

h2 {
    margin-bottom: 0;
    color: var(--ink);
    font-size: 1.45rem;
    line-height: 1.25;
}

h3 {
    color: var(--ink);
    line-height: 1.25;
}

.summary {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.75;
}

.filter-form {
    display: grid;
    gap: 16px;
    margin-top: 26px;
}

label {
    display: grid;
    gap: 9px;
    color: var(--ink-soft);
    font-size: 0.94rem;
    font-weight: 800;
}

input,
select,
button {
    width: 100%;
    min-height: 48px;
    border-radius: 8px;
}

input,
select {
    border: 1px solid var(--line-strong);
    background: var(--field);
    padding: 11px 13px;
    color: var(--ink);
    outline: none;
}

select option {
    background: #111827;
    color: var(--ink);
}

input::placeholder {
    color: #738399;
}

input:focus,
select:focus {
    border-color: rgba(45, 212, 191, 0.72);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
    background: var(--field-strong);
}

button {
    border: 1px solid rgba(45, 212, 191, 0.55);
    background: linear-gradient(135deg, #14b8a6, #2563eb);
    color: #ffffff;
    cursor: pointer;
    font-weight: 900;
    box-shadow: 0 14px 32px rgba(20, 184, 166, 0.2);
}

button:hover {
    transform: translateY(-1px) scale(1.02);
    border-color: rgba(153, 246, 228, 0.9);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.24);
}

.link-button {
    width: auto;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink-soft);
    box-shadow: none;
}

.link-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ink);
}

.message-list,
.form-errors {
    display: grid;
    gap: 6px;
    margin: 18px 0 0;
    padding: 12px 14px;
    border-radius: 8px;
}

.message-list {
    border: 1px solid rgba(45, 212, 191, 0.28);
    background: rgba(20, 184, 166, 0.12);
}

.form-errors {
    border: 1px solid rgba(251, 113, 133, 0.34);
    background: rgba(190, 18, 60, 0.14);
    color: #fecdd3;
}

.message-list p,
.form-errors p {
    margin: 0;
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
}

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

.preference-grid {
    display: grid;
    gap: 16px;
}

.preference-group {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.045);
}

.preference-group legend {
    width: auto;
    padding: 0 8px;
    color: var(--ink);
    font-weight: 900;
}

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

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--ink-soft);
    font-weight: 800;
}

.checkbox-option:hover {
    transform: scale(1.02);
    border-color: rgba(45, 212, 191, 0.45);
    background: rgba(45, 212, 191, 0.09);
}

.checkbox-option input {
    width: 16px;
    min-height: 16px;
    flex: 0 0 auto;
    accent-color: var(--teal);
}

.results-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    min-height: 50px;
    margin-bottom: 14px;
    padding: 0 4px;
}

.restaurant-list {
    display: grid;
    gap: 14px;
}

.restaurant-card {
    display: grid;
    grid-template-columns: minmax(210px, 0.42fr) minmax(0, 0.58fr);
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
}

.restaurant-card:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(45, 212, 191, 0.34);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: var(--shadow-md);
}

.restaurant-image {
    position: relative;
    display: grid;
    place-items: end start;
    min-height: 230px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #111827;
    color: var(--ink);
    font-weight: 900;
}

.restaurant-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.74), transparent 54%);
}

.restaurant-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease, filter 300ms ease;
}

.restaurant-card:hover .restaurant-image img {
    transform: scale(1.04);
    filter: saturate(1.08);
}

.restaurant-image span {
    position: relative;
    z-index: 1;
    margin: 12px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(12px);
}

.restaurant-content {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
}

.restaurant-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.restaurant-card h3 {
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 1.24rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.restaurant-card p {
    margin-bottom: 0;
    color: var(--muted);
}

.restaurant-card strong {
    display: grid;
    place-items: center;
    min-width: 54px;
    height: 42px;
    border: 1px solid rgba(251, 191, 36, 0.32);
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.12);
    color: #fde68a;
    font-size: 1rem;
}

.price-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.price-line span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 11px;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 8px;
    background: rgba(45, 212, 191, 0.1);
    color: #99f6e4;
    font-weight: 900;
}

.restaurant-meta {
    display: grid;
    gap: 5px;
    font-size: 0.92rem;
}

.restaurant-meta p {
    overflow-wrap: anywhere;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid rgba(56, 189, 248, 0.26);
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.1);
    color: #bae6fd;
    font-size: 0.9rem;
    font-weight: 900;
}

.hours-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
}

.hours-list summary {
    cursor: pointer;
    color: var(--ink-soft);
    font-weight: 900;
}

.hours-list:hover {
    border-color: rgba(45, 212, 191, 0.3);
}

.hours-list ul {
    display: grid;
    gap: 4px;
    margin: 10px 0 0;
    padding-left: 18px;
}

.card-map {
    height: 154px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #111827;
}

.card-map iframe {
    border: 0;
    filter: saturate(0.85) contrast(0.92);
}

.map-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid rgba(45, 212, 191, 0.36);
    border-radius: 8px;
    background: rgba(45, 212, 191, 0.11);
}

.map-link:hover {
    transform: scale(1.02);
    background: rgba(45, 212, 191, 0.18);
    text-decoration: none;
}

.empty-state {
    border: 1px dashed rgba(251, 191, 36, 0.5);
    border-radius: 8px;
    padding: 26px;
    background: rgba(251, 191, 36, 0.1);
}

.empty-state h3 {
    margin-bottom: 6px;
}

.empty-state p {
    margin-bottom: 0;
    color: var(--muted);
}

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

    .workspace > .panel {
        position: static;
    }

    .restaurant-card {
        grid-template-columns: minmax(190px, 0.38fr) minmax(0, 0.62fr);
    }
}

@media (max-width: 768px) {
    .page-shell {
        padding: 16px;
    }

    .auth-shell {
        padding-top: 28px;
    }

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

    .nav-actions {
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
    }

    .workspace,
    .workspace-initial {
        grid-template-columns: 1fr;
    }

    .workspace > .panel,
    .workspace-initial > .panel,
    .auth-panel,
    .register-panel {
        padding: 22px;
    }

    h1 {
        font-size: 2rem;
    }

    .account-grid,
    .restaurant-card,
    .restaurant-topline {
        grid-template-columns: 1fr;
    }

    .restaurant-image {
        aspect-ratio: 16 / 10;
        min-height: 0;
    }

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

/* ==========================================================================
   Live recommend (Places API + LLM) — 移植自 restaurent Decision Paralysis
   ========================================================================== */

.live-app {
    position: relative;
    max-width: 32rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.live-error {
    background: rgba(251, 113, 133, 0.12);
    border: 1px solid rgba(251, 113, 133, 0.35);
    color: var(--ink);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.live-step {
    position: relative;
}

.live-step-home {
    position: relative;
    width: 100%;
    aspect-ratio: 572 / 1024;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.live-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: auto;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    color: #7A5A3A;
    background: #F5F1EB;
    border: 1px solid #C9A27B;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.live-clear-btn:hover {
    color: #7A5A3A;
    background: #EBDCC6;
    border-color: #A67C52;
}

.live-clear-btn:focus-visible {
    outline: 3px solid #A6B18A;
    outline-offset: 2px;
}

.live-clear-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.live-home-actions {
    position: absolute;
    left: 1rem;
    bottom: 1.5rem;
    width: 12rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.live-location-status {
    font-size: 0.85rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    margin: 0;
}

.live-location-error {
    font-size: 0.75rem;
    color: #fff;
    background: rgba(225, 29, 72, 0.9);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    margin: 0;
}

.live-card-bg {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.live-card-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    pointer-events: none;
}

.live-form-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 1.5rem;
}

.live-form-card h1 {
    font-size: 1.25rem;
    margin: 0;
}

.live-form-row {
    display: flex;
    gap: 1rem;
}

.live-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.live-field input,
.live-field select {
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    color: var(--ink);
}

.live-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.live-toggle-grid {
    display: grid;
    gap: 0.5rem;
}

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

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

.live-toggle-row {
    display: flex;
    gap: 0.5rem;
}

.live-toggle {
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--field);
    color: var(--ink);
    padding: 0.55rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.live-toggle-selected {
    background: var(--teal);
    border-color: var(--teal-strong);
    color: #04211c;
    font-weight: 600;
}

.live-warning-text {
    font-size: 0.75rem;
    color: var(--rose);
    margin: 0;
}

.live-loading-text {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.75rem;
}

.live-btn {
    display: block;
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}

.live-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.live-btn-dark {
    background: var(--teal);
    border-color: var(--teal-strong);
    color: #04211c;
}

.live-btn-light {
    background: var(--field);
    color: var(--ink);
}

.live-btn-nav {
    background: #16a34a;
    border-color: #15803d;
    color: #fff;
}

.live-btn-select {
    background: var(--field);
    color: var(--ink);
}

.live-external-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.live-selected-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: stretch;
}

.live-external-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.4rem;
    padding: 0.55rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.62);
    color: var(--ink-soft);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.live-external-link:hover {
    border-color: rgba(45, 212, 191, 0.48);
    color: var(--ink);
}

.live-flex {
    flex: 1;
}

.live-link-btn {
    background: none;
    border: none;
    color: var(--muted);
    text-decoration: underline;
    font-size: 0.85rem;
    cursor: pointer;
    align-self: flex-start;
}

.live-result-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.live-round2-section {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    margin-top: 0.5rem;
}

.live-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0;
}

.live-opening {
    font-style: italic;
    font-family: Georgia, "Noto Serif TC", serif;
    letter-spacing: 0.02em;
    font-size: 1.05rem;
    color: var(--rose);
    line-height: 1.6;
    margin: 0;
}

.live-relaxed-note {
    font-size: 0.75rem;
    color: var(--amber);
    margin: 0;
}

.live-restaurant-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.live-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}

.live-card-photo {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.live-card-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.75rem;
    background: var(--field);
}

.live-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
}

.live-card-topline {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.5rem;
}

.live-card-title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    min-width: 0;
}

.live-card-name {
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.live-card-distance {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.live-favorite-btn,
.favorite-remove-btn {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(251, 113, 133, 0.42);
    background: rgba(15, 23, 42, 0.72);
    color: #fecdd3;
    box-shadow: none;
    font-size: 1.1rem;
    line-height: 1;
}

.live-favorite-btn:hover,
.favorite-remove-btn:hover {
    transform: scale(1.06);
    background: rgba(251, 113, 133, 0.16);
    border-color: rgba(251, 113, 133, 0.8);
    box-shadow: none;
}

.live-favorite-btn-active,
.favorite-remove-btn {
    background: rgba(251, 113, 133, 0.2);
    color: var(--rose);
}

.live-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.live-pill {
    background: var(--field);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    color: var(--ink-soft);
}

.live-card-address {
    font-size: 0.85rem;
    color: var(--muted);
}

.live-card-reason {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.live-card-reason span {
    font-weight: 600;
}

.live-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.live-sorry-img {
    width: 10rem;
    height: 10rem;
    object-fit: cover;
    border-radius: 999px;
}

.live-rescue-prompt {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 14px;
    padding: 1rem;
}

.live-rescue-prompt p {
    font-size: 0.85rem;
    color: var(--amber);
    margin: 0;
}

.favorites-page {
    width: min(100%, 920px);
    margin: 0 auto;
    padding: 28px;
}

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

.favorite-list {
    display: grid;
    gap: 14px;
}

.favorite-card {
    display: grid;
    grid-template-columns: minmax(160px, 0.34fr) minmax(0, 0.66fr);
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
}

.favorite-photo {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px;
    background: var(--field);
}

.favorite-photo-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.8rem;
}

.favorite-body {
    display: grid;
    align-content: start;
    gap: 0.65rem;
    min-width: 0;
}

.favorite-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-direction:column;
    gap: 0.75rem;
}

.favorite-topline h2 {
    font-size: 1.2rem;
    overflow-wrap: anywhere;
}

.favorite-address {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .favorite-card {
        grid-template-columns: 1fr;
    }
}

/* ---- Pending ratings (feedback loop) ---- */

.live-pending {
    width: min(560px, 100%);
    margin: 1.5rem auto 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.live-pending-toggle {
    width: 100%;
    min-height: 64px;
    padding: 0.55rem 0.8rem;
    display: grid;
    grid-template-columns: 42px 1fr 20px;
    gap: 0.65rem;
    align-items: center;
    text-align: left;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.live-pending-toggle:hover {
    background: var(--field);
    box-shadow: none;
    transform: none;
}

.live-pending.is-open .live-pending-toggle {
    display: none;
}

.live-pending-icon {
    font-size: 2rem;
    line-height: 1;
    color: var(--amber);
}

.live-pending-summary {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.live-pending-summary strong {
    font-size: 0.95rem;
}

.live-pending-summary small {
    color: var(--muted);
    font-size: 0.78rem;
}

.live-pending-chevron,
.live-pending-collapse span {
    width: 9px;
    height: 9px;
    display: block;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.live-pending-chevron {
    transform: rotate(-45deg);
}

.live-pending-panel {
    min-height: 0;
}

.live-pending-list {
    min-height: 0;
}

.live-pending-card {
    padding: 0.75rem 0.9rem 0.65rem;
}

.live-pending-card-head,
.live-pending-identity,
.live-pending-footer {
    display: flex;
    align-items: center;
}

.live-pending-card-head {
    justify-content: space-between;
    gap: 0.5rem;
}

.live-pending-identity {
    gap: 0.5rem;
    min-width: 0;
}

.live-pending-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.live-pending-collapse {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    box-shadow: none;
}

.live-pending-collapse:hover {
    background: var(--field);
    box-shadow: none;
    transform: none;
}

.live-pending-collapse span {
    transform: translateY(2px) rotate(225deg);
}

.live-pending-stars {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.25rem 0 0.35rem;
}

.live-star {
    padding: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    box-shadow: none;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
}

.live-star:hover,
.live-star:focus-visible {
    background: var(--field);
    box-shadow: none;
    transform: none;
}

.live-star-filled {
    color: var(--amber);
}

.live-pending-stars[aria-disabled="true"] .live-star {
    cursor: default;
}

.live-pending-error {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    color: var(--rose);
}

.live-pending-footer {
    min-height: 30px;
    padding-top: 0.45rem;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--line);
}

.live-pending-later {
    min-height: 30px;
    padding: 0 0.25rem;
    color: var(--muted);
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 0.8rem;
}

.live-pending-later:hover {
    color: var(--ink);
    background: transparent;
    box-shadow: none;
    transform: none;
}

.live-pending-success {
    min-height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 1rem;
    color: var(--teal);
}

.live-pending-success span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 1.1rem;
}

@media (max-width: 480px) {
    .live-pending {
        margin-top: 1rem;
    }

    .live-pending-card {
        padding-inline: 0.75rem;
    }

    .live-pending-identity .live-pill {
        max-width: 92px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .live-star {
        font-size: 1.55rem;
    }
}

.live-meal-photo {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.live-meal-photo-btn{
    color: var(--mf-neutral-900);
}
.live-meal-photo .live-meal-photo-btn {
    align-self: flex-start;
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
}

.live-selected-actions .live-meal-photo-btn {
    margin: 0;
}

.live-meal-photo-status {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

.live-meal-photo-loading {
    color: var(--muted);
}

.live-meal-photo-failed {
    color: var(--rose);
}

.live-meal-photo-done {
    color: var(--teal);
}

.live-meal-photo-kcal {
    font-weight: 600;
    font-size: 0.95rem;
}

.live-meal-photo-confidence {
    color: var(--muted);
}

.live-meal-photo-note {
    color: var(--muted);
    font-size: 0.72rem;
}

.mp-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.mp-retake {
    font-size: 0.85rem;
}

.mp-delete {
    width: auto;
    padding: 0.5rem 1rem;
    background: rgba(190, 18, 60, 0.14);
    border-color: rgba(251, 113, 133, 0.34);
    color: var(--rose);
    font-size: 0.85rem;
}

.mp-delete:hover {
    background: rgba(190, 18, 60, 0.22);
    color: #fecdd3;
}

/* ---- High ratings page ---- */

.hr-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hr-rating-label {
    font-size: 0.8rem;
    color: var(--muted);
}

.hr-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ---- Weekly mood dashboard ---- */

.mood-page-shell {
    background: linear-gradient(160deg, #f4efe5 0%, #faf8f1 52%, #edf1e5 100%);
}

.mood-dashboard {
    max-width: 1120px;
    margin: 1.5rem auto 3rem;
    padding: clamp(1.1rem, 3vw, 2rem);
    color: #40523b;
    background: rgba(247, 243, 235, 0.92);
    border: 1px solid #e5ded0;
    border-radius: 28px;
    box-shadow: 0 16px 40px rgba(83, 66, 44, 0.1);
}

.mood-dashboard-header,
.mood-week-nav,
.mood-summary-list li {
    display: flex;
    align-items: center;
}

.mood-dashboard-header {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.mood-eyebrow {
    margin: 0 0 0.25rem;
    color: #8a795e;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.mood-title {
    margin: 0;
    color: #40523b;
    font-size: clamp(1.55rem, 4vw, 2.35rem);
    font-weight: 700;
}

.mood-subtitle {
    margin: 0.35rem 0 0;
    color: #766d60;
}

.mood-week-nav {
    gap: 0.35rem;
    flex: 0 0 auto;
}

.mood-week-nav a {
    display: grid;
    min-width: 38px;
    min-height: 38px;
    place-items: center;
    color: #40523b;
    background: #fffdf8;
    border: 1px solid #d8d0c1;
    border-radius: 999px;
    text-decoration: none;
}

.mood-week-nav .mood-today-link {
    padding: 0 0.8rem;
    border-radius: 18px;
    font-size: 0.85rem;
}

.mood-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 1rem;
}

.mood-card,
.ai-reminder-card {
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid #e5ded0;
    border-radius: 24px;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    box-shadow: 0 10px 30px rgba(83, 66, 44, 0.08);
}

.mood-card h2,
.ai-reminder-card h2 {
    margin: 0 0 1rem;
    color: #40523b;
    font-size: 1rem;
    font-weight: 700;
}

.mood-chart-wrapper {
    position: relative;
    width: 100%;
    height: 360px;
    margin: 0 auto;
}

.mood-summary-list {
    display: grid;
    gap: 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mood-summary-list li {
    gap: 0.65rem;
    color: #5c584f;
}

.mood-summary-list strong {
    margin-left: auto;
    color: #40523b;
    white-space: nowrap;
}

.mood-summary-dot {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border-radius: 50%;
}

.mood-summary-list [data-mood="stressed"] .mood-summary-dot { background: #355c7d; }
.mood-summary-list [data-mood="sad"] .mood-summary-dot { background: #7a9ebb; }
.mood-summary-list [data-mood="happy"] .mood-summary-dot { background: #e9a23b; }
.mood-summary-list [data-mood="tired"] .mood-summary-dot { background: #9dbf9e; }
.mood-summary-list [data-mood="angry"] .mood-summary-dot { background: #c96a5a; }
.mood-summary-list [data-mood="bored"] .mood-summary-dot { background: #e7e2d8; border: 1px solid #cfc8bb; }

.mood-timeline-card {
    margin-top: 1rem;
}

.mood-timeline {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mood-timeline li {
    display: grid;
    justify-items: center;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.75rem 0.25rem;
    background: #f7f3eb;
    border-radius: 16px;
}

.mood-timeline li.is-empty { opacity: 0.55; }
.mood-weekday { color: #766d60; font-size: 0.8rem; font-weight: 700; }
.mood-day-icon { font-size: 1.65rem; line-height: 1.2; }
.mood-day-label {
    width: 100%;
    overflow: hidden;
    color: #5c584f;
    font-size: 0.7rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-reminder-card {
    margin-top: 1rem;
    background: linear-gradient(135deg, #f1f3e8, #fffaf1);
    border-color: #d8dfc9;
}

.ai-reminder-card p { margin: 0; color: #4f5b48; line-height: 1.8; }
.ai-reminder-card small { display: block; margin-top: 0.8rem; color: #81796d; }

.mood-empty-state {
    display: grid;
    justify-items: center;
    min-height: 360px;
    align-content: center;
    text-align: center;
}

.mood-empty-state > span { font-size: 3rem; }
.mood-empty-state h2 { margin: 0.75rem 0 0.35rem; font-size: 1.35rem; }
.mood-empty-state p { max-width: 430px; color: #766d60; }
.mood-empty-state .live-btn { width: auto; margin-top: 0.5rem; text-decoration: none; }
.mood-dashboard-header { align-items: flex-start; flex-direction: column; }
@media (max-width: 760px) {
    .mood-overview-grid { grid-template-columns: 1fr; }
    .mood-chart-wrapper { height: 300px; }
    .mood-timeline { gap: 0.25rem; }
    .mood-timeline li { padding: 0.6rem 0.1rem; border-radius: 10px; }
    .mood-day-icon { font-size: 1.25rem; }
    .mood-day-label { display: none; }
}
