:root {
    --primary: #1a252f;
    --secondary: #2c3e50;
    --accent: #c0392b;
    --gold: #d4a017;
    --bg: #ecf0f1;
    --panel: #ffffff;
    --text: #2c3e50;
    --border: #bdc3c7;
    --success: #27ae60;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg); 
    color: var(--text);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.brand { font-weight: 700; font-size: 1.2rem; letter-spacing: 1px; }
.tagline { font-weight: 300; opacity: 0.9; font-size: 0.9rem; }
nav { display: flex; gap: 0.5rem; }
.nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}
.nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.2); color: white; }
.nav-btn.active { background: white; color: var(--primary); font-weight: 600; border-color: white; }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; background: rgba(0,0,0,0.2); }
.progress-header { text-align: right; }
#step-indicator { display: block; font-size: 0.8rem; opacity: 0.8; margin-bottom: 0.25rem; }
#complete-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}
#complete-btn:hover { background: #a93226; }
#complete-btn:disabled { display: none; }
.workspace { 
    display: flex; 
    height: calc(100vh - 70px);
    padding: 1rem;
    gap: 1rem;
}
.content-panel { 
    flex: 2; 
    background: var(--panel);
    border-radius: 8px;
    padding: 2rem;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    border: 1px solid var(--border);
}
.notes-panel { 
    flex: 1; 
    background: var(--panel);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    border: 1px solid var(--border);
    min-width: 300px;
}
.notes-header { 
    margin-bottom: 1rem; 
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.75rem;
}
.notes-header h3 { color: var(--primary); margin-bottom: 0.25rem; font-size: 1.1rem; }
.notes-header small { color: #7f8c8d; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
#notes-field {
    flex: 1;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    background: #fdfdfd;
}
#notes-field:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(44,62,80,0.1);
}
.notes-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}
.btn-secondary, .file-label {
    flex: 1;
    background: #ecf0f1;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    text-align: center;
    transition: all 0.2s;
    display: block;
}
.btn-secondary:hover { background: #d5dbdb; }
.sync-indicator {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #7f8c8d;
    height: 1rem;
    transition: color 0.3s;
}
.sync-indicator.saving { color: var(--gold); font-weight: bold; }
.sync-indicator.saved { color: var(--success); }
.content-header {
    border-bottom: 3px solid var(--primary);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
.content-header h2 { color: var(--primary); font-size: 1.8rem; margin-bottom: 0.5rem; }
.content-header p { color: #7f8c8d; font-size: 1rem; }
h3 { color: var(--secondary); margin: 1.5rem 0 0.75rem; font-size: 1.3rem; border-left: 4px solid var(--gold); padding-left: 0.75rem; }
h4 { color: var(--secondary); margin: 1.2rem 0 0.5rem; font-size: 1.1rem; }
p { margin-bottom: 1rem; line-height: 1.7; }
.exercise-box {
    background: linear-gradient(to right, #fff9e6, #fff);
    border-left: 4px solid var(--gold);
    border: 1px solid #f0e6cc;
    border-radius: 0 8px 8px 0;
    padding: 1.5rem;
    margin: 1.5rem 0;
}
.exercise-box h4 { color: var(--accent); margin-bottom: 0.75rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.5px; }
.quote {
    font-style: italic;
    color: var(--secondary);
    font-size: 1.1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--secondary);
    position: relative;
}
.quote::before {
    content: '"';
    font-size: 4rem;
    position: absolute;
    top: -0.5rem;
    left: 0.5rem;
    opacity: 0.1;
}
.locked {
    text-align: center;
    padding: 4rem 2rem;
    color: #7f8c8d;
}
.locked h2 { color: var(--accent); margin-bottom: 1rem; font-size: 1.5rem; }
.locked-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.3; }
.gps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}
.day-control { display: flex; align-items: center; gap: 1rem; }
.day-control select {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--secondary);
    border-radius: 4px;
    background: white;
    cursor: pointer;
}
.new-cycle-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}
.new-cycle-btn:hover { background: #219a52; }
.daily-quote {
    font-style: italic;
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid var(--gold);
}
.field-group { margin-bottom: 1.5rem; }
.field-group label {
    display: block;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.field-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    min-height: 80px;
    resize: vertical;
}
.habit-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px dashed var(--border); }
.habit-grid {
    display: flex;
    gap: 2rem;
    margin-top: 0.75rem;
}
.habit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.habit-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}
.archives-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}
@media (max-width: 900px) {
    .workspace { flex-direction: column; }
    .notes-panel { min-height: 250px; flex: none; }
    header { flex-direction: column; align-items: flex-start; }
    .progress-header { width: 100%; text-align: left; margin-top: 0.5rem; }
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --panel: #1e1e1e;
        --text: #e0e0e0;
        --border: #444444;
    }
    
    header {
        background: linear-gradient(135deg, #0d1b2a 0%, #1b2631 100%);
    }
    
    .content-panel, .notes-panel {
        background: var(--panel);
        border-color: #333;
    }
    
    #notes-field {
        background: #2a2a2a;
        color: var(--text);
        border-color: #444;
    }
    
    .btn-secondary, .file-label {
        background: #2d2d2d;
        color: var(--text);
        border-color: #444;
    }
    
    .btn-secondary:hover { background: #3d3d3d; }
    
    .exercise-box {
        background: linear-gradient(to right, #2a2520, #1e1e1e);
        border-color: #444;
    }
    
    .quote {
        background: #2a2a2a;
        color: #b0b0b0;
    }
    
    .daily-quote {
        background: #1a2530;
        color: #b0b0b0;
    }
    
    .archive-item {
        background: #2d2d2d;
    }
}
