:root {
    --ae-green: #00a76f;
    --ae-green-dark: #07845d;
    --ae-ink: #18212f;
    --ae-muted: #667085;
    --ae-soft: #f4fbf8;
    --ae-line: #e6ece9;
}

body {
    color: var(--ae-ink);
    font-family: Arial, Helvetica, sans-serif;
    background: #fff;
}

a {
    color: var(--ae-green-dark);
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: var(--ae-green);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.brand-logo {
    display: inline-block;
    flex: 0 0 auto;
    height: 36px;
    width: 36px;
}

.navbar .nav-link {
    color: #344054;
    font-weight: 600;
}

.navbar .nav-link:hover {
    color: var(--ae-green-dark);
}

.hero {
    background: linear-gradient(180deg, #fff 0%, #f7fbf9 100%);
    padding: 72px 0 56px;
}

.eyebrow {
    color: var(--ae-green-dark);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero h1,
.page-header h1 {
    letter-spacing: 0;
    line-height: 1.06;
}

.stat {
    display: block;
    font-size: 1.6rem;
}

.stat + span {
    color: var(--ae-muted);
    font-size: .92rem;
}

.market-visual {
    border: 1px solid var(--ae-line);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.market-visual img {
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    width: 100%;
}

.floating-card {
    background: #fff;
    border: 1px solid var(--ae-line);
    border-radius: 8px;
    bottom: 22px;
    left: 22px;
    padding: 16px 18px;
    position: absolute;
    width: min(260px, calc(100% - 44px));
}

.floating-card span,
.floating-card small {
    color: var(--ae-muted);
    display: block;
}

.floating-card strong {
    color: var(--ae-green-dark);
    display: block;
    font-size: 2rem;
}

.section-heading {
    margin-bottom: 24px;
    max-width: 680px;
}

.section-heading h2,
.feature-band h2,
.pricing h2 {
    font-weight: 800;
    letter-spacing: 0;
}

.metric-card,
.course-card,
.feature-tile,
.table-panel,
.side-panel,
.admin-panel,
.admin-stat,
.note-card,
.workspace-card,
.calculator-card,
.risk-workflow {
    background: #fff;
    border: 1px solid var(--ae-line);
    border-radius: 8px;
}

.workspace-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-card {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    min-width: 0;
    padding: 18px;
}

.workspace-card i {
    align-items: center;
    background: var(--ae-soft);
    border-radius: 8px;
    color: var(--ae-green-dark);
    display: inline-flex;
    flex: 0 0 42px;
    font-size: 1.3rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.workspace-card h3 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 5px;
}

.workspace-card p {
    color: var(--ae-muted);
    font-size: .88rem;
    line-height: 1.45;
    margin: 0;
}

.metric-card {
    min-height: 190px;
    padding: 20px;
}

.metric-card h5 {
    font-weight: 800;
    margin-bottom: 2px;
}

.metric-card p {
    color: var(--ae-muted);
    font-size: .9rem;
    margin: 0;
}

.metric-card strong {
    display: block;
    font-size: 1.6rem;
    margin: 24px 0 4px;
}

.market-status,
.quote-time {
    color: var(--ae-muted);
    font-size: .82rem;
}

.market-status {
    margin: 8px 0 0;
}

.quote-time {
    display: block;
    min-height: 20px;
    margin-bottom: 14px;
}

.trend {
    border-radius: 999px;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 800;
    padding: 5px 10px;
}

.trend.up {
    background: #e8f8f0;
    color: #07845d;
}

.trend.down {
    background: #fff1f0;
    color: #c0362c;
}

.sparkline {
    border-radius: 999px;
    height: 8px;
    position: relative;
}

.sparkline.up {
    background: linear-gradient(90deg, #bcebd7 15%, var(--ae-green) 82%);
}

.sparkline.down {
    background: linear-gradient(90deg, #ffd5d2 15%, #c0362c 82%);
}

.feature-band,
.pricing,
.page-header {
    background: var(--ae-soft);
}

.feature-tile {
    color: inherit;
    display: block;
    height: 100%;
    min-height: 190px;
    padding: 24px;
}

.feature-tile:hover {
    border-color: rgba(0, 167, 111, .42);
    box-shadow: 0 12px 30px rgba(16, 24, 40, .08);
    color: inherit;
    transform: translateY(-2px);
}

.feature-tile:focus-visible {
    box-shadow: 0 0 0 4px rgba(0, 167, 111, .18);
    outline: 0;
}

.feature-tile i {
    color: var(--ae-green);
    font-size: 2rem;
}

.feature-tile h5 {
    font-weight: 800;
    margin-top: 16px;
}

.feature-tile p,
.course-card p {
    color: var(--ae-muted);
}

.course-card {
    padding: 24px;
}

.course-card h4 {
    font-weight: 800;
    margin-top: 18px;
}

.page-header {
    padding: 56px 0;
}

.page-header p {
    color: var(--ae-muted);
    font-size: 1.12rem;
    max-width: 720px;
}

.table-panel,
.side-panel {
    padding: 24px;
}

.calculator-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.calculator-card {
    background: #f8fbfa;
    min-width: 0;
    padding: 18px;
}

.calculator-card h4 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.calculator-card .form-label {
    color: #344054;
    font-size: .78rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.calculator-card strong {
    display: block;
    font-size: 1.35rem;
    margin-top: 16px;
    overflow-wrap: anywhere;
}

.calculator-card span,
.risk-reminder span,
.risk-workflow p,
.risk-workflow li span {
    color: var(--ae-muted);
    font-size: .9rem;
}

.risk-reminder {
    background: var(--ae-soft);
    border: 1px solid var(--ae-line);
    border-radius: 8px;
    margin: 12px 0 18px;
    padding: 14px;
}

.risk-reminder strong,
.risk-reminder span {
    display: block;
}

.risk-reminder strong {
    margin-bottom: 4px;
}

.risk-workflow {
    align-items: center;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    padding: 24px;
}

.risk-workflow h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 6px 0 8px;
}

.risk-workflow p {
    line-height: 1.6;
    margin: 0;
}

.risk-workflow ol {
    counter-reset: risk-step;
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.risk-workflow li {
    align-items: flex-start;
    background: #f8fbfa;
    border: 1px solid var(--ae-line);
    border-radius: 8px;
    counter-increment: risk-step;
    display: grid;
    gap: 2px 12px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 12px;
}

.risk-workflow li::before {
    align-items: center;
    background: var(--ae-green);
    border-radius: 999px;
    color: #fff;
    content: counter(risk-step);
    display: inline-flex;
    font-size: .82rem;
    font-weight: 800;
    grid-row: span 2;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.risk-workflow li strong {
    font-size: .95rem;
}

.static-content {
    margin: 0 auto;
    max-width: 960px;
}

.legal-summary {
    border-bottom: 1px solid var(--ae-line);
    margin-bottom: 26px;
    padding-bottom: 22px;
}

.legal-summary h2 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 8px 0 10px;
}

.legal-summary p,
.legal-section p,
.legal-section li,
.legal-note {
    color: var(--ae-muted);
    line-height: 1.72;
}

.legal-section-list {
    display: grid;
    gap: 24px;
}

.legal-section {
    border-bottom: 1px solid var(--ae-line);
    padding-bottom: 22px;
}

.legal-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.legal-section h3 {
    font-size: 1.18rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.legal-section ul {
    margin: 12px 0 0;
    padding-left: 1.2rem;
}

.legal-section li + li {
    margin-top: 8px;
}

.legal-note {
    background: var(--ae-soft);
    border: 1px solid var(--ae-line);
    border-radius: 8px;
    margin-top: 28px;
    padding: 16px;
}

.panel-title {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.panel-title h3,
.admin-panel h3 {
    font-size: 1.22rem;
    font-weight: 800;
    margin: 0;
}

.filter-chip {
    background: #fff;
    border: 1px solid var(--ae-line);
    border-radius: 999px;
    color: #344054;
    font-weight: 700;
    margin: 0 8px 10px 0;
    padding: 8px 13px;
}

.filter-chip.active {
    background: var(--ae-green);
    border-color: var(--ae-green);
    color: #fff;
}

.auth-section {
    background: var(--ae-soft);
    padding: 64px 0;
}

.auth-panel {
    background: #fff;
    border: 1px solid var(--ae-line);
    border-radius: 8px;
    margin: 0 auto;
    max-width: 520px;
    padding: 28px;
}

.auth-panel h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 10px;
}

.auth-footnote {
    color: var(--ae-muted);
    font-size: .9rem;
    margin: 18px 0 8px;
}

.market-search .input-group-text {
    background: #fff;
    border-color: var(--ae-line);
}

.search-results {
    display: grid;
    gap: 10px;
}

.search-result,
.mover-row {
    align-items: center;
    border: 1px solid var(--ae-line);
    border-radius: 8px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 12px 14px;
}

.search-result span,
.search-result small,
.mover-row span {
    color: var(--ae-muted);
    display: block;
    font-size: .88rem;
}

.mover-list {
    display: grid;
    gap: 10px;
}

.quote-chart-row > td {
    border-top: 0;
    padding-top: 0;
}

.quote-chart {
    background: #f8fbfa;
    border: 1px solid var(--ae-line);
    border-radius: 8px;
    padding: 16px;
}

.quote-chart-head {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.quote-chart-head strong,
.quote-chart-head span {
    display: block;
}

.quote-chart-head > div span {
    color: var(--ae-muted);
    font-size: .82rem;
}

.quote-bars {
    display: grid;
    gap: 10px 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-bar {
    min-width: 0;
}

.quote-bar-label {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 22px;
}

.quote-bar-label span {
    color: #344054;
    font-size: .82rem;
    min-width: 0;
}

.quote-bar-label strong {
    color: var(--ae-ink);
    flex: 0 0 auto;
    font-size: .82rem;
    max-width: 48%;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quote-bar-track {
    background: #e6ece9;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.quote-bar-track span {
    background: linear-gradient(90deg, var(--ae-green), #47c2a6);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.historical-chart {
    background: #f6f8fb;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    color: #111827;
    overflow: hidden;
    padding: 0;
}

.historical-chart-head {
    align-items: center;
    background: #f2f4f8;
    border-bottom: 1px solid #d9dee7;
    display: flex;
    gap: 0;
    justify-content: space-between;
    min-height: 56px;
}

.historical-chart-head h4 {
    color: #111827;
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    padding: 0 16px;
}

.historical-chart-head p {
    color: #6b7280;
    margin: 0;
}

.historical-chart .eyebrow {
    color: #2563eb;
}

.chart-toolbar {
    align-items: stretch;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 0;
    min-height: 56px;
}

.range-tabs {
    align-items: center;
    background: #fff;
    border-left: 1px solid #d9dee7;
    border-radius: 0;
    display: inline-flex;
    flex: 0 0 auto;
    overflow: hidden;
}

.range-tabs button {
    background: transparent;
    border: 0;
    color: #111827;
    font-weight: 800;
    min-width: 54px;
    padding: 0 12px;
}

.range-tabs button.active,
.range-tabs button:hover {
    background: #eef4ff;
    color: #2563eb;
}

.chart-tools {
    display: flex;
    gap: 0;
}

.chart-tools button {
    align-items: center;
    background: #fff;
    border: 0;
    border-left: 1px solid #d9dee7;
    border-radius: 0;
    color: #111827;
    display: inline-flex;
    height: 56px;
    justify-content: center;
    width: 48px;
}

.chart-tools button:hover {
    background: #f8fafc;
    color: #2563eb;
}

.chart-workspace {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
}

.drawing-tools {
    background: #fff;
    border-right: 1px solid #d9dee7;
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 12px 0;
}

.drawing-tools button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #111827;
    display: inline-flex;
    font-size: 1.2rem;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.drawing-tools button:hover {
    background: #eef4ff;
    color: #2563eb;
}

.chart-stage {
    min-width: 0;
}

.historical-chart-stats {
    align-items: center;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    min-height: 48px;
    padding: 10px 14px;
}

.historical-chart-stats strong {
    color: #111827;
    font-size: 1.05rem;
}

.historical-chart-stats small {
    color: #6b7280;
    font-size: .82rem;
}

.historical-chart-stats > div:first-child span,
.historical-chart-stats > span[data-history-price] {
    color: #5f6673;
    display: inline-block;
    font-size: .96rem;
    margin-left: 6px;
}

.historical-chart-canvas {
    background: #fff;
    border: 0;
    border-top: 1px solid #eef1f5;
    border-bottom: 1px solid #d9dee7;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.historical-chart-canvas canvas {
    aspect-ratio: 16 / 7;
    display: block;
    height: auto;
    width: 100%;
}

.chart-tooltip {
    background: #111827;
    border: 1px solid #111827;
    border-radius: 4px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
    color: #fff;
    display: none;
    font-size: .78rem;
    min-width: 140px;
    padding: 9px 10px;
    pointer-events: none;
    position: absolute;
    z-index: 2;
}

.chart-tooltip strong,
.chart-tooltip span {
    display: block;
}

.chart-tooltip strong {
    color: #fff;
    margin-bottom: 4px;
}

.historical-chart-axis {
    align-items: center;
    background: #fff;
    color: #111827;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 16px;
    font-size: .82rem;
    min-height: 46px;
    padding: 0 14px;
}

.historical-chart-axis .compact {
    border: 0;
}

.historical-chart-axis .compact button {
    min-width: 40px;
    padding: 0 8px;
}

.chart-clock {
    color: #111827;
    font-size: .9rem;
}

.footer {
    background: #101828;
    color: #fff;
}

.footer a {
    color: #cbd5e1;
    display: block;
    margin: 9px 0;
}

.footer h6 {
    font-weight: 800;
}

.social-link {
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    display: inline-flex !important;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.admin-body {
    background: #f5f7f6;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: #101828;
    color: #fff;
    padding: 24px;
}

.admin-brand {
    align-items: center;
    color: #fff;
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.admin-sidebar nav {
    display: grid;
    gap: 8px;
}

.admin-sidebar nav a {
    align-items: center;
    border-radius: 8px;
    color: #cbd5e1;
    display: flex;
    font-weight: 700;
    gap: 12px;
    padding: 12px;
}

.admin-sidebar nav a.active,
.admin-sidebar nav a:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.admin-main {
    padding: 28px;
}

.admin-topbar {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-topbar h1 {
    font-size: 2rem;
    font-weight: 800;
    margin: 4px 0 0;
}

.admin-stat {
    padding: 18px;
}

.admin-stat span,
.admin-stat small {
    color: var(--ae-muted);
    display: block;
}

.admin-stat strong {
    display: block;
    font-size: 1.65rem;
    margin: 8px 0 2px;
}

.admin-panel {
    padding: 22px;
}

.note-card {
    padding: 16px;
}

.note-card h5 {
    font-weight: 800;
    margin-top: 12px;
}

.note-card p {
    color: var(--ae-muted);
    margin-bottom: 0;
}

.activity {
    align-items: start;
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.activity span {
    background: var(--ae-green);
    border-radius: 999px;
    flex: 0 0 10px;
    height: 10px;
    margin-top: 7px;
}

.activity p {
    color: var(--ae-muted);
    margin: 0;
}

@media (max-width: 991.98px) {
    .workspace-grid,
    .calculator-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .risk-workflow {
        grid-template-columns: 1fr;
    }

    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        position: static;
    }

    .admin-main {
        padding: 18px;
    }

    .admin-topbar {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .hero {
        padding: 44px 0 34px;
    }

    .workspace-grid,
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .workspace-card {
        padding: 16px;
    }

    .calculator-card strong {
        font-size: 1.18rem;
    }

    .hero h1,
    .page-header h1 {
        font-size: 2.2rem;
    }

    .panel-title {
        align-items: stretch;
        flex-direction: column;
    }

    .search-result,
    .mover-row {
        align-items: stretch;
        flex-direction: column;
    }

    .quote-chart-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .quote-bars {
        grid-template-columns: 1fr;
    }

    .historical-chart-head {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-toolbar {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .range-tabs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
    }

    .range-tabs button {
        min-width: 0;
    }

    .historical-chart-canvas canvas {
        aspect-ratio: 4 / 3;
    }

    .chart-workspace {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .drawing-tools button {
        height: 34px;
        width: 34px;
    }

    .historical-chart-axis {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px 14px;
    }
}
