/* ===============================================================================================
// == MOBILE FIRST REFACTOR V7.2 (CONFLICTS REMOVED & NOTIFICATION DOT)
// ===============================================================================================
// NOTE: This version REMOVES all conflicting CSS Grid and sizing rules for
// .profile-card and .profile-medal-slot from all media queries.
// The layout is now 100% controlled by the Tailwind classes in fitness-tracker.html.
// =============================================================================================== */

/* ==========================================================================
   VISUAL HIERARCHY OVERHAUL (Log Day Modal)
   ========================================================================== */

:root {
    --d7-bg: #08090c;
    --d7-bg-soft: #0e1016;
    --d7-panel: rgba(18, 20, 29, 0.82);
    --d7-panel-solid: #12151e;
    --d7-text: #f5f7fb;
    --d7-muted: #a7adbb;
    --d7-border: rgba(255, 255, 255, 0.09);
    --d7-purple: #9d63ff;
    --d7-teal: #4de2c5;
    --d7-pink: #ff5fa2;
}

#app-container {
    min-height: 100vh;
    color: var(--d7-text);
    background:
        radial-gradient(circle at 12% 5%, rgba(157, 99, 255, 0.16), transparent 30%),
        radial-gradient(circle at 88% 16%, rgba(77, 226, 197, 0.11), transparent 28%),
        var(--d7-bg);
}

#app-container > header {
    background: rgba(8, 9, 12, 0.86) !important;
    border-color: rgba(157, 99, 255, 0.55) !important;
    backdrop-filter: blur(18px);
}

#ft-welcome-message { color: var(--d7-teal) !important; }
#app-container nav button:hover { color: var(--d7-teal) !important; }

.season-banner {
    position: relative;
    margin: 0 0 14px;
    padding: 17px 20px;
    overflow: hidden;
    text-align: center;
    background: linear-gradient(115deg, rgba(157, 99, 255, 0.18), rgba(77, 226, 197, 0.09));
    border: 1px solid var(--d7-border);
    border-radius: 20px;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.25);
}

.season-banner::after {
    content: "";
    position: absolute;
    inset: auto 12% 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--d7-purple), var(--d7-teal), transparent);
}

.season-banner-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--d7-muted);
    font: 700 0.65rem/1.2 'Share Tech Mono', monospace;
    letter-spacing: 0.22em;
}

.season-banner h2 {
    margin: 0;
    color: var(--d7-text);
    font: 800 clamp(1.35rem, 4vw, 2.1rem)/1.1 'Orbitron', sans-serif;
    letter-spacing: -0.02em;
    text-shadow: 0 0 24px rgba(157, 99, 255, 0.32);
}

#profileCard,
#quickAddContainer,
#missionBoardWrapper,
#helper-tile,
#tab-content-stats > div > div,
#tab-content-social > div {
    background-color: var(--d7-panel) !important;
    border-color: var(--d7-border) !important;
    backdrop-filter: blur(16px);
}

.tab-nav-container { border-color: rgba(157, 99, 255, 0.45) !important; }
.tab-nav-btn.active { color: var(--d7-teal) !important; border-color: var(--d7-teal) !important; }
#missionBoardWrapper > h3 { color: var(--d7-teal) !important; }

.mission-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--d7-border);
    border-left: 4px solid var(--d7-purple);
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.mission-card:hover {
    box-shadow: 0 18px 42px rgba(157, 99, 255, 0.16);
}

.mission-card.completed { border-left-color: var(--d7-teal); }
.mission-reward { color: var(--d7-pink); }
.mission-progress-bar { background: rgba(255, 255, 255, 0.07); }
.mission-progress-bar .progress { background: linear-gradient(90deg, var(--d7-purple), var(--d7-pink)); }
.mission-card.completed .mission-progress-bar .progress { background: var(--d7-teal); }

.mission-empty-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 180px;
    padding: 28px;
    color: var(--d7-muted);
    text-align: center;
    background: rgba(255,255,255,.025);
    border: 1px dashed rgba(157,99,255,.4);
    border-radius: 16px;
}

.mission-empty-state i { color: var(--d7-purple); font-size: 1.8rem; }
.mission-empty-state strong { color: var(--d7-text); font-family: 'Orbitron', sans-serif; }
.mission-empty-state span { max-width: 520px; }

