:root {
    --bg: #f6f2ea;
    --panel: rgba(255, 255, 255, 0.78);
    --line: rgba(25, 35, 45, 0.08);
    --text: #1d2630;
    --muted: #64707d;
    --accent: #113946;
    --accent-soft: #d8e6eb;
    --warm: #ead8c0;
}

body.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(234, 216, 192, 0.6), transparent 35%),
        radial-gradient(circle at bottom right, rgba(148, 190, 196, 0.24), transparent 40%),
        var(--bg);
}

.app-main {
    flex: 1 0 auto;
}

.app-nav {
    backdrop-filter: blur(20px);
    background: rgba(246, 242, 234, 0.86);
}

.app-card,
.hero-panel,
.chat-shell,
.metric-card,
.course-card {
    background: var(--panel);
    border: 1px solid var(--line);
    backdrop-filter: blur(18px);
    border-radius: 24px;
}

.hero-panel {
    padding: 2rem;
}

.eyebrow {
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.76rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.metric-card {
    padding: 1.25rem;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.metric-value {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.course-card {
    padding: 1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(17, 57, 70, 0.08);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.status-ready {
    color: #0d6d57;
}

.status-importing {
    color: #916500;
}

.status-error {
    color: #9f1f1f;
}

.chat-shell {
    padding: 1.25rem;
    height: clamp(620px, 74vh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.45rem;
    scrollbar-gutter: stable;
}

.chat-form {
    flex-shrink: 0;
    border-top: 1px solid var(--line);
    margin-top: 1rem;
    padding-top: 1rem;
}

.chat-input {
    min-height: 110px;
    max-height: 160px;
    border-radius: 18px;
    border: 1px solid var(--line);
    padding: 1rem;
    resize: vertical;
}

.chat-message {
    display: flex;
}

.chat-user {
    justify-content: flex-end;
}

.chat-assistant {
    justify-content: flex-start;
}

.chat-bubble {
    width: min(100%, 760px);
    padding: 1rem 1.1rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: white;
    box-shadow: 0 18px 48px rgba(31, 44, 53, 0.07);
}

.chat-user .chat-bubble {
    background: linear-gradient(135deg, #113946, #235665);
    color: #fff;
}

.chat-role {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.72;
    margin-bottom: 0.5rem;
}

.chat-empty {
    border: 1px dashed var(--line);
    border-radius: 18px;
    padding: 2rem;
    color: var(--muted);
    text-align: center;
}

.chat-sources {
    margin-top: 0.85rem;
    font-size: 0.92rem;
}

.chat-meta {
    display: grid;
    gap: 0.9rem;
}

.chat-meta div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.chat-meta span {
    color: var(--muted);
}

.profile-stat-list {
    display: grid;
    gap: 0.9rem;
}

.profile-stat-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.profile-stat-list span {
    color: var(--muted);
    font-size: 0.94rem;
}

.profile-stat-list strong {
    text-align: right;
    word-break: break-word;
}

.small-link {
    color: var(--accent);
    text-decoration: none;
}

@media (max-width: 991px) {
    .hero-panel {
        padding: 1.5rem;
    }

    .chat-shell {
        height: 70vh;
    }
}

/* ── Landing page ─────────────────────────────────────────────────────────── */

.lp-hero {
    padding: 3rem 0 4rem;
}

.lp-h1 {
    font-size: clamp(36px, 5vw, 60px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.4px;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.lp-h2 {
    font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.4px;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.lp-lead {
    font-size: 1.15rem;
    color: var(--muted);
    line-height: 1.6;
    max-width: 540px;
}

.lp-section {
    padding: 4rem 0;
    border-top: 1px solid var(--line);
}

.lp-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.lp-metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    backdrop-filter: blur(18px);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.lp-metric--wide { grid-column: 1 / -1; }

.lp-metric-val {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1;
    color: var(--text);
}

.lp-metric-val--sm { font-size: 1.1rem; }

.lp-metric-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.lp-step {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    backdrop-filter: blur(18px);
    padding: 1.75rem;
    height: 100%;
}

.lp-step-num {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    margin-bottom: 1rem;
}

.lp-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.lp-step-body {
    color: var(--muted);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.lp-feature { padding: 1.5rem 0; }

.lp-feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.lp-feature-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.lp-feature p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0;
}

.lp-course-card {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    backdrop-filter: blur(18px);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lp-course-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(17, 57, 70, 0.1);
    color: var(--text);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.app-footer {
    border-top: 1px solid var(--line);
    padding: 2rem 0;
    margin-top: auto;
    background: rgba(246, 242, 234, 0.72);
    backdrop-filter: blur(16px);
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.8fr) minmax(220px, 1fr);
    gap: 2rem;
}

.footer-brand {
    display: inline-block;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.85rem;
}

.footer-copy {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.footer-block {
    min-width: 0;
}

.footer-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.footer-links a,
.footer-meta a {
    color: var(--muted);
    font-size: 0.92rem;
    text-decoration: none;
}

.footer-links a:hover,
.footer-meta a:hover {
    color: var(--text);
}

.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.footer-meta span {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

@media (max-width: 575px) {
    .lp-hero { padding: 2rem 0 2.5rem; }
    .lp-section { padding: 2.5rem 0; }
}

@media (max-width: 991px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}
