/* ===== 식단 기록 확인 페이지 스타일 ===== */

:root {
    --record-pink: #ec4899;
    --record-purple: #a855f7;
    --record-gradient: linear-gradient(135deg, #ec4899, #a855f7);
    --color-carbs: #FF6B8A;
    --color-protein: #A78BFA;
    --color-fat: #FBBF24;
    --font-outfit: 'Outfit', sans-serif;
}

/* Header */
.record-header {
    text-align: left;
    margin-bottom: 1.5rem;
}

.page-title-area {
    margin-top: 1.5rem;
}

.record-header h1 {
    font-family: var(--font-outfit);
    font-size: 2rem;
    font-weight: 800;
    background: var(--record-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.record-header .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Back Button */
.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--record-pink);
}

/* ===== 날짜 선택 섹션 ===== */
.date-selector-section {
    margin-bottom: 1.5rem;
    position: relative;
}

.date-selector-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 14px 16px;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.08);
}

.date-display-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
}

.calendar-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(236, 72, 153, 0.2);
    background: rgba(236, 72, 153, 0.05);
    color: var(--record-pink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.calendar-toggle-btn:hover,
.calendar-toggle-btn.active {
    background: var(--record-pink);
    color: white;
    border-color: var(--record-pink);
}

.date-display-text {
    font-family: var(--font-outfit);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
    text-align: center;
    flex: 1;
}

/* 날짜 이동 버튼 */
.day-nav-btn {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(236, 72, 153, 0.18);
    background: rgba(236, 72, 153, 0.05);
    color: var(--record-pink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.day-nav-btn:hover {
    background: var(--record-pink);
    color: white;
    border-color: var(--record-pink);
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.3);
}

.day-nav-btn:active {
    transform: scale(0.88);
}

.day-nav-btn.hidden-nav {
    visibility: hidden;
    pointer-events: none;
}

.day-nav-btn.day-nav-future {
    opacity: 0.4;
    cursor: default;
}

.day-nav-btn.day-nav-future:hover {
    background: rgba(236, 72, 153, 0.05);
    color: var(--record-pink);
    border-color: rgba(236, 72, 153, 0.18);
    box-shadow: none;
}

.today-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(236, 72, 153, 0.25);
    background: rgba(236, 72, 153, 0.06);
    color: var(--record-pink);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.today-btn:hover {
    background: var(--record-pink);
    color: white;
    border-color: var(--record-pink);
}

/* 빠른 기간 프리셋 */
.quick-range-pills {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.range-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.range-pill:hover {
    border-color: rgba(236, 72, 153, 0.3);
    color: var(--record-pink);
    background: rgba(236, 72, 153, 0.04);
}

.range-pill.active {
    background: var(--record-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.3);
}

/* ===== 커스텀 달력 드롭다운 ===== */
.calendar-dropdown {
    margin-top: 10px;
    animation: calendarSlideDown 0.3s ease-out;
}

.calendar-dropdown.hidden {
    display: none;
}

@keyframes calendarSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 8px 32px rgba(236, 72, 153, 0.1);
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.cal-month-year {
    font-family: var(--font-outfit);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

.cal-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(236, 72, 153, 0.15);
    background: rgba(236, 72, 153, 0.04);
    color: var(--record-pink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cal-nav-btn:hover {
    background: var(--record-pink);
    color: white;
    border-color: var(--record-pink);
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}

.cal-weekdays span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 0;
}

.cal-weekdays span:first-child {
    color: #ef4444;
}

.cal-weekdays span:last-child {
    color: #3b82f6;
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    isolation: isolate;
}

.cal-day:hover:not(.empty):not(.disabled) {
    background: rgba(236, 72, 153, 0.08);
}

.cal-day.empty {
    cursor: default;
}

.cal-day.today {
    font-weight: 700;
    color: var(--record-pink);
}

.cal-day.today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--record-pink);
}

.cal-day.selected-start,
.cal-day.selected-end {
    background: var(--record-gradient) !important;
    color: white !important;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.cal-day.selected-start::after,
.cal-day.selected-end::after {
    display: none;
}

.cal-day.in-range {
    background: rgba(236, 72, 153, 0.08);
    border-radius: 4px;
    color: var(--record-pink);
    font-weight: 600;
}

.cal-day.sunday {
    color: #ef4444;
}

.cal-day.saturday {
    color: #3b82f6;
}

.cal-day.selected-start.sunday,
.cal-day.selected-end.sunday,
.cal-day.selected-start.saturday,
.cal-day.selected-end.saturday {
    color: white !important;
}

/* ===== 식단 기록 안개 글로우 효과 ===== */
.cal-day.has-record-1::before,
.cal-day.has-record-2::before,
.cal-day.has-record-3::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    pointer-events: none;
    z-index: -1;
}

/* 1회 기록: 새벽 이슬 같은 은은한 로즈 안개 */
.cal-day.has-record-1::before {
    background: radial-gradient(circle at 50% 50%,
        rgba(249, 168, 212, 0.55) 0%,
        rgba(216, 180, 254, 0.2) 55%,
        transparent 78%);
}

/* 2회 기록: 부드러운 로즈-라벤더 블러쉬 */
.cal-day.has-record-2::before {
    background: radial-gradient(circle at 50% 50%,
        rgba(236, 72, 153, 0.45) 0%,
        rgba(192, 132, 252, 0.28) 48%,
        transparent 72%);
    filter: blur(0.4px);
}

/* 3회 이상 기록: 피어나는 핑크-퍼플 블룸 */
.cal-day.has-record-3::before {
    background: radial-gradient(circle at 50% 50%,
        rgba(236, 72, 153, 0.68) 0%,
        rgba(168, 85, 247, 0.42) 42%,
        rgba(139, 92, 246, 0.16) 65%,
        transparent 80%);
    filter: blur(0.5px);
    animation: calRecordPulse 3s ease-in-out infinite;
}

@keyframes calRecordPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.75; }
}

