/* Peptide Lab - Design System */

/* CSS Variables */
:root {
    --navy: #0a1628;
    --navy-light: #111827;
    --navy-lighter: #1a2332;
    --teal: #00d4aa;
    --teal-dark: #00b894;
    --green: #27ae60;
    --green-light: #2ecc71;
    --red: #e74c3c;
    --red-light: #ff6b6b;
    --yellow: #f1c40f;
    --orange: #e67e22;
    --white: #ffffff;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-hover: rgba(255, 255, 255, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --serif: 'Playfair Display', Georgia, serif;
    --transition: all 0.2s ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    /* Render native controls (date/time pickers, calendar icon, dropdowns) for a dark UI */
    color-scheme: dark;
}

body {
    font-family: var(--sans);
    background: var(--navy);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

a {
    color: var(--teal);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--white);
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--surface-border);
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--teal);
    text-decoration: none;
}

.logo:hover {
    color: var(--teal);
}

.logo-icon {
    display: flex;
    align-items: center;
}

.logo-icon svg {
    color: var(--teal);
}

.logo-text {
    color: var(--teal);
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: var(--gray-400);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-tab:hover {
    background: var(--surface-hover);
    color: var(--white);
}

.nav-tab.active {
    background: var(--teal);
    color: var(--navy);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: 50%;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
}

.user-avatar:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    z-index: 150;
}

.user-info {
    padding: 1rem;
    border-bottom: 1px solid var(--surface-border);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--gray-300);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--white);
}

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

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.lang-code {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-400);
}

.user-email {
    font-size: 0.85rem;
    color: var(--gray-400);
}

.btn-logout {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: transparent;
    color: var(--gray-400);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Main Content */
.app-main {
    flex: 1;
    padding: 1.5rem;
    padding-bottom: 100px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--surface-border);
    display: none;
    justify-content: space-around;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 100;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--gray-400);
    font-size: 0.7rem;
    padding: 0.5rem;
    transition: var(--transition);
}

.bottom-nav a span {
    font-size: 1.3rem;
}

.bottom-nav a.active {
    color: var(--teal);
}

.bottom-nav .inject-btn {
    position: relative;
    top: -20px;
    background: var(--green);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.bottom-nav .inject-btn span {
    font-size: 1.5rem;
}

.bottom-nav .inject-btn:active {
    transform: scale(0.95);
}

/* Cards */
.card {
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--teal);
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

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

.btn-primary {
    background: var(--green);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--green-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--teal);
    color: var(--teal);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--teal);
    color: var(--navy);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--red-light);
}

.btn-icon {
    padding: 0.5rem;
    min-width: 40px;
    min-height: 40px;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-300);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--navy);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 1rem;
    font-family: var(--sans);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-input::placeholder {
    color: var(--gray-500);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    position: relative;
    display: none;
    flex-direction: column;
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-sm {
    max-width: 400px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--surface-border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--white);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--surface-border);
    flex-shrink: 0;
}

/* Paywall Modal */
.modal-paywall {
    max-width: 440px;
}

.paywall-hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

.paywall-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0, 212, 170, 0.12);
    color: var(--teal);
    margin-bottom: 1rem;
}

.paywall-tagline {
    color: var(--gray-300);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.paywall-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.paywall-amount {
    font-family: var(--serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}

.paywall-period {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.paywall-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--surface-border);
}

.paywall-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--gray-200);
}

.paywall-features li svg {
    flex-shrink: 0;
    color: var(--teal);
}

.paywall-footer {
    flex-direction: column;
    gap: 0.6rem;
}

.paywall-secure {
    width: 100%;
    text-align: center;
    font-size: 0.78rem;
    color: var(--gray-500);
}

/* Login View */
.view-login {
    display: none;
    min-height: calc(100vh - 64px);
}

.view-login.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    margin: 1rem;
}

.login-header {
    margin-bottom: 2rem;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-logo svg {
    color: var(--teal);
}

.login-header h1 {
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--gray-400);
    font-size: 0.95rem;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-300);
    margin-bottom: 0.5rem;
}