/* --- LEVEL 1: Main Category Container --- */
.log-day-category {
    background-color: #2a2a2e;
    border: 1px solid #444;
    border-radius: 8px;
    margin-bottom: 15px; /* Spacing between Main Categories */
    overflow: hidden; /* Keeps child elements inside rounded corners */
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Distinct Header Bar for Main Category */
.log-day-category-header {
    background: linear-gradient(to right, #333, #252529);
    padding: 12px 15px;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.log-day-category-header label {
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    font-size: 1.1em;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* --- LEVEL 2: Sub-Category "Boxes" --- */
.advanced-fields-container {
    padding: 15px;
    background-color: #222; /* Slightly darker inner background */
}

.sub-category-container {
    background-color: #1a1a1e; /* Darkest background for the "Group" */
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px; /* Spacing between Sub-Categories */
}

/* Sub-Category Title */
.sub-category-header {
    color: #00dffc; /* Cyan text to pop against dark bg */
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

/* --- LEVEL 3: Exercise Rows & Dividers --- */
.advanced-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px;
    border-bottom: 1px solid #2a2a2e; /* distinct line between items */
}

/* Remove border from the last item in a group so it looks clean */
.sub-category-container .advanced-field:last-of-type {
    border-bottom: none;
}

.advanced-field label {
    font-size: 0.95em;
    color: #ccc;
}

/* --- CUSTOM EXERCISES (Green Highlight) --- */
.custom-exercise-field {
    background-color: rgba(0, 255, 136, 0.08); /* Subtle Green tint */
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-left: 4px solid #00ff88; /* Strong indicator */
    border-radius: 4px;
    margin: 5px 0;
    padding: 8px 10px; /* Extra padding for the box look */
}

.custom-exercise-field label {
    color: #e0ffeb;
    font-weight: 500;
}

.custom-exercise-field input {
    border-color: #00ff88 !important;
    background-color: #0a1f12 !important; /* Dark green input bg */
}

/* --- "Add Custom" Button Styling --- */
.add-exercise-placeholder {
    margin-top: 10px;
    text-align: right;
}

.add-custom-exercise-btn {
    background: none;
    border: 1px dashed #555;
    color: #888;
    font-size: 0.8em;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-custom-exercise-btn:hover {
    border-color: #00ff88;
    color: #00ff88;
    background-color: rgba(0, 255, 136, 0.05);
}

/* --- General & Loading Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #1a1a1e;
    color: #eee;
    font-family: 'Delius', cursive;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
.container { 
    width: 100%; 
    max-width: 1400px; 
    margin: 0 auto;
    padding: 0 10px;
}
#loadingOverlay {
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: #1a1a1e; 
    z-index: 1000; 
    color: #00b4d8;
    font-family: 'Orbitron', sans-serif; 
    font-size: 1.5em;
}
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2); 
    border-left-color: #00b4d8;
    border-radius: 50%; 
    width: 50px; 
    height: 50px;
    animation: spin 1s linear infinite; 
    margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Skeleton Loading Styles --- */
.skeleton { opacity: 0.7; animation: skeleton-loading 1s linear infinite alternate; }
.skeleton-text { width: 100%; height: 0.7em; margin-bottom: 0.5em; border-radius: 0.25rem; }
.skeleton-avatar { width: 100px; height: 100px; border-radius: 50%; }
@keyframes skeleton-loading {
    0% { background-color: hsl(200, 20%, 25%); }
    100% { background-color: hsl(200, 20%, 35%); }
}

/* --- Helper Bot Tile --- */
/* [DEPRECATED] .helper-tile layout is now controlled by Tailwind */

/* --- Header & Top Controls (Mobile First) --- */
.main-header { 
    /* These styles are fine as they don't conflict with the new header */
    background: linear-gradient(to right, #111, #301a30, #111); 
    border-bottom: 3px solid #00aaff; 
    padding: 15px 0; 
    margin-bottom: 20px; 
}
/* [DEPRECATED] .main-header .container is now controlled by Tailwind */
/* [DEPRECATED] #ft-welcome-message is now controlled by Tailwind */
/* [DEPRECATED] .main-header nav is now controlled by Tailwind */

/* --- SEASON MESSAGE HEADER STYLES [DEPRECATED - Now in HTML with Tailwind] --- */
/* Kept commented out for reference if needed, but new styles are inline. */
/* .season-message-header { ... } */


/* [DEPRECATED] #top-controls-section is now controlled by Tailwind */
/* [DEPRECATED] .quick-add-panel is now controlled by Tailwind */

/* --- Grid Layout (Mobile First) --- */
/* [DEPRECATED] .main-grid is now controlled by Tailwind */
.tracker-section { background: #222226; padding: 15px; border-radius: 8px; border: 1px solid #333; }
.tracker-section h3 { color: #00b4d8; text-align: center; font-family: 'Orbitron', sans-serif; font-size: 1.4em; }

/* --- Mission Board & Core Content --- */
.mission-board { display: grid; grid-template-columns: 1fr; gap: 15px; }
.mission-card { background: #2a2a2e; padding: 15px; border-radius: 5px; border-left: 4px solid #00aaff; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; text-align: center; }
.mission-card:hover { transform: translateY(-3px); box-shadow: 0 3px 12px rgba(0, 170, 255, 0.2); }
.mission-card.completed { border-left-color: #00ff88; }
.mission-card h4 { margin: 0 0 5px 0; color: #eee; }
.mission-card p { margin: 0 0 10px 0; font-size: 0.9em; color: #aaa; }
.mission-reward { font-weight: bold; color: #FFD700; margin-bottom: 10px; }
.mission-progress-bar { background-color: #1a1a1e; border-radius: 5px; height: 8px; overflow: hidden; margin: 0 auto 5px; }
.mission-progress-bar .progress { background-color: #00aaff; height: 100%; width: 0%; transition: width 0.5s ease; }
.mission-card.completed .mission-progress-bar .progress { background-color: #00ff88; }
#showMoreMissionsBtn { background: none; border: 1px solid #00b4d8; color: #00b4d8; padding: 8px 15px; border-radius: 5px; cursor: pointer; margin-top: 15px; display: block; margin-left: auto; margin-right: auto; }
#moreMissionsContainer { display: none; margin-top: 15px; }

/* --- Chart & Drill Styling --- */
.stats-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
.stat-card { background: #2a2a2e; padding: 15px; border-radius: 8px; }
.stat-card h4 { color: #00b4d8; font-family: 'Orbitron', sans-serif; text-align: center; }
.stat-card h4 span { color: #eee; }
.drill-stats { display: flex; justify-content: space-between; margin: 5px 0 10px; color: #ccc; }
.chart-wrapper { position: relative; height: 200px; background: linear-gradient(145deg, #1a1a1e, #2a2a2e); border-radius: 5px; padding: 10px; margin-top: 10px; border: 1px solid #444; }

/* --- Profile Card (Mobile First) --- */
/* [FIX V7.2] REMOVED all conflicting CSS Grid and size rules. */
/* Layout is now 100% controlled by Tailwind classes in fitness-tracker.html */
.profile-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.5s ease-in-out;
}
.avatar-container { border: 3px solid #888; border-radius: 50%; overflow: hidden; }
.avatar-container img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { background: rgba(0, 0, 0, 0.7); padding: 15px; border-radius: 8px; width: 100%; }
.profile-info h3 { 
    font-size: 1.3em; 
    margin: 0 0 10px; 
    font-family: 'Orbitron', sans-serif; 
    word-break: break-word; 
}
.player-gamertag { color: #fff; font-weight: 700; }
.player-title { display: block; font-size: 0.8em; font-weight: 400; color: #00dffc; text-shadow: 0 0 8px #00aaff; }
.profile-name-divider { height: 1px; width: 80%; margin: 0 auto 10px; background: linear-gradient(to right, transparent, #00aaff, transparent); }
.profile-medal-slot { display: flex; justify-content: center; align-items: center; position: relative; }
.profile-medal-slot img { 
    filter: drop-shadow(0 0 8px rgba(0, 170, 255, 0.7)); 
    animation: pulse-glow 2.5s infinite ease-in-out; 
}
.rank-level-text { 
    /* This style is used by Tailwind 'absolute' in ui.js */
    color: #fff; 
    font-family: 'Orbitron', sans-serif; 
    font-size: 0.7em; 
    font-weight: bold; 
    text-shadow: 1px 1px 3px #000; 
    pointer-events: none; 
}
.profile-loadout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: rgba(0,0,0,0.6); padding: 10px; border-radius: 8px; width: 100%; }
.loadout-slot { background-color: rgba(0,0,0,0.3); border: 1px solid #00aaff; box-shadow: 0 0 8px rgba(0, 170, 255, 0.5); border-radius: 5px; /* height: 80px; */ display: flex; align-items: center; justify-content: center; overflow: hidden; transition: all 0.2s ease-in-out; }
.loadout-slot:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(0, 170, 255, 0.9); }
.loadout-slot img { width: 100%; height: 100%; object-fit: cover; padding: 0; }
.category-ranks { display: flex; justify-content: space-around; margin-top: 10px; text-align: center; }
.category-rank-item small { font-size: 0.8em; color: #fff; font-weight: bold; display: block; }
.category-rank-item p { margin: 2px 0 0 0; font-weight: bold; font-size: 0.9em; }
@keyframes pulse-glow { 0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 170, 255, 0.7)); } 50% { filter: drop-shadow(0 0 15px rgba(0, 170, 255, 1)); } }

/* --- Champion Glow --- */
@keyframes champion-fire-glow { 0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 69, 0, 0.7)) drop-shadow(0 0 4px rgba(255, 140, 0, 0.5)); transform: scale(1); } 50% { filter: drop-shadow(0 0 16px rgba(255, 69, 0, 1)) drop-shadow(0 0 8px rgba(255, 140, 0, 0.8)); transform: scale(1.05); } }
@keyframes champion-text-fire { 0% { text-shadow: 0 0 4px #ffc300, 0 0 8px #ff8c00, 0 0 12px #ff4500, 0 0 16px #ff4500; } 25% { text-shadow: 0 0 6px #ffc300, 0 0 10px #ff8c00, 0 0 14px #ff4500, 0 0 18px #ff4500, 0 0 2px rgba(255,255,255,0.5); } 50% { text-shadow: 0 0 4px #ffc300, 0 0 8px #ff8c00, 0 0 12px #ff4500, 0 0 16px #ff4500; } 75% { text-shadow: 0 0 7px #ffc300, 0 0 11px #ff8c00, 0 0 15px #ff4500, 0 0 19px #ff4500, 0 0 3px rgba(255,255,255,0.5); } 100% { text-shadow: 0 0 4px #ffc300, 0 0 8px #ff8c00, 0 0 12px #ff4500, 0 0 16px #ff4500; } }
.profile-medal-slot.champion-glow img { animation: champion-fire-glow 2s infinite ease-in-out; }
.profile-medal-slot.champion-glow .rank-level-text { color: #ffc300; animation: champion-text-fire 2s infinite linear; }

/* --- Right Sidebar Content --- */
.mission-feed { max-height: 300px; overflow-y: auto; }
.feed-item { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #333; font-size: 0.9em; }
.feed-item:last-child { border-bottom: none; }
.feed-item img { width: 30px; height: 30px; border-radius: 50%; }
.vitruvian-man-tile img { width: 100%; border-radius: 8px; opacity: 0.7; }
.leaderboard-item { display: flex; align-items: center; padding: 8px; border-radius: 4px; transition: transform 0.2s, background-color 0.2s; }
.leaderboard-item:hover { transform: translateX(5px); background-color: rgba(0, 170, 255, 0.1); }

/* --- Modal Styles (Mobile First) --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); display: none; justify-content: center; align-items: center; z-index: 2000; padding: 10px; overflow-x: hidden; }
.modal-content { background: #1a1a1e; border: 1px solid #00b4d8; border-radius: 8px; width: 100%; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 5px 25px rgba(0, 180, 216, 0.2); position: relative; }
.modal-header { padding: 15px; border-bottom: 1px solid #444; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.modal-title { font-family: 'Orbitron', sans-serif; font-size: 1.2em; color: #00dffc; margin: 0; }
.modal-subtitle { font-size: 0.9em; color: #aaa; margin: 10px 0; max-width: 450px; }
.modal-tabs { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.modal-tab-btn { background: #2a2a2e; color: #aaa; border: 1px solid #444; padding: 8px 12px; border-radius: 5px; cursor: pointer; font-family: 'Orbitron', sans-serif; font-size: 0.9em; }
.modal-tab-btn.active { background: #00b4d8; color: #1a1a1e; border-color: #00b4d8; }
.modal-close-btn { background: none; border: none; color: #fff; font-size: 1.8em; cursor: pointer; padding: 0; line-height: 1; position: absolute; top: 10px; right: 15px; z-index: 10; }
.modal-close-btn:hover { color: #dc3545; }
.modal-body { padding: 15px; overflow-y: auto; }
.modal-footer { padding: 15px; border-top: 1px solid #444; display: flex; justify-content: flex-end; }
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* --- Enlarge Image Modal --- */
.enlarge-modal-content { position: relative; max-width: 90vw; max-height: 90vh; display: flex; justify-content: center; align-items: center; }
.enlarge-modal-content img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
#enlargeImageModal .modal-close-btn { position: absolute; top: 15px; right: 20px; font-size: 2em; z-index: 10; color: #fff; text-shadow: 0 0 5px #000; background-color: rgba(0, 0, 0, 0.5); border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0; border: 2px solid rgba(255, 255, 255, 0.5); transition: background-color 0.2s, color 0.2s; }
#enlargeImageModal .modal-close-btn:hover { background-color: rgba(220, 53, 69, 0.9); color: #fff; }

/* --- Store/Armory/Medals (Cleaned for Tailwind) --- */
/* Removed old .store-grid, .store-item, .store-item-image as these are now Tailwind classes in ui.js */
.armory-actions-stack { display: flex; flex-direction: column; gap: 8px; margin-top: auto; width: 100%; }
.armory-actions-stack .store-item-btn { width: 100%; margin-top: 0; padding: 8px; }

/* --- Medals --- */
.medal-progress-text { font-size: 0.8em; color: #ccc; margin-top: 5px; }
.medal-badge-container { position: absolute; bottom: 5px; right: 5px; z-index: 3; display: flex; align-items: center; gap: 6px; background-color: rgba(0, 0, 0, 0.7); padding: 3px 3px 3px 8px; border-radius: 4px; }
.medal-badge-name { font-size: 0.7em; color: #fff; font-weight: bold; font-family: 'Orbitron', sans-serif; }
.medal-tier-badge { font-size: 0.7em; padding: 2px 6px; border-radius: 4px; color: #1a1a1e; font-weight: bold; font-family: 'Orbitron', sans-serif; }
.medal-locked-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Orbitron', sans-serif; font-size: 1.2em; font-weight: bold; z-index: 3; border-radius: 5px; }
.medal-description { font-size: 0.9em; color: #aaa; margin-bottom: 10px; min-height: 3em; }
.medal-unlock-hint { font-size: 0.8em; color: #00aaff; font-style: italic; margin-top: 10px; }

/* --- Edit Profile & Admin Forms --- */
.edit-subsection { margin-bottom: 20px; }
.edit-subsection label { display: block; margin-bottom: 5px; font-weight: bold; color: #ccc;}
.edit-subsection input { padding: 10px; border-radius: 4px; border: 1px solid #666; background-color: #444; color: #eee; width: 100%; }
.edit-subsection button { padding: 10px 15px; cursor: pointer; border-radius: 4px; border: 1px solid #666; background-color: #555; color: #eee; margin-top: 10px; width: 100%; }
.unequip-item-btn { background-color: #a03028 !important; color: white !important; border-color: #8b2a22 !important; }
.loadout-slot-picker { width: 100%; margin-bottom: 12px; }
.loadout-picker-heading { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; color: #fff; }
.loadout-picker-heading span { color: #aaa; font-size: 0.82rem; }
.loadout-picker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.loadout-picker-slot { display: flex; flex-direction: column; gap: 5px; min-height: 92px; padding: 10px; text-align: left; color: #ddd; background: #17171b; border: 2px solid #444; border-radius: 8px; cursor: pointer; transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s; }
.loadout-picker-slot:hover { border-color: #00aaff; }
.loadout-picker-slot.selected { border-color: #00ff88; background: rgba(0, 255, 136, 0.08); box-shadow: 0 0 12px rgba(0, 255, 136, 0.25); }
.loadout-picker-position { color: #00dffc; font-family: 'Orbitron', sans-serif; font-size: 0.72rem; font-weight: bold; text-transform: uppercase; }
.loadout-picker-item { font-size: 0.9rem; font-weight: bold; overflow-wrap: anywhere; }
.loadout-picker-action { margin-top: auto; color: #999; font-size: 0.72rem; }
.loadout-picker-slot.selected .loadout-picker-action { color: #00ff88; }
@media (max-width: 520px) { .loadout-picker-grid { grid-template-columns: 1fr; } .loadout-picker-slot { min-height: 72px; } }
.profile-loadout-editor-heading h4, .profile-appearance-editor h4 { margin-bottom: 4px; }
.profile-loadout-editor-heading p { margin: 0 0 12px; color: #aaa; font-size: 0.84rem; }
.profile-loadout-editor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.profile-loadout-editor-slot { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 10px; background: #202025; border: 2px solid #00aaff; border-radius: 9px; text-align: center; box-shadow: 0 0 9px rgba(0, 170, 255, 0.16); }
.profile-loadout-editor-slot.empty { border-style: dashed; border-color: #555; }
.profile-loadout-editor-position { color: #00dffc; font-family: 'Orbitron', sans-serif; font-size: 0.68rem; font-weight: bold; text-transform: uppercase; }
.profile-loadout-editor-image { height: 72px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 6px; background: #111; }
.profile-loadout-editor-image img { width: 100%; height: 100%; object-fit: cover; }
.profile-slot-empty-icon { color: #666; font-size: 1.5rem; }
.profile-loadout-editor-slot strong { min-height: 2.4em; font-size: 0.85rem; overflow-wrap: anywhere; }
.profile-loadout-editor-slot button { width: 100%; margin-top: 0; padding: 8px 5px; font-size: 0.76rem; }
.profile-slot-change-btn { margin-top: auto !important; color: #111 !important; background: #00dffc !important; border-color: #00aaff !important; font-weight: bold; }
.profile-appearance-editor { margin-top: 18px; padding-top: 14px; border-top: 1px solid #444; }
.profile-appearance-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #333; }
.profile-appearance-row span:first-child { display: flex; flex-direction: column; gap: 2px; }
.profile-appearance-row small { color: #999; }
.profile-appearance-row button { width: auto; flex: 0 0 auto; margin: 0; padding: 7px 10px; }
.profile-default-label { color: #777; font-size: 0.76rem; }
@media (max-width: 600px) { .profile-loadout-editor-grid { grid-template-columns: 1fr; } .profile-loadout-editor-slot { display: grid; grid-template-columns: 72px 1fr; text-align: left; } .profile-loadout-editor-position { grid-column: 1 / -1; } .profile-loadout-editor-image { grid-row: span 3; } }
.error-text { font-size: 0.8em; color: #ff6666; min-height: 1em; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; margin-bottom: 15px; }
.profile-tile { cursor: pointer; border: 2px solid transparent; border-radius: 5px; max-width: 100%; height: auto; background-color: #444; transition: transform 0.2s ease, border-color 0.2s ease;}
.profile-tile:hover { transform: scale(1.05); }
.profile-tile.selected { border-color: #00aaff; box-shadow: 0 0 10px #00aaff; transform: scale(1.05);}
#adminPanel ul { list-style: none; padding: 0; margin-bottom: 25px; }
#adminPanel li { background-color: #333; padding: 15px; border-radius: 6px; margin-bottom: 10px; word-break: break-all; }
button.delete, button.decline { background-color: #a03028; color: white !important; border-color: #8b2a22 !important; margin-left: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
.form-grid label { font-weight: bold; color: #ccc; text-align: left;}
.form-grid input, .form-grid select { padding: 10px; border-radius: 4px; border: 1px solid #666; background-color: #444; color: #eee; width: 100%; }

/* --- Log Day Controls & Search --- */
.log-day-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #444;
    position: relative;
    text-align: center;
}
.log-day-search-title {
    font-size: 1.1em !important;
    font-weight: bold;
    text-shadow: 0 0 8px #00aaff;
}
.log-day-search {
    width: 100%;
    padding: 12px 15px;
    background-color: #2a2a2e;
    border: 1px solid #00aaff;
    border-radius: 5px;
    color: #eee;
    font-size: 1.1em;
}
.search-results-container {
    max-height: 150px;
    overflow-y: auto;
    background-color: #222226;
    border: 1px solid #444;
    border-radius: 5px;
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    text-align: left;
}
.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #333;
}
.search-result-item:hover {
    background-color: #00aaff;
    color: #1a1a1e;
}
.search-result-item .result-category {
    color: #ccc;
    font-size: 0.8em;
    margin-left: 5px;
    text-transform: capitalize;
}
.search-result-item:hover .result-category {
    color: #222;
}
.add-exercise-details summary {
    cursor: pointer;
    color: #00dffc;
    font-weight: bold;
}
.add-exercise-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding: 15px;
    background-color: #2a2a2e;
    border-radius: 5px;
}
.add-exercise-form select, .add-exercise-form input {
    background-color: #333; color: #eee; border: 1px solid #555; 
    border-radius: 4px; padding: 10px;
}
.advanced-toggle {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* --- Advanced Logging --- */
.log-day-form-container { display: flex; flex-direction: column; gap: 10px; }
.log-day-category { background-color: #2a2a2e; border-radius: 6px; padding: 12px; border: 1px solid #444; }
.log-day-category-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.log-day-category-header label { flex-grow: 1; font-weight: bold; font-size: 1.1em; word-break: break-word; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.log-day-category-header input[type="number"] { width: 80px; padding: 8px; border-radius: 4px; border: 1px solid #666; background-color: #444; color: #eee; text-align: right; flex-shrink: 0; font-size: 1em; }
.advanced-details { position: relative; }
.advanced-details summary { cursor: pointer; font-weight: bold; color: #00dffc; list-style: none; }
.advanced-details summary::-webkit-details-marker { display: none; }
.advanced-details[open] summary { color: #00ff88; }
.advanced-fields-container { display: none; margin-top: 10px; border-top: 1px solid #444; padding-top: 10px;}
.advanced-fields-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.advanced-field { display: flex; justify-content: space-between; align-items: center; }
.advanced-field label { color: #ccc; font-size: 0.9em; }
.advanced-field input { width: 70px; padding: 5px; text-align: right; background-color: #333; color: #eee; border: 1px solid #555; border-radius: 3px; font-size: 0.9em; }
.logged-today-text { font-style: italic; color: #aaa; font-size: 0.8em; }
.logged-today-value { color: #00dffc; font-weight: bold; }
.advanced-field.highlight-search {
    background-color: rgba(0, 255, 136, 0.1);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    padding: 2px 5px;
    margin: -2px -5px;
}

/* --- Notification Toast --- */
.notification-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #00aaff; color: white; padding: 15px 25px; border-radius: 8px; z-index: 3000; opacity: 0; visibility: hidden; transition: opacity 0.5s, bottom 0.5s, visibility 0.5s; font-family: 'Orbitron', sans-serif; width: 90%; max-width: 500px; text-align: center;}
.notification-toast.show { bottom: 40px; opacity: 1; visibility: visible; }
#update-notification { background-color: #ff8c00; display: flex; align-items: center; justify-content: center; gap: 15px; flex-wrap: wrap; }
#update-now-btn { background-color: #fff; color: #1a1a1e; border: none; border-radius: 5px; padding: 8px 12px; cursor: pointer; font-weight: bold; }

/* ===============================================================================================
// == TABLET & SMALL DESKTOP STYLES (min-width: 768px)
// =============================================================================================== */
@media (min-width: 768px) {
    .container { width: 90%; padding: 0 20px; }
    .main-header .container { flex-direction: row; justify-content: space-between; }
    #ft-welcome-message { font-size: 1.8em; text-align: left; }
    #top-controls-section { flex-direction: row; align-items: center; justify-content: space-between; }
    .quick-add-panel { flex-direction: row; align-items: center; flex-wrap: wrap; }
    .quick-add-panel > * { width: auto; }
    .quick-add-panel input[type="number"] { width: 70px; }
    .mission-board { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
    .modal-content { max-width: 700px; }
    .modal-header { flex-direction: row; justify-content: space-between; text-align: left; }
    .modal-close-btn { position: absolute; }
    .form-grid { grid-template-columns: 150px 1fr; align-items: center; }
    .form-grid label { text-align: right; padding-right: 10px; }
    .edit-subsection button { width: auto; }
    /* Removed store-grid as it uses tailwind now */
}

/* ===============================================================================================
// == DESKTOP STYLES (min-width: 1024px)
// =============================================================================================== */
@media (min-width: 1024px) {
    .main-grid { grid-template-columns: 1fr 350px; }
    .tracker-section { padding: 20px; }
    .modal-content { max-width: 1200px; }
    #logDayModal .modal-content, #editProfileModal .modal-content, #adminModal .modal-content { max-width: 850px; }
}

/* ===============================================================================================
// == LARGE DESKTOP STYLES (min-width: 1600px)
// =============================================================================================== */
@media (min-width: 1600px) {
    .container { max-width: 1500px; }
    .modal-content { max-width: 1500px; }
    .stat-card { padding: 25px; }
}

/* --- [NEW] Custom Exercise Styles --- */
.add-exercise-placeholder {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #555;
}

.add-custom-exercise-btn {
    width: 100%;
    padding: 8px;
    font-family: 'Orbitron', sans-serif;
    background-color: transparent;
    border: 2px dashed #00aaff;
    color: #00aaff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.add-custom-exercise-btn:hover {
    background-color: rgba(0, 170, 255, 0.1);
    color: #fff;
    border-style: solid;
}
.add-custom-exercise-btn:disabled {
    cursor: not-allowed;
    color: #666;
    border-color: #444;
}

.custom-exercise-field label span {
    font-size: 0.8em;
    color: #00ff88;
    font-style: italic;
}

/* ===============================================================================================
// == V7.2 TABBED LAYOUT & NOTIFICATION STYLES
// =============================================================================================== */

/* --- Tab Navigation --- */
.tab-nav-container {
    display: flex;
    border-bottom: 2px solid #00aaff;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.tab-nav-container::-webkit-scrollbar {
    display: none;
}

.tab-nav-btn {
    font-family: 'Orbitron', sans-serif;
    padding: 0.75rem 1rem;
    color: #888;
    border-bottom: 4px solid transparent;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}
@media (min-width: 640px) {
    .tab-nav-btn {
        font-size: 1em;
        padding: 0.75rem 1.5rem;
    }
}
.tab-nav-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}
.tab-nav-btn.active {
    color: #00dffc;
    border-bottom-color: #00dffc;
}

.notification-dot {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 0.75rem;
    height: 0.75rem;
    background-color: #dc2626;
    border-radius: 9999px;
    border: 2px solid #1a1a1e;
}

/* --- Tab Content Panels --- */
.tab-content-panel {
    display: none;
}
.tab-content-panel.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tab-content-panel.active-grid {
    display: grid;
    gap: 1.5rem;
}
@media (min-width: 1024px) {
    .tab-content-panel.active-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- BOSS ARENA STYLES --- */
.text-shadow-sm { text-shadow: 1px 1px 2px black; }
.scanlines {
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
    background-size: 100% 4px;
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 10;
}
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* Modal Animation */
#battle-report-modal { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Custom Exercise Styling (Restored) --- */
.custom-exercise-field {
    border-left: 3px solid #00ff88; /* Bright Green Border */
    background-color: rgba(0, 255, 136, 0.05); /* Subtle Green Background */
    margin-bottom: 5px;
    padding: 8px;
    border-radius: 0 4px 4px 0;
}

.custom-exercise-field label {
    color: #ccffdd; /* Lighter text for readability */
}

.custom-exercise-field label span {
    color: #00ff88; /* Green color for the "(Custom)" text */
    font-weight: bold;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Ensure inputs in custom fields align nicely */
.custom-exercise-field input {
    border-color: #00ff88 !important; /* Green border for the input box */
}

/* ==========================================================================
   COMPACT MODE LOG DAY OVERRIDES (Added Request)
   ========================================================================== */

/* Reduce Main Category Box Size */
.log-day-category {
    background-color: #2a2a2e;
    border: 1px solid #444;
    border-radius: 4px !important; /* Tighter radius */
    margin-bottom: 8px !important; /* Less space between categories */
    overflow: hidden;
    padding: 2px !important; /* Minimal padding */
}

/* Compact Header */
.log-day-category-header {
    background: linear-gradient(to right, #333, #252529);
    padding: 4px 8px !important; /* Very thin header */
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px !important; /* Force smaller height */
}

.log-day-category-header label {
    font-size: 0.9em !important; /* Smaller text */
    margin: 0;
}

/* Compact Sub-Category Box */
.sub-category-container {
    background-color: #1a1a1e;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 4px 8px !important; /* Much tighter padding */
    margin-bottom: 6px !important; /* Less gap */
}

.sub-category-header {
    font-size: 0.8em !important;
    margin-bottom: 2px !important;
    padding-bottom: 2px !important;
    color: #00dffc;
    border-bottom: 1px solid #333;
    font-weight: bold;
    text-transform: uppercase;
}

/* Single Line Rows & Tighter Inputs */
.advanced-field {
    padding: 2px 0 !important; /* Almost no vertical padding */
    border-bottom: 1px solid #2a2a2e;
    min-height: 24px !important; /* Very compact row */
}

.advanced-field label {
    font-size: 0.8em !important; /* Small, crisp text */
}

.advanced-field input {
    height: 20px !important; /* Slim input boxes */
    padding: 0 4px !important;
    font-size: 0.85em !important;
    width: 60px !important; /* Slightly narrower */
}

/* Custom Exercise Field Compact */
.custom-exercise-field {
    margin: 2px 0 !important;
    padding: 2px 6px !important;
    border-left-width: 3px !important;
}

/* Ensure the toggle area doesn't waste space */
.advanced-fields-container {
    padding: 4px !important;
}

/* ==========================================================================
   2026 ANNOUNCEMENT STYLES
   ========================================================================== */

/* Animated Gradient Text for "2026" */
.cyber-text-gradient {
    background: linear-gradient(to right, #00dffc, #ffffff, #00dffc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: cyber-shine 3s linear infinite;
    text-shadow: 0 0 20px rgba(0, 223, 252, 0.5);
}

@keyframes cyber-shine {
    to { background-position: 200% center; }
}

/* Cyan Text Glow */
.glow-cyan {
    text-shadow: 0 0 8px rgba(0, 223, 252, 0.8);
}

/* Main-site palette overrides kept last so legacy tactical rules cannot win. */
#app-container .tracker-section,
#app-container #profileCard,
#app-container #missionBoardWrapper,
#app-container #helper-tile,
#app-container #tab-content-stats > div > div,
#app-container #tab-content-social > div {
    background-color: var(--d7-panel) !important;
    border-color: var(--d7-border) !important;
}

#app-container .mission-card {
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid var(--d7-border) !important;
    border-left: 4px solid var(--d7-purple) !important;
    border-radius: 16px !important;
}

#app-container .mission-card.completed { border-left-color: var(--d7-teal) !important; }
#app-container .mission-reward { color: var(--d7-pink) !important; }
#app-container .mission-progress-bar { background: rgba(255, 255, 255, 0.07) !important; }
#app-container .mission-progress-bar .progress {
    background: linear-gradient(90deg, var(--d7-purple), var(--d7-pink)) !important;
}
#app-container .mission-card.completed .mission-progress-bar .progress {
    background: var(--d7-teal) !important;
}


/* --- D7 LOG DAY MOBILE UX --- */
#logDayModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 94dvh;
    overflow: hidden;
}
#logDayModal .modal-header {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 30;
    background: #1a1a1e;
}
#logDayModal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 20px;
}
#logDayModal .modal-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 35;
    background: rgba(26, 26, 30, 0.98);
    border-top: 1px solid #3a3a42;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}
#logDayModal #saveLogBtn {
    width: 100% !important;
    min-height: 52px;
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}
#logDayModal .edit-subsection {
    margin-bottom: 10px;
}
#logDayModal #logDayDateInput {
    min-height: 46px;
    font-size: 16px;
}
.log-day-controls {
    gap: 10px;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid #3c3c45;
    border-radius: 12px;
    background: #202025;
    text-align: left;
}
.log-day-search-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.log-day-search-title { margin: 0 !important; font-size: 1rem !important; }
.log-day-search-heading .modal-subtitle { margin: 2px 0 0; font-size: 0.78rem; }
.log-search-wrap { position: relative; }
.log-day-search {
    min-height: 48px;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 16px;
}
.search-results-container {
    top: calc(100% + 4px);
    max-height: 240px;
    border-radius: 10px;
    z-index: 60;
    box-shadow: 0 14px 32px rgba(0,0,0,0.45);
}
.search-result-item { min-height: 46px; padding: 12px; }
.log-jump-bar {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 2px 0 5px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.log-jump-bar::-webkit-scrollbar { display: none; }
.log-jump-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #454552;
    border-radius: 999px;
    background: #2b2b32;
    color: #ddd;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.log-jump-btn:active { border-color: #00dffc; color: #00dffc; }
.advanced-toggle {
    justify-content: space-between;
    min-height: 40px;
    margin: 0 0 10px;
    padding: 7px 10px;
    border-radius: 10px;
    background: #202025;
    border: 1px solid #383840;
}
.log-day-form-container { gap: 8px; }
.log-day-category {
    scroll-margin-top: 10px;
    padding: 12px;
    border-radius: 12px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.log-day-category-active {
    border-color: #00dffc !important;
    box-shadow: 0 0 0 2px rgba(0,223,252,.15), 0 0 20px rgba(0,223,252,.12);
}
.log-day-category-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
.log-category-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.log-category-copy > label { color: #fff; font-size: 1rem; line-height: 1.15; }
.log-category-copy .logged-today-text { flex: 0 0 auto; font-size: 0.72rem; }
.header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 66px auto;
    gap: 8px;
}
.log-quick-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.log-step-btn {
    min-height: 44px;
    padding: 8px 4px;
    border: 1px solid #4a4a55;
    border-radius: 9px;
    background: #24242a;
    color: #00ff88;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    touch-action: manipulation;
}
.log-step-btn:active { transform: scale(.96); background: rgba(0,255,136,.13); }
.log-day-category-header input[type="number"] {
    width: 66px;
    min-height: 44px;
    padding: 7px;
    border-radius: 9px;
    font-size: 16px;
    text-align: center;
}
.advanced-details summary {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 0 9px;
    border: 1px solid #44444e;
    border-radius: 9px;
    background: #24242a;
    font-size: 0.75rem;
}
.advanced-details[open] summary { border-color: #00ff88; }
.advanced-fields-container { margin-top: 12px; padding-top: 8px; }
.advanced-fields-grid { gap: 10px; }
.sub-category-container {
    padding: 10px;
    border-radius: 10px;
    background: rgba(0,0,0,.14);
    border: 1px solid #393941;
}
.sub-category-header { margin-bottom: 7px; color: #00dffc; font-size: 0.8rem; font-weight: 800; }
.advanced-field {
    min-height: 48px;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,.055);
}
.advanced-field:last-of-type { border-bottom: 0; }
.advanced-field label {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}
.advanced-field .logged-today-text { font-size: 0.68rem; }
.advanced-field input {
    width: 72px;
    min-height: 42px;
    padding: 7px;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}
.add-custom-exercise-btn { min-height: 42px; }
.add-exercise-details > summary { min-height: 36px; display: flex; align-items: center; }

@media (max-width: 600px) {
    #logDayModal { align-items: flex-end; }
    #logDayModal .modal-content {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }
    #logDayModal .modal-header { padding-top: max(12px, env(safe-area-inset-top)); }
    #logDayModal .modal-body { padding-left: 10px; padding-right: 10px; }
    #logDayModal .modal-subtitle { font-size: 0.76rem; }
}

@media (min-width: 700px) {
    .log-day-category-header { grid-template-columns: minmax(190px, 1fr) minmax(330px, auto); align-items: center; }
    .header-actions { grid-template-columns: minmax(190px, 1fr) 76px auto; }
    .advanced-fields-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