/* 선택/범위 상태에서는 안개 효과 숨김 */
.cal-day.selected-start::before,
.cal-day.selected-end::before,
.cal-day.in-range::before {
    display: none;
}

.cal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.cal-range-display {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cal-apply-btn {
    padding: 7px 20px;
    border-radius: 20px;
    border: none;
    background: var(--record-gradient);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.25);
}

.cal-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}

/* ===== 도넛 차트 섹션 ===== */
.chart-section {
    margin-bottom: 1.5rem;
}

/* 일 평균 배지 */
.chart-context-badge {
    display: block;
    width: fit-content;
    margin: 0 auto 18px;
    font-family: var(--font-outfit);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--record-pink);
    background: linear-gradient(135deg, rgba(236,72,153,0.1), rgba(168,85,247,0.08));
    border: 1px solid rgba(236,72,153,0.2);
    border-radius: 20px;
    padding: 5px 16px;
    animation: badgePop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

.chart-context-badge.hidden {
    display: none;
}

@keyframes badgePop {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.chart-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    box-shadow: 0 8px 32px rgba(236, 72, 153, 0.08), 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.3s ease;
    overflow: visible;
    position: relative;
}

.chart-card:hover {
    box-shadow: 0 12px 40px rgba(236, 72, 153, 0.12), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.chart-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-center-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 2;
}

