/* One Rep Strength - Web App */
/* Light Theme: White, Blue, Purple, Green - matching onerepstrength.fit website */

/* ===== VARIABLES ===== */
:root {
    /* Primary Blue (from website) */
    --primary: #0369a1;
    --primary-dark: #075985;
    --primary-light: #0ea5e9;

    /* Purple accent */
    --purple: #7c3aed;
    --purple-dark: #6d28d9;
    --purple-light: #a78bfa;

    /* Green accent (from website) */
    --green: #059669;
    --green-light: #22c55e;
    --accent-light-green: #d1fae5;

    /* Accent - Blue */
    --accent: #0369a1;
    --accent-light: rgba(3, 105, 161, 0.1);

    /* Background colors - Light theme */
    --bg: #fafaf9;
    --bg-alt: #f5f5f4;
    --bg-dark: #1c1917;
    --card: #ffffff;
    --black: #1c1917;
    --gray-dark: #f5f5f4;
    --gray-mid: #e7e5e4;
    --gray-light: #d6d3d1;

    /* Text colors */
    --text: #1c1917;
    --text-light: #57534e;
    --text-secondary: #78716c;
    --white: #ffffff;

    /* Border */
    --border: #e7e5e4;

    /* Phase colors - Blue for eccentric, Green for concentric, Purple for final */
    --phase-eccentric: #3b82f6;
    --phase-concentric: #22c55e;
    --phase-final: #7c3aed;

    /* Status colors */
    --red: #dc2626;
    --orange: #f97316;
    --blue: #0369a1;

    /* Legacy compatibility */
    --gold: #0369a1;
    --gold-dark: #075985;
    --gold-light: rgba(3, 105, 161, 0.2);
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* ===== APP CONTAINER ===== */
.app-container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 80px;
}

/* ===== STATUS BAR ===== */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.status-time {
    font-weight: 600;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ===== MAIN HEADER ===== */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* ===== PROFILE SWITCHER ===== */
.profile-switcher {
    display: flex;
    gap: 8px;
}

.profile-btn {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    border: 2px solid var(--border);
    background: var(--bg-alt);
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

/* ===== WORKOUT TYPE SELECTOR ===== */
.workout-selector {
    display: flex;
    gap: 12px;
    padding: 16px;
    justify-content: center;
}

.workout-type-btn {
    flex: 1;
    max-width: 160px;
    padding: 14px 24px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.workout-type-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* ===== PROGRESS ROW ===== */
.progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-alt);
    margin: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
}

.progress-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.finish-btn {
    background: var(--green);
    color: var(--black);
}

.reset-btn {
    background: var(--gray-mid);
    color: var(--text-secondary);
}

/* ===== EXERCISE LIST ===== */
.exercise-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exercise-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.exercise-card:active {
    transform: scale(0.98);
}

.exercise-card.completed {
    border-color: var(--accent);
    background: var(--accent-light);
}

.exercise-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.exercise-info {
    flex: 1;
    min-width: 0;
}

.exercise-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.exercise-weight {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.completed-check {
    position: absolute;
    right: 60px;
}

.start-btn {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    border: none;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* ===== TIMER SCREEN ===== */
.timer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--black);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--white);
    padding: 8px;
    cursor: pointer;
}

.timer-exercise-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
}

/* ===== PHASE INDICATORS ===== */
.phase-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
}

.phase-dot {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    border: 3px solid var(--gray-light);
    background: var(--gray-dark);
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.phase-dot.active {
    transform: scale(1.1);
}

#phaseDotE.active {
    border-color: var(--phase-eccentric);
    background: var(--phase-eccentric);
    color: var(--white);
}

#phaseDotC.active {
    border-color: var(--phase-concentric);
    background: var(--phase-concentric);
    color: var(--white);
}

#phaseDotF.active {
    border-color: var(--phase-final);
    background: var(--phase-final);
    color: var(--white);
}

.phase-dot.past {
    border-color: var(--gray-light);
    background: var(--gray-mid);
    color: var(--text-secondary);
}

.phase-connector {
    width: 24px;
    height: 3px;
    background: var(--gray-light);
}

/* ===== TIMER DISPLAY ===== */
.timer-display {
    font-size: 140px;
    font-weight: 200;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    text-align: center;
    color: var(--gold);
    line-height: 1;
    margin: 20px 0;
    transition: color 0.3s ease;
}

.timer-display.phase-eccentric {
    color: var(--phase-eccentric);
}

.timer-display.phase-concentric {
    color: var(--phase-concentric);
}

.timer-display.phase-final {
    color: var(--phase-final);
}

.timer-display.phase-complete {
    color: var(--green);
}

.phase-label {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 40px;
}

/* ===== TIMER CONTROLS ===== */
.timer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 24px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    border: none;
    background: var(--gray-dark);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.control-btn.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 40px;
    background: var(--gold);
    color: var(--black);
}

