/* --- Base & Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.7;
    color: #333;
    background-color: #f8f9fa;
    font-size: 16px; /* Base font size */
}

/* --- Container & Layout --- */
.container {
    max-width: 900px; /* Adjust for optimal reading width */
    margin: 2rem auto; /* Center container and add top/bottom margin */
    padding: 2rem 2.5rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.index-container {
    text-align: center;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    font-weight: 600;
    line-height: 1.3;
    color: #212529;
}

h1 {
    font-size: 2.25rem; /* ~36px */
    font-weight: 700;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5em;
    margin-top: 0; /* No top margin for main page title */
}

h2 {
    font-size: 1.75rem; /* ~28px */
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.4em;
}

h3 {
    font-size: 1.375rem; /* ~22px */
    font-weight: 600;
}

h4 {
    font-size: 1.125rem; /* ~18px */
    font-weight: 600;
    color: #495057;
}

p {
    margin-bottom: 1.2em;
}

strong {
    font-weight: 600;
    color: #0056b3; /* Subtle accent for emphasis */
}

/* --- Lists --- */
ul, ol {
    margin-bottom: 1.2em;
    padding-left: 2em; /* Indentation */
}

li {
    margin-bottom: 0.6em;
}

ul ul, ol ol, ul ol, ol ul {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-left: 1.5em; /* Deeper indentation for nested lists */
}

/* Specific styling for recommendation lists in Perplexity */
ol.recommendation-list > li {
    margin-bottom: 1.5em;
    padding-left: 0.5em;
}
ol.recommendation-list > li > p {
    margin-top: 0.5em;
    margin-bottom: 0;
    font-size: 0.95em;
    color: #555;
}
ol.recommendation-list > li > strong {
    display: block; /* Make the company name stand out more */
    font-size: 1.05em;
    margin-bottom: 0.2em;
}

/* Styling for definition-like lists (e.g., Sector/Rationale) */
li > ul {
    list-style-type: none; /* Remove bullet points for sub-items like Sector/Rationale */
    padding-left: 0.5em;
    margin-top: 0.3em;
}
li > ul > li {
    margin-bottom: 0.3em;
    font-size: 0.95em;
}
li > ul > li > strong {
     color: #343a40; /* Darker emphasis for labels */
     margin-right: 0.4em;
}


/* --- Links --- */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease-in-out, text-decoration 0.2s ease-in-out;
}

a:hover, a:focus {
    color: #0056b3;
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.9em;
    color: #6c757d;
}
.back-link:hover {
    color: #343a40;
}

/* Perplexity Citations */
a.citation {
    font-size: 0.8em;
    vertical-align: super;
    margin-left: 2px;
    text-decoration: none;
    border: 1px solid #ced4da;
    padding: 1px 4px;
    border-radius: 3px;
    background-color: #e9ecef;
    color: #495057;
}
a.citation:hover {
    background-color: #dee2e6;
    border-color: #adb5bd;
    color: #212529;
}


/* --- Header & Footer --- */
header.page-header {
    margin-bottom: 2.5rem;
    position: relative; /* For logo positioning if needed */
}

header h1 + p.subtitle, /* Select subtitle only if it follows h1 */
.index-container header h1 + p.subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin-top: -0.5em; /* Pull subtitle closer to H1 */
    margin-bottom: 1em;
    font-weight: 400;
    border-bottom: none; /* Ensure subtitle doesn't inherit h1 border */
    padding-bottom: 0;
}

footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.85em;
    color: #6c757d;
    text-align: center;
}
footer .back-link {
    display: block; /* Make footer back link centered */
    margin-bottom: 0.5rem;
}


/* --- Index Page Specific --- */
.index-container header {
    margin-bottom: 3rem;
}

.analysis-nav h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: none; /* No border for nav heading */
    text-align: center;
    color: #495057;
}

.analysis-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center; /* Center buttons */
}

.nav-button {
    display: block;
    padding: 0.8rem 1.5rem;
    background-color: #007bff;
    color: #ffffff;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
    min-width: 250px; /* Ensure buttons have a minimum width */
}

.nav-button:hover, .nav-button:focus {
    background-color: #0056b3;
    text-decoration: none;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}


/* --- Other Elements --- */
hr {
    border: 0;
    height: 1px;
    background-color: #dee2e6;
    margin: 2.5rem 0;
}

img.logo {
    display: block;
    max-width: 120px; /* Original width */
    height: auto;
    margin: 0 auto 1.5rem auto; /* Center logo */
    opacity: 0.8;
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .container {
        margin: 1rem;
        padding: 1.5rem;
    }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
    h4 { font-size: 1rem; }

    .nav-button {
        min-width: 90%; /* Make buttons wider on smaller screens */
    }
}

@media (max-width: 480px) {
     body { font-size: 15px; }
    .container {
        padding: 1rem;
    }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
}