.center-calories-value {
    display: block;
    font-family: var(--font-outfit);
    font-size: 2rem;
    font-weight: 800;
    background: var(--record-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.center-calories-unit {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* 도넛 외부 커스텀 툴팁 */
.macro-tooltip {
    position: absolute;
    z-index: 50;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 10px 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    transform: translate(-50%, calc(-100% - 14px));
    text-align: center;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 84px;
}

.mtt-label {
    font-size: 0.64rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.mtt-value {
    font-family: var(--font-outfit);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.15;
}

.mtt-pct {
    font-family: var(--font-outfit);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* SVG 레이블 오버레이 */
.macro-labels-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    filter: drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.1));
}

/* 영양소 레전드 */
.macro-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-carbs .legend-dot {
    background: var(--color-carbs);
}

.legend-protein .legend-dot {
    background: var(--color-protein);
}

.legend-fat .legend-dot {
    background: var(--color-fat);
}

.legend-info {
    display: flex;
    flex-direction: column;
}

.legend-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.legend-value {
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
}

/* 리포트 이동 버튼 */
.report-link-row {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.view-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 20px;
    border: 1.5px solid rgba(236, 72, 153, 0.25);
    background: rgba(236, 72, 153, 0.05);
    color: var(--record-pink);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
}

.view-report-btn:hover {
    background: var(--record-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
    transform: translateY(-1px);
}

.view-report-btn:active {
    transform: scale(0.97);
}

/* ===== 영양소 상세 카드 ===== */
.nutrient-detail-section {
    margin-bottom: 1.5rem;
}

.nutrient-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.nutrient-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 16px 14px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
    transition: all 0.3s ease;
}

.nutrient-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.nutrient-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.nutrient-card-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.nutrient-card-value {
    display: block;
    font-family: var(--font-outfit);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2px;
}

.nutrient-card-pct {
    display: block;
    font-family: var(--font-outfit);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.card-carbs .nutrient-card-pct {
    color: var(--color-carbs);
}

.card-protein .nutrient-card-pct {
    color: var(--color-protein);
}

.card-fat .nutrient-card-pct {
    color: var(--color-fat);
}

.nutrient-bar-bg {
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.nutrient-bar {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-carbs {
    background: var(--color-carbs);
}

.bar-protein {
    background: var(--color-protein);
}

.bar-fat {
    background: var(--color-fat);
}

.card-carbs {
    border-bottom: 3px solid var(--color-carbs);
}

.card-protein {
    border-bottom: 3px solid var(--color-protein);
}

.card-fat {
    border-bottom: 3px solid var(--color-fat);
}

/* ===== 식사 기록 리스트 ===== */
.records-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-family: var(--font-outfit);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
}

.record-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--record-pink);
    background: rgba(236, 72, 153, 0.08);
    padding: 4px 12px;
    border-radius: 20px;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeSlideUp 0.4s ease-out both;
}

.record-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.08);
}

.record-date-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--record-purple);
    background: rgba(168, 85, 247, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.record-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.record-time::before {
    content: '🕐';
    font-size: 0.8rem;
}

.record-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-items {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    flex: 1;
    margin-right: 12px;
}

.record-calories {
    font-family: var(--font-outfit);
    font-weight: 700;
    color: var(--record-pink);
    font-size: 1.05rem;
    white-space: nowrap;
}

.record-macros {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.macro-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.7);
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    font-weight: 500;
}

.macro-tag b {
    color: var(--text-color);
    margin-left: 2px;
    font-weight: 700;
}

.tag-carbs {
    border-left: 3px solid var(--color-carbs);
}

.tag-protein {
    border-left: 3px solid var(--color-protein);
}

.tag-fat {
    border-left: 3px solid var(--color-fat);
}

.macro-bar-container {
    height: 4px;
    width: 100%;
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.03);
}

.macro-bar-segment {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.macro-bar-carbs {
    background: var(--color-carbs);
}

.macro-bar-protein {
    background: var(--color-protein);
}

.macro-bar-fat {
    background: var(--color-fat);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    border: 1px dashed rgba(236, 72, 153, 0.2);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.empty-state .hint {
    font-size: 0.82rem;
    margin-top: 6px;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .chart-wrapper {
        width: 180px;
        height: 180px;
    }

    .center-calories-value {
        font-size: 1.5rem;
    }

    .nutrient-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .nutrient-card {
        padding: 12px 8px;
    }

    .nutrient-card-value {
        font-size: 1rem;
    }

    .macro-legend {
        gap: 12px;
    }

    .record-macros {
        flex-wrap: wrap;
    }

    .quick-range-pills {
        gap: 4px;
    }

    .range-pill {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .date-display-text {
        font-size: 0.92rem;
    }
}

/* ===== 카드 액션 버튼 ===== */
.record-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.record-card-meta {
    flex: 1;
}

.record-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 8px;
}

.record-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.03);
}

.record-action-btn:hover {
    transform: scale(1.1);
}

.btn-edit-time {
    color: var(--record-purple);
}

.btn-edit-time:hover {
    background: rgba(168, 85, 247, 0.1);
}

.btn-delete {
    color: #ef4444;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ===== 모달 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: overlayFadeIn 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-sheet {
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    animation: sheetSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

@keyframes sheetSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin: 0 auto 16px;
}

.modal-title {
    font-family: var(--font-outfit);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    font-weight: 500;
}