/* ===== COMPLETE SECTION ===== */
.complete-section {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.weight-section {
    text-align: center;
}

.weight-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.weight-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.weight-btn {
    background: transparent;
    border: none;
    color: var(--gold);
    cursor: pointer;
    padding: 8px;
}

.weight-btn.large svg {
    width: 56px;
    height: 56px;
}

.weight-display {
    text-align: center;
}

.weight-value {
    font-size: 64px;
    font-weight: 700;
    color: var(--gold);
}

.weight-unit {
    font-size: 20px;
    color: var(--text-secondary);
    display: block;
}

.fine-adjust {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.adjust-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--gray-light);
    background: var(--gray-dark);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== FAILURE TOGGLE ===== */
.failure-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--gray-dark);
    border-radius: 12px;
    border: 2px solid var(--gray-mid);
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.failure-toggle svg {
    color: var(--text-secondary);
}

/* ===== PRIMARY BUTTON ===== */
.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 24px;
    background: var(--gold);
    color: var(--black);
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn:active {
    transform: scale(0.98);
}

/* ===== SECONDARY ACTIONS ===== */
.secondary-actions {
    display: flex;
    gap: 12px;
}

.secondary-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    background: var(--gray-dark);
    border: 2px solid var(--gray-mid);
    border-radius: 12px;
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== REST SCREEN ===== */
.rest-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.rest-timer {
    font-size: 160px;
    font-weight: 200;
    color: var(--gold);
    line-height: 1;
}

.rest-label {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.next-exercise {
    text-align: center;
    margin-bottom: 40px;
}

.next-label {
    font-size: 16px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

.next-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
}

.skip-btn {
    padding: 14px 40px;
    background: var(--gray-dark);
    border: 2px solid var(--gray-mid);
    border-radius: 12px;
    color: var(--white);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== SCREEN HEADER ===== */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--black);
    border-bottom: 1px solid var(--gray-mid);
}

.screen-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.done-btn {
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== HISTORY SCREEN ===== */
.stats-row {
    display: flex;
    gap: 12px;
    padding: 16px;
}

.stat-box {
    flex: 1;
    background: var(--gray-dark);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.stat-title {
    font-size: 14px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--gold);
    display: block;
}

.stat-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-list {
    padding: 0 16px;
    overflow-y: auto;
    flex: 1;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-secondary);
}

.history-section {
    margin-bottom: 24px;
}

.history-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.history-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--gray-dark);
    border-radius: 12px;
    margin-bottom: 8px;
}

.history-left {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.history-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

.history-type {
    font-size: 14px;
    color: var(--text-secondary);
}

.history-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-weight {
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
}

.history-failure {
    font-size: 12px;
    font-weight: 600;
    color: var(--green);
    background: rgba(34, 197, 94, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
}

/* ===== SETTINGS SCREEN ===== */
.settings-content {
    padding: 16px;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.settings-group {
    background: var(--gray-dark);
    border-radius: 16px;
    padding: 16px;
}

.setting-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: block;
}

.setting-label:not(:first-child) {
    margin-top: 16px;
}

/* ===== VOICE BUTTONS ===== */
.voice-buttons {
    display: flex;
    gap: 12px;
}

.voice-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 2px solid var(--gray-light);
    background: var(--gray-mid);
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-btn.active {
    border-color: var(--gold);
    background: var(--gold);
    color: var(--black);
}

.commander-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--gray-mid);
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.commander-btn.active {
    border-color: var(--gold);
    background: var(--gold);
    color: var(--black);
}

.pro-badge {
    font-size: 10px;
    font-weight: 700;
    background: var(--gold);
    color: var(--black);
    padding: 2px 6px;
    border-radius: 4px;
}

.commander-btn.active .pro-badge {
    background: var(--black);
    color: var(--gold);
}

/* ===== PHASE SETTINGS ===== */
.phase-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-mid);
}

.phase-setting:last-child {
    border-bottom: none;
}

.phase-name {
    font-size: 17px;
    font-weight: 500;
    color: var(--white);
}

.stepper {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gold);
    font-size: 17px;
    font-weight: 600;
}

.stepper button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--gray-mid);
    color: var(--gold);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

/* ===== ABOUT ===== */
.about-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--gray-dark);
    border-radius: 12px;
    font-size: 17px;
}

.about-value {
    color: var(--text-secondary);
}

/* ===== TAB BAR ===== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    z-index: 100;
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
}

.tab.active {
    color: var(--primary);
}

.tab svg {
    width: 24px;
    height: 24px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
    .app-container {
        max-width: 420px;
        margin: 0 auto;
        border-left: 1px solid var(--gray-mid);
        border-right: 1px solid var(--gray-mid);
    }

    .tab-bar {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ===== SAFE AREA ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    .status-bar {
        padding-top: calc(8px + env(safe-area-inset-top));
    }

    .app-container {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.timer-display.active {
    animation: pulse 1s ease-in-out infinite;
}

/* ===== PRINT STYLES ===== */
@media print {
    .tab-bar,
    .status-bar {
        display: none;
    }
}

