/* ============================================
   RAMEKIN HOME — MOBILE DASHBOARD RAIL
   Mobile redesign Part A (approved prototype turn 2b) — replaces the
   Prompt 45 module grid. All colors come from design-tokens.css; the
   geometry (186px cards, 18/22px radii) comes from the approved handoff
   spec. JetBrains Mono (loaded in base.html) is reserved for numeric
   facts: costs, counts, estimates.
   ============================================ */

.dashboard {
    max-width: 800px;
    margin: 0 auto;
    /* .main-content already adds (header-height + space-8) above us, so the
       dashboard's own top padding stays 0 (Prompt 45 Bug 2). Side padding
       stays for narrow viewports. */
    padding: 0 16px var(--density-roomy-padding, 24px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ----- Header: This Week + date + planned count ----- */
.dashboard-identity {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 2px;
}

.identity-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.identity-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #0F232B);
    margin: 0;
    letter-spacing: -0.02em;
}

.identity-date {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-neutral-300, #A0A8AD);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.identity-summary {
    font-size: 13px;
    color: var(--text-muted, #7B8285);
}

/* ----- Dinner rail: horizontal scroll-snap card row ----- */
.dinner-rail {
    display: flex;
    gap: 13px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* Bleed to the container edge so cards slide under the page gutter
       like the prototype, while the first card still aligns to it.
       scroll-padding keeps snap positions on the gutter, not the bleed
       edge (without it the first card snaps flush to the viewport). */
    margin: 0 -16px;
    padding: 4px 16px 8px;
    scroll-padding-left: 16px;
    scroll-padding-right: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.dinner-rail::-webkit-scrollbar {
    display: none;
}

.rail-card {
    flex: none;
    width: 186px;
    height: 186px;
    scroll-snap-align: start;
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 13px;
    text-decoration: none;
    box-shadow: 0 3px 10px -4px rgba(15, 35, 43, 0.18);
}

/* Photo-placeholder tints — soft cool boxes until real food photos are
   wired in. All six are existing tokens (nearest match to the handoff's
   placeholder palette; no new hex values). */
.rail-tint-0 { background: var(--brand-primary-soft, #C8DCE9); }
.rail-tint-1 { background: var(--color-secondary-100, #DCF5E2); }
.rail-tint-2 { background: var(--brand-accent-soft, #C1E4F7); }
.rail-tint-3 { background: var(--bg-subtle, #EDEFF0); }
.rail-tint-4 { background: var(--tint-success, #F0FAF2); }
.rail-tint-5 { background: var(--tint-info, #EFF7FC); }

.rail-card-pill {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary, #0F232B);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--radius-full, 9999px);
}

.rail-card-body {
    display: flex;
    flex-direction: column;
}

.rail-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #0F232B);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rail-card-costs {
    margin-top: 3px;
    display: flex;
    flex-direction: column;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-secondary, #374F5D);
}

.rail-card-serving {
    color: var(--text-muted, #7B8285);
}

/* Trailing "Add dinner" card — dashed, always last in the rail. */
.rail-card--add {
    border: 2px dashed var(--border-subtle, #C2C9CC);
    background: var(--bg-subtle, #EDEFF0);
    box-shadow: none;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.rail-add-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full, 9999px);
    background: var(--tint-info, #EFF7FC);
    color: var(--brand-primary, #387A98);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.rail-add-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #7B8285);
}

/* ----- Quick-link cards: icon tile + title + mono subtitle + chevron ----- */
.quicklink-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quicklink-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-subtle, #C2C9CC);
    box-shadow: 0 2px 8px -4px rgba(15, 35, 43, 0.12);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.quicklink-card:hover {
    border-color: var(--brand-primary-soft, #C8DCE9);
    box-shadow: var(--shadow-card-hover, 0 2px 6px rgba(15, 35, 43, 0.08));
}

.quicklink-icon {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: var(--radius-2xl, 12px);
    background: var(--tint-info, #EFF7FC);
    color: var(--brand-primary, #387A98);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.quicklink-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quicklink-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #0F232B);
}

.quicklink-sub {
    font-size: 12px;
    color: var(--text-muted, #7B8285);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quicklink-chevron {
    color: var(--color-neutral-300, #A0A8AD);
    font-size: 13px;
    flex: none;
}

.shopping-refresh-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin-top: -8px;
}

.shopping-refresh-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--brand-primary-soft, #C8DCE9);
    border-radius: var(--radius-full, 9999px);
    background: var(--bg-surface, #FFFFFF);
    color: var(--brand-primary-hover, #25566C);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.shopping-refresh-button:hover {
    background: var(--tint-info, #EFF7FC);
}

.shopping-refresh-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.shopping-refresh-status {
    flex-basis: 100%;
    margin: 0;
    color: var(--color-danger-700, #9f2d24);
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
}

.shopping-refresh-status[hidden] {
    display: none;
}

/* ----- Jump back in: recent recipe chips ----- */
.jump-back {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 2px;
}

.jump-back-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #7B8285);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chip-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
    display: none;
}

.recipe-chip {
    flex: none;
    padding: 8px 16px;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-subtle, #C2C9CC);
    border-radius: var(--radius-full, 9999px);
    font-size: 13px;
    color: var(--text-secondary, #374F5D);
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.recipe-chip:hover {
    background: var(--brand-accent-soft, #C1E4F7);
    border-color: var(--brand-primary-soft, #C8DCE9);
    color: var(--brand-primary-hover, #25566C);
}

/* ----- Mobile: tighter gutters; rail bleed follows ----- */
@media (max-width: 600px) {
    .dashboard {
        padding: 0 12px 16px;
        gap: 16px;
    }

    .dinner-rail {
        margin: 0 -12px;
        padding: 4px 12px 8px;
        scroll-padding-left: 12px;
        scroll-padding-right: 12px;
    }
}