.time-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(168, 85, 247, 0.15);
    border-radius: 14px;
    font-size: 1.1rem;
    font-family: var(--font-outfit);
    font-weight: 600;
    color: var(--text-color);
    background: rgba(168, 85, 247, 0.03);
    margin-bottom: 18px;
    transition: border-color 0.2s ease;
    text-align: center;
}

.time-input:focus {
    outline: none;
    border-color: var(--record-purple);
    background: rgba(168, 85, 247, 0.06);
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn-secondary {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.modal-btn-primary {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: var(--record-gradient);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4);
}

.modal-btn-danger {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modal-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* ===== Toast notification ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2000;
    animation: toastIn 0.3s ease forwards;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* ===== FAB 추가 버튼 ===== */
.fab-add {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--record-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
}

.fab-add:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 28px rgba(236, 72, 153, 0.5);
}

.fab-add:active {
    transform: scale(0.95);
}

/* ===== 시계 UI ===== */
.clock-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ampm-toggle {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 3px;
}

.ampm-btn {
    padding: 6px 18px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ampm-btn.active {
    background: var(--record-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.clock-face {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(236, 72, 153, 0.03);
    border: 2px solid rgba(236, 72, 153, 0.1);
}

.clock-center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--record-gradient);
    z-index: 3;
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 3px;
    height: 60px;
    background: var(--record-gradient);
    border-radius: 3px;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.clock-hour {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-outfit);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 4;
}

.clock-hour:hover {
    background: rgba(236, 72, 153, 0.1);
    color: var(--record-pink);
    transform: scale(1.15);
}

.clock-hour.selected {
    background: var(--record-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.4);
    transform: scale(1.1);
}

.selected-time-display {
    font-family: var(--font-outfit);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--record-pink);
    text-align: center;
}

/* ===== 식사 기록 추가 모달 전용 ===== */
.modal-sheet-tall {
    max-height: 90vh;
    overflow-y: auto;
}

.add-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
}

.add-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.add-date-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid rgba(236, 72, 153, 0.15);
    border-radius: 14px;
    font-size: 1rem;
    font-family: var(--font-outfit);
    font-weight: 600;
    color: var(--text-color);
    background: rgba(236, 72, 153, 0.03);
    transition: border-color 0.2s;
    text-align: center;
}

.add-date-input:focus {
    outline: none;
    border-color: var(--record-pink);
}

.add-food-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(168, 85, 247, 0.15);
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    background: rgba(168, 85, 247, 0.03);
    transition: border-color 0.2s;
}

.add-food-input:focus {
    outline: none;
    border-color: var(--record-purple);
    background: rgba(168, 85, 247, 0.06);
}

.add-food-input::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

/* ===== 음식량 추정 Step 2 ===== */
.add-step.hidden {
    display: none;
}

.add-step {
    animation: stepFadeSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.step2-desc {
    margin-bottom: 14px;
}

.food-rows-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 38vh;
    overflow-y: auto;
    padding-right: 2px;
    margin-bottom: 4px;
}

.food-row-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(236,72,153,0.04), rgba(168,85,247,0.06));
    border: 1.5px solid rgba(168, 85, 247, 0.15);
    border-radius: 14px;
    padding: 10px 12px;
    animation: rowAppear 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rowAppear {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.food-row-name-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    outline: none;
    min-width: 0;
}

.food-row-name-input::placeholder {
    color: rgba(0, 0, 0, 0.2);
    font-weight: 400;
}

.food-row-divider {
    width: 1px;
    height: 18px;
    background: rgba(168, 85, 247, 0.2);
    flex-shrink: 0;
}

.food-row-grams-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.food-row-grams-input {
    width: 52px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--record-purple);
    text-align: right;
    outline: none;
    -moz-appearance: textfield;
}

.food-row-grams-input::-webkit-outer-spin-button,
.food-row-grams-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.food-row-unit {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.food-row-delete-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.food-row-delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.add-food-row-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    padding: 11px;
    border: 1.5px dashed rgba(168, 85, 247, 0.35);
    border-radius: 14px;
    background: transparent;
    color: var(--record-purple);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.add-food-row-btn:hover {
    background: rgba(168, 85, 247, 0.06);
    border-color: rgba(168, 85, 247, 0.55);
}

/* 버튼 스피너 */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

.btn-spinner.hidden {
    display: none;
}

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