/* ===== AUTH SCREEN ===== */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    padding: 20px;
    background: var(--bg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo svg {
    fill: var(--primary);
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-top: 16px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 8px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--bg-alt);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border);
}

.auth-tab {
    padding: 10px 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

.auth-form {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form input {
    width: 100%;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    border-color: var(--primary);
}

.auth-form input::placeholder {
    color: var(--text-secondary);
}

.auth-submit {
    width: 100%;
    padding: 16px;
    background: var(--green);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-submit:hover {
    background: #047857;
}

.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-error {
    color: var(--red);
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.auth-skip {
    margin-top: 24px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-skip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    background: transparent;
    border: 1px solid var(--red);
    border-radius: 10px;
    color: var(--red);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--red);
    color: var(--white);
}

.logout-btn svg {
    stroke: currentColor;
}

/* ===== PHONE FRAME (Desktop Only) ===== */
@media (min-width: 500px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 20px;
        gap: 20px;
    }

    .phone-frame {
        position: relative;
        width: 375px;
        height: 812px;
        background: #1c1917;
        border-radius: 50px;
        padding: 12px;
        box-shadow:
            0 25px 50px -12px rgba(0, 0, 0, 0.5),
            inset 0 0 0 3px #2d2d2d;
    }

    .phone-notch {
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 150px;
        height: 30px;
        background: #1c1917;
        border-radius: 0 0 20px 20px;
        z-index: 1000;
    }

    .phone-screen {
        width: 100%;
        height: 100%;
        background: var(--bg);
        border-radius: 40px;
        overflow: hidden;
        position: relative;
    }

    .app-container {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Mobile: No frame */
@media (max-width: 499px) {
    .phone-frame,
    .phone-notch {
        display: contents;
    }

    .phone-screen {
        display: contents;
    }
}

/* ===== INSTALL BANNER ===== */
.install-banner {
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    max-width: 375px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.install-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.install-icon {
    flex-shrink: 0;
}

.install-text h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1c1917;
    margin-bottom: 4px;
}

.install-text p {
    font-size: 13px;
    color: #78716c;
    margin: 0;
}

.install-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    background: var(--purple);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: none;
}

.install-btn:hover {
    background: var(--purple-dark);
}

.install-instructions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e7e5e4;
}

.install-instructions p {
    font-size: 13px;
    color: #78716c;
    margin: 8px 0;
}

.install-instructions strong {
    color: #1c1917;
}

.share-icon {
    display: inline-block;
    background: #0369a1;
    color: white;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 4px;
    font-size: 12px;
}

/* Hide install banner on mobile (when in standalone mode) */
@media (display-mode: standalone) {
    .install-banner {
        display: none;
    }
}

/* Hide install banner on mobile (shown in browser) */
@media (max-width: 499px) {
    .install-banner {
        display: none;
    }
}

/* ===== STATS SCREEN ===== */
.stats-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
}

.stats-card {
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.stats-card.purple { border-left: 4px solid var(--purple); }
.stats-card.blue { border-left: 4px solid var(--primary); }
.stats-card.green { border-left: 4px solid var(--green); }
.stats-card.orange { border-left: 4px solid var(--orange); }

.stats-card-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stats-card.purple .stats-card-value { color: var(--purple); }
.stats-card.blue .stats-card-value { color: var(--primary); }
.stats-card.green .stats-card-value { color: var(--green); }
.stats-card.orange .stats-card-value { color: var(--orange); }

.stats-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.stats-section {
    padding: 16px;
}

.stats-section .section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Weekly Chart */
.weekly-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 120px;
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.chart-bar .bar-fill {
    width: 24px;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    flex-grow: 1;
    min-height: 4px;
    max-height: 80px;
    opacity: 0.3;
    transition: all 0.3s;
}

.chart-bar.active .bar-fill {
    opacity: 1;
    background: linear-gradient(180deg, var(--purple) 0%, var(--primary) 100%);
}

.chart-bar span {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 500;
}

/* Records List */
.records-list {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.record-item:last-child {
    border-bottom: none;
}

.record-name {
    font-weight: 600;
    color: var(--text);
}

.record-value {
    font-weight: 700;
    color: var(--purple);
}

/* ===== LOG SCREEN ===== */
.log-filters {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-alt);
}

.filter-btn {
    padding: 8px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.log-list {
    padding: 16px;
}

.log-entry {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.log-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.log-entry-date {
    font-weight: 600;
    color: var(--text);
}

.log-entry-type {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--purple);
    color: white;
    border-radius: 12px;
    font-weight: 500;
}

.log-entry-exercises {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.log-exercise-tag {
    font-size: 13px;
    padding: 4px 10px;
    background: var(--bg-alt);
    color: var(--text-secondary);
    border-radius: 8px;
}

.empty-state.small {
    padding: 24px;
    text-align: center;
}

.empty-state.small p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}
