body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0a0a1a;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
}
header {
    background: #11112b;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1f1f4d;
}
header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #9d8df1;
}
nav button {
    background: transparent;
    color: #fff;
    border: 1px solid #4e4eef;
    padding: 0.5rem 1rem;
    cursor: pointer;
    margin-left: 0.5rem;
    border-radius: 4px;
    transition: 0.2s;
}
nav button:hover {
    background: #4e4eef;
}
#content {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}
.title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #fff;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.card {
    background: #16163a;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #25255a;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    background: #16163a;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #25255a;
}
.auth-form p {
    text-align: center;
    font-size: 0.9rem;
}
.auth-form a {
    color: #9d8df1;
    text-decoration: none;
}
input, select, textarea {
    padding: 0.7rem;
    background: #0a0a2a;
    border: 1px solid #25255a;
    color: white;
    border-radius: 4px;
    font-size: 1rem;
}
.btn-primary {
    background: #4e4eef;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    background: #25255a;
    color: white;
    border: 1px solid #4e4eef;
    border-radius: 4px;
}
.btn-danger {
    border-color: #ef4444;
    color: #ef4444;
}
.list-item {
    background: #16163a;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #25255a;
}
.profile-info {
    display: flex;
    flex-direction: column;
}
.modal {
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: #16163a;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #4e4eef;
    max-width: 500px;
    width: 90%;
}
#profile-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.setting-item.full-width {
    grid-column: span 2;
}
.setting-item label {
    font-weight: bold;
    color: #9d8df1;
}
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
th, td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid #25255a;
}
th {
    color: #9d8df1;
}
.reading-section {
    text-align: center;
    margin-top: 2rem;
}
#reading-content {
    margin: 1.5rem 0;
    line-height: 1.6;
    white-space: normal;
    text-align: left;
}
.reading-content.rendered, .reading-preview {
    font-size: 1rem;
    line-height: 1.7;
}
.reading-content.rendered h2, .reading-preview h2 {
    color: #9d8df1;
    font-size: 1.25rem;
    margin: 1.2rem 0 0.4rem;
    border-bottom: 1px solid #2a2f3d;
    padding-bottom: 0.25rem;
}
.reading-content.rendered h3, .reading-preview h3 {
    color: #b0a5f5;
    font-size: 1.1rem;
    margin: 1rem 0 0.3rem;
}
.reading-content.rendered h4, .reading-preview h4 {
    color: #c9c0f8;
    font-size: 1rem;
    margin: 0.8rem 0 0.2rem;
}
.reading-content.rendered p, .reading-preview p {
    margin: 0.4rem 0;
}
.reading-content.rendered ul, .reading-preview ul {
    margin: 0.4rem 0;
    padding-left: 1.4rem;
}
.reading-content.rendered li, .reading-preview li {
    margin: 0.25rem 0;
}
.reading-content.rendered code, .reading-preview code {
    background: #1f1f4d;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.9em;
}
.reading-content.rendered hr, .reading-preview hr {
    border: none;
    border-top: 1px solid #2a2f3d;
    margin: 1rem 0;
}
.reading-content.rendered strong, .reading-preview strong {
    color: #fff;
}

/* Mobile responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.5rem;
        align-items: flex-start;
    }
    nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    nav button {
        margin-left: 0;
        margin-right: 0.4rem;
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }
    #content {
        padding: 1rem;
    }
    .title {
        font-size: 1.4rem;
    }
    .card {
        padding: 1rem;
    }
    .settings-grid, .chart-grid {
        grid-template-columns: 1fr;
    }
    .setting-item.full-width {
        grid-column: span 1;
    }
    .calc-controls {
        flex-direction: column;
        align-items: stretch;
    }
    table {
        font-size: 0.85rem;
    }
    .modal-content {
        width: 94%;
        max-width: none;
    }
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .modifiable-block {
        display: flex;
        flex-direction: column;
    }
}