.login-form input[type="email"] {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--navy);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 1rem;
    transition: var(--transition);
}

.login-form input[type="email"]:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.login-form input[type="email"]::placeholder {
    color: var(--gray-500);
}

.login-success {
    padding: 2rem 0;
}

.login-success .success-icon {
    margin-bottom: 1rem;
}

.login-success h2 {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.login-success p {
    color: var(--gray-400);
    font-size: 0.9rem;
    line-height: 1.6;
}

.login-success .spam-notice {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
    border-radius: var(--radius-md);
    color: var(--yellow);
    font-size: 0.85rem;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--surface-border);
}

.login-disclaimer {
    color: var(--gray-500);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Mobile Login */
@media (max-width: 480px) {
    .login-container {
        margin: 0.5rem;
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-logo svg {
        width: 48px;
        height: 48px;
    }
}

/* Loading View */
.view-loading {
    display: none;
    min-height: calc(100vh - 64px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.view-loading.active {
    display: flex;
}

.view-loading p {
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* Hide nav when on login/loading */
body.auth-loading .nav-tabs,
body.auth-loading .user-menu,
body.not-authenticated .nav-tabs,
body.not-authenticated .user-menu {
    display: none;
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-subtitle {
    color: var(--gray-400);
    font-size: 0.95rem;
    width: 100%;
    margin-top: -0.5rem;
}

/* Dashboard Sections */
.dashboard-section {
    margin-bottom: 2rem;
}

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

.link-more {
    font-size: 0.85rem;
    color: var(--teal);
}

.link-more:hover {
    color: var(--white);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    background: var(--teal);
    color: var(--navy);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex: 1;
    padding: 1rem 1.5rem;
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--gray-300);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.quick-action-btn svg {
    color: var(--teal);
}

/* Tracking Tabs */
.tracking-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 0.5rem;
}

.tracking-tab {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.tracking-tab:hover {
    color: var(--white);
    background: var(--surface-hover);
}

.tracking-tab.active {
    background: var(--teal);
    color: var(--navy);
}

.tracking-content {
    animation: fadeIn 0.3s ease;
}

/* Progress Bar */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--navy-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--teal);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--gray-400);
    font-weight: 500;
}

/* Chart Container */
.chart-container {
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.chart-container canvas {
    width: 100% !important;
    max-height: 280px;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    font-family: var(--serif);
}

.stat-label {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.stat-trend.up {
    color: var(--green);
}

.stat-trend.down {
    color: var(--red);
}

/* Today's Doses */
.today-doses {
    background: linear-gradient(135deg, var(--navy-light) 0%, rgba(0, 212, 170, 0.05) 100%);
    border: 1px solid var(--teal);
}

.dose-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--navy);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.dose-item:last-child {
    margin-bottom: 0;
}

.dose-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dose-time {
    font-size: 0.85rem;
    color: var(--gray-400);
}

.dose-name {
    font-weight: 600;
}

.dose-amount {
    color: var(--teal);
    font-size: 0.9rem;
}

.dose-done {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.dose-done.completed {
    background: var(--green);
    border-color: var(--green);
}

.dose-done:hover {
    border-color: var(--green);
}

/* Peptides Grid */
.peptides-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.peptides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.peptide-card {
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: var(--transition);
}

.peptide-card:hover {
    border-color: var(--teal);
}

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

.peptide-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.peptide-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.peptide-badge.ok {
    background: rgba(39, 174, 96, 0.2);
    color: var(--green);
}

.peptide-badge.warning {
    background: rgba(241, 196, 15, 0.2);
    color: var(--yellow);
}

.peptide-badge.expired {
    background: rgba(231, 76, 60, 0.2);
    color: var(--red);
}

.peptide-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.peptide-stat {
    text-align: center;
    padding: 0.5rem;
    background: var(--navy);
    border-radius: var(--radius-sm);
}

.peptide-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--teal);
}

.peptide-stat-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.peptide-actions {
    display: flex;
    gap: 0.5rem;
}

.peptide-actions .btn {
    flex: 1;
}

/* Body Map */
.body-map-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.body-map {
    position: relative;
    width: 250px;
    flex-shrink: 0;
}

.body-map svg {
    width: 100%;
    height: auto;
}

.body-map-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.body-map-toggle button {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--surface-border);
    background: var(--navy);
    color: var(--gray-400);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.body-map-toggle button.active {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--navy);
}

.injection-site {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.injection-site:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.injection-site.available {
    background: rgba(39, 174, 96, 0.3);
    border-color: var(--green);
}

.injection-site.recent {
    background: rgba(241, 196, 15, 0.3);
    border-color: var(--yellow);
}

.injection-site.used {
    background: rgba(231, 76, 60, 0.3);
    border-color: var(--red);
}

.injection-site.selected {
    background: var(--teal);
    border-color: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.3);
}

.site-legend {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.8rem;
}

.site-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.site-legend-dot.green { background: var(--green); }
.site-legend-dot.yellow { background: var(--yellow); }
.site-legend-dot.red { background: var(--red); }

/* Calculator */
.calculator-container {
    max-width: 600px;
    margin: 0 auto;
}

.calculator-result {
    background: linear-gradient(135deg, var(--navy-light) 0%, rgba(0, 212, 170, 0.1) 100%);
    border: 2px solid var(--teal);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin-top: 1.5rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.result-item {
    background: var(--navy);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--teal);
    font-family: var(--serif);
}

.result-label {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.result-highlight {
    grid-column: span 2;
    background: var(--teal);
    color: var(--navy);
}

.result-highlight .result-value {
    color: var(--navy);
    font-size: 2.5rem;
}

.result-highlight .result-label {
    color: var(--navy);
    opacity: 0.8;
}

/* Weight Chart */
.weight-chart-container {
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.weight-chart {
    height: 300px;
}

.weight-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.weight-stat {
    text-align: center;
    padding: 1rem;
    background: var(--navy);
    border-radius: var(--radius-md);
}

.weight-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.weight-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* Side Effects */
.effects-grid {
    display: grid;
    gap: 0.75rem;
}

.effect-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
}

.effect-severity {
    font-size: 1.5rem;
}

.effect-info {
    flex: 1;
}

.effect-symptom {
    font-weight: 600;
}

.effect-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.effect-delete {
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
}

.effect-delete:hover {
    color: var(--red);
}

.severity-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.severity-btn {
    font-size: 1.5rem;
    padding: 0.5rem;
    background: var(--navy);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.5;
}

.severity-btn:hover {
    opacity: 1;
}

.severity-btn.selected {
    opacity: 1;
    border-color: var(--teal);
    background: var(--navy-light);
}

/* Half-life Chart */
.halflife-container {
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.halflife-chart {
    height: 250px;
}

.halflife-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.halflife-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.halflife-legend-color {
    width: 16px;
    height: 4px;
    border-radius: 2px;
}

/* Chapters */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.chapter-card {
    background: var(--navy-light);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.chapter-card:hover {
    border-color: var(--teal);
    transform: translateY(-2px);
}

.chapter-card.locked {
    opacity: 0.7;
}

.chapter-card.completed {
    border-color: var(--green);
}

.chapter-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.chapter-badge.free {
    background: var(--teal);
    color: var(--navy);
}

.chapter-badge.premium {
    background: var(--gray-600);
    color: var(--gray-300);
}

.chapter-badge.completed {
    background: var(--green);
    color: var(--white);
}

.chapter-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--teal);
    color: var(--navy);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.chapter-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.chapter-desc {
    font-size: 0.85rem;
    color: var(--gray-400);
    line-height: 1.5;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--navy-lighter);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    color: var(--white);
    font-size: 0.9rem;
    z-index: 300;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--green);
}

.toast.error {
    border-color: var(--red);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--surface-border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablet breakpoint */
@media (max-width: 1024px) {
    .app-main {
        max-width: 100%;
        padding: 1.25rem;
    }

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

/* Mobile breakpoint - 768px */
@media (max-width: 768px) {
    /* Header */
    .app-header {
        padding: 0 1rem;
        height: 56px;
    }

    .app-header .nav-tabs {
        display: none;
    }

    .logo {
        font-size: 1.25rem;
    }

    .logo-icon svg {
        width: 24px;
        height: 24px;
    }

    .logo-text {
        display: none;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .lang-code {
        font-size: 0.75rem;
    }

    /* Bottom Navigation */
    .bottom-nav {
        display: flex;
        padding: 0.75rem 0;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }

    .bottom-nav a {
        font-size: 0.65rem;
        padding: 0.4rem;
    }

    .bottom-nav a svg {
        width: 22px;
        height: 22px;
    }

    .bottom-nav .inject-btn {
        width: 52px;
        height: 52px;
        top: -18px;
    }

    .bottom-nav .inject-btn svg {
        width: 24px;
        height: 24px;
    }

    /* Main content */
    .app-main {
        padding: 1rem;
        padding-bottom: 90px;
    }

    /* View Headers */
    .view-header {
        margin-bottom: 1.25rem;
    }

    .view-header h1 {
        font-size: 1.5rem;
    }

    .view-subtitle {
        font-size: 0.85rem;
    }

    .view-header .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .view-header .btn svg {
        width: 18px;
        height: 18px;
    }

    /* Dashboard Sections */
    .dashboard-section {
        margin-bottom: 1.5rem;
    }

    .section-header {
        margin-bottom: 0.75rem;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    /* Stats Grid - 2 columns on mobile */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        margin-bottom: 0.5rem;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Quick Actions */
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .quick-action-btn {
        flex-direction: column;
        padding: 1rem 0.5rem;
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .quick-action-btn svg {
        width: 22px;
        height: 22px;
    }

    /* Peptides */
    .peptides-list {
        display: grid;
        gap: 1rem;
    }

    .peptides-grid {
        grid-template-columns: 1fr;
    }

    .peptide-card {
        padding: 1rem;
    }

    .peptide-name {
        font-size: 1rem;
    }

    .peptide-stats {
        gap: 0.5rem;
    }

    .peptide-stat {
        padding: 0.4rem;
    }

    .peptide-stat-value {
        font-size: 0.95rem;
    }

    .peptide-stat-label {
        font-size: 0.65rem;
    }

    .peptide-actions {
        flex-direction: column;
    }

    .peptide-actions .btn {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    /* Tracking Tabs */
    .tracking-tabs {
        display: flex;
        gap: 0;
        background: var(--navy-light);
        border-radius: var(--radius-md);
        padding: 4px;
        margin-bottom: 1rem;
    }

    .tracking-tab {
        flex: 1;
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
        text-align: center;
        border-radius: var(--radius-sm);
        background: transparent;
        border: none;
        color: var(--gray-400);
        cursor: pointer;
        transition: var(--transition);
    }

    .tracking-tab.active {
        background: var(--teal);
        color: var(--navy);
        font-weight: 600;
    }

    /* Weight Section */
    .weight-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }

    .weight-current {
        display: flex;
        align-items: baseline;
        gap: 0.25rem;
    }

    .weight-value {
        font-size: 2rem;
        font-weight: 700;
        color: var(--teal);
    }

    .weight-unit {
        font-size: 1rem;
        color: var(--gray-400);
    }

    .weight-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .weight-stat {
        padding: 0.75rem;
    }

    .weight-stat .stat-value {
        font-size: 1.25rem;
    }

    .weight-stat .stat-label {
        font-size: 0.7rem;
    }

    /* Charts */
    .chart-container {
        margin-bottom: 1rem;
    }

    .chart-container canvas {
        max-height: 200px;
    }

    /* Body Map */
    .body-map-container {
        flex-direction: column;
        align-items: center;
    }

    .body-map-tabs {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
        width: 100%;
    }

    .body-map-tab {
        flex: 1;
        padding: 0.75rem;
        text-align: center;
        background: var(--navy-light);
        border: 1px solid var(--surface-border);
        border-radius: var(--radius-md);
        color: var(--gray-400);
        font-size: 0.9rem;
        cursor: pointer;
        transition: var(--transition);
    }

    .body-map-tab.active {
        background: var(--teal);
        border-color: var(--teal);
        color: var(--navy);
        font-weight: 600;
    }

    .body-map {
        width: 220px;
        margin: 0 auto;
    }

    .site-legend {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        font-size: 0.75rem;
    }

    .legend-item {
        display: flex;
        align-items: center;
        gap: 0.35rem;
    }

    .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
    }

    .dot.green { background: var(--green); }
    .dot.yellow { background: var(--yellow); }
    .dot.red { background: var(--red); }

    /* Selected Site */
    .selected-site {
        background: var(--navy-light);
        border: 1px solid var(--teal);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin: 1rem 0;
        text-align: center;
    }

    .site-name {
        display: block;
        font-weight: 600;
        color: var(--teal);
        margin-bottom: 0.25rem;
    }

    .site-last-used {
        font-size: 0.8rem;
        color: var(--gray-400);
    }

    /* Injection Form */
    .inject-form {
        margin-bottom: 1rem;
    }

    /* Learn / Chapters */
    .progress-bar-container {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .progress-bar {
        flex: 1;
        height: 8px;
        background: var(--navy-light);
        border-radius: 4px;
        overflow: hidden;
    }

    .progress-fill {
        height: 100%;
        background: var(--teal);
        border-radius: 4px;
        transition: width 0.3s ease;
    }

    .progress-text {
        font-size: 0.85rem;
        color: var(--gray-400);
        white-space: nowrap;
    }

    .chapters-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .chapter-card {
        padding: 1rem;
    }

    .chapter-number {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .chapter-title {
        font-size: 0.95rem;
    }

    .chapter-desc {
        font-size: 0.8rem;
    }

    /* Calculator Card */
    .calculator-card {
        background: var(--navy-light);
        border: 1px solid var(--surface-border);
        border-radius: var(--radius-lg);
        padding: 1.25rem;
        margin-top: 1.5rem;
    }

    .calculator-header h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .calc-row {
        margin-bottom: 1rem;
    }

    .calc-row label {
        display: block;
        font-size: 0.85rem;
        color: var(--gray-300);
        margin-bottom: 0.5rem;
    }

    .input-group {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .input-group .form-input {
        flex: 1;
    }

    .input-suffix {
        color: var(--gray-400);
        font-size: 0.9rem;
        min-width: 35px;
    }

    .calc-result {
        background: linear-gradient(135deg, var(--navy) 0%, rgba(0, 212, 170, 0.1) 100%);
        border: 2px solid var(--teal);
        border-radius: var(--radius-md);
        padding: 1.25rem;
        text-align: center;
        margin-top: 1rem;
    }

    .result-label {
        font-size: 0.9rem;
        color: var(--gray-400);
    }

    .result-value {
        font-size: 1.75rem;
        font-weight: 700;
        color: var(--teal);
        font-family: var(--serif);
        display: block;
        margin: 0.25rem 0;
    }

    .result-units {
        font-size: 0.8rem;
        color: var(--gray-400);
    }

    /* Chapter Detail View */
    .chapter-content {
        padding-bottom: 1rem;
    }

    .chapter-nav {
        display: flex;
        gap: 0.75rem;
        padding-top: 1rem;
        border-top: 1px solid var(--surface-border);
    }

    .chapter-nav .btn {
        flex: 1;
    }

    /* Activity/Log Lists */
    .activity-list,
    .log-list,
    .effects-list,
    .schedule-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Forms on mobile */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        display: block;
    }

    /* Modals - Full screen on mobile */
    .modal-overlay {
        padding: 0;
    }

    .modal {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }

    .modal-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        background: var(--navy-light);
        z-index: 10;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 1rem;
        overflow-y: auto;
        flex: 1;
    }

    .modal-footer {
        padding: 1rem;
        position: sticky;
        bottom: 0;
        background: var(--navy-light);
    }

    .modal-footer .btn {
        flex: 1;
    }

    /* Modal small variant stays centered */
    .modal.modal-sm {
        max-width: 90%;
        height: auto;
        max-height: 90vh;
        border-radius: var(--radius-lg);
        margin: auto;
    }

    /* Severity selector */
    .severity-selector {
        display: flex;
        gap: 0.5rem;
        justify-content: space-between;
    }

    .severity-btn {
        flex: 1;
        padding: 0.75rem 0.5rem;
        font-size: 1.25rem;
    }

    .severity-labels {
        display: flex;
        justify-content: space-between;
        margin-top: 0.5rem;
        font-size: 0.75rem;
        color: var(--gray-500);
    }

    /* Settings */
    .settings-section {
        background: var(--navy-light);
        border: 1px solid var(--surface-border);
        border-radius: var(--radius-lg);
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .settings-section h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
        color: var(--gray-300);
    }

    .setting-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--surface-border);
    }

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

    .setting-row label {
        font-size: 0.9rem;
    }

    /* Toggle Switch */
    .toggle {
        position: relative;
        display: inline-block;
        width: 50px;
        height: 28px;
    }

    .toggle input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--gray-600);
        border-radius: 28px;
        transition: 0.3s;
    }

    .toggle-slider:before {
        position: absolute;
        content: "";
        height: 22px;
        width: 22px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        border-radius: 50%;
        transition: 0.3s;
    }

    .toggle input:checked + .toggle-slider {
        background-color: var(--teal);
    }

    .toggle input:checked + .toggle-slider:before {
        transform: translateX(22px);
    }

    /* Danger zone */
    .danger-zone {
        border-color: rgba(231, 76, 60, 0.3);
    }

    .danger-zone h3 {
        color: var(--red);
    }

    /* User Dropdown */
    .user-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--navy-light);
        border: 1px solid var(--surface-border);
        border-radius: var(--radius-md);
        min-width: 200px;
        box-shadow: var(--shadow-lg);
        z-index: 150;
        margin-top: 0.5rem;
    }

    .user-info {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .dropdown-item {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        text-align: left;
        background: none;
        border: none;
        color: var(--gray-300);
        font-size: 0.9rem;
        cursor: pointer;
        transition: var(--transition);
    }

    .dropdown-item:hover {
        background: var(--surface-hover);
        color: var(--white);
    }

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

    /* Back button */
    .back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--gray-400);
        cursor: pointer;
        padding: 0.5rem;
        margin-right: 0.5rem;
    }

    .back-btn:hover {
        color: var(--white);
    }

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

    /* Toast on mobile */
    .toast-container {
        position: fixed;
        bottom: 100px;
        left: 1rem;
        right: 1rem;
        z-index: 400;
    }

    .toast {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .toast.show {
        transform: none;
    }

    /* Empty states */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state svg {
        width: 48px;
        height: 48px;
    }

    .empty-state h3 {
        font-size: 1rem;
    }

    .empty-state p {
        font-size: 0.85rem;
    }

    /* Result grids */
    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-highlight {
        grid-column: span 1;
    }

    /* Dashboard grid */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Small phone breakpoint - 375px */
@media (max-width: 375px) {
    .app-main {
        padding: 0.75rem;
        padding-bottom: 85px;
    }

    .view-header h1 {
        font-size: 1.3rem;
    }

    .stats-grid {
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .quick-actions {
        gap: 0.5rem;
    }

    .quick-action-btn {
        padding: 0.75rem 0.25rem;
        font-size: 0.7rem;
    }

    .bottom-nav a {
        font-size: 0.6rem;
    }

    .bottom-nav a svg {
        width: 20px;
        height: 20px;
    }

    .bottom-nav .inject-btn {
        width: 48px;
        height: 48px;
        top: -16px;
    }

    .body-map {
        width: 180px;
    }

    .chapters-grid {
        gap: 0.5rem;
    }

    .chapter-card {
        padding: 0.875rem;
    }

    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }
}

/* Safe area insets for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }

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

    @media (max-width: 768px) {
        .modal {
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--navy);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Utils */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-teal { color: var(--teal); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--gray-400); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
