:root {
    --qt-bg: #f6f7fb;
    --qt-ink: #1a2233;
    --qt-muted: #5f6b82;
    --qt-accent: #d14c44;
    --qt-accent-dark: #ab3029;
    --qt-card: #ffffff;
    --qt-border: #e4e8f0;
    --qt-success-bg: #eef8f1;
    --qt-warning-bg: #fff6e8;
    --qt-danger-bg: #fff0f0;
}

body {
    background: var(--qt-bg);
    color: var(--qt-ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: 0.02em;
}

.hero-shell {
    background:
        radial-gradient(circle at top right, rgba(209, 76, 68, 0.18), transparent 28%),
        linear-gradient(140deg, #131c2e, #263452 55%, #30486f);
    color: #fff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 28px 60px rgba(19, 28, 46, 0.18);
}

.hero-shell .badge-soft,
.metric-card .badge-soft,
.analysis-hero .badge-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-align: center;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.9rem;
    line-height: 1.1;
}

.hero-shell p,
.hero-shell li,
.analysis-hero p {
    color: rgba(255, 255, 255, 0.88);
}

.form-panel,
.content-card,
.metric-card,
.chart-card,
.table-panel,
.faq-card,
.note-card {
    background: var(--qt-card);
    border: 1px solid var(--qt-border);
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(25, 33, 56, 0.06);
}

.form-panel {
    color: var(--qt-ink);
}

.form-panel .form-label {
    color: var(--qt-muted);
    font-weight: 600;
}

.form-control,
.form-control:focus {
    min-height: 52px;
    border-radius: 14px;
    border-color: #d8deea;
    box-shadow: none;
}

.btn-accent {
    background: var(--qt-accent);
    border-color: var(--qt-accent);
    color: #fff;
}

.btn-accent:hover,
.btn-accent:focus {
    background: var(--qt-accent-dark);
    border-color: var(--qt-accent-dark);
    color: #fff;
}

.section-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.check-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.check-list li {
    position: relative;
    padding-left: 1.7rem;
    margin-bottom: 0.9rem;
}

.check-list li::before {
    content: "";
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: #7fd0a7;
    position: absolute;
    left: 0;
    top: 0.45rem;
}

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

.metric-card,
.content-card,
.chart-card,
.note-card,
.table-panel,
.faq-card {
    padding: 1.35rem;
}

.metric-card h3,
.content-card h3,
.chart-card h3,
.table-panel h3,
.note-card h3,
.faq-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--qt-muted);
    font-weight: 700;
}

.metric-card .metric-value {
    font-size: 1.85rem;
    font-weight: 800;
}

.metric-card .metric-label,
.muted-copy,
.content-card p,
.note-card p,
.table-panel p,
.chart-card p {
    color: var(--qt-muted);
}

.tag-pill,
.data-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    margin: 0.2rem 0.35rem 0.2rem 0;
    font-size: 0.9rem;
    line-height: 1.1;
    background: #eef1f8;
    color: #32415f;
}

.data-pill.is-local {
    background: #eef8f1;
    color: #27754e;
}

.data-pill.is-ai {
    background: #eef3ff;
    color: #3357b5;
}

.data-pill.is-warning {
    background: #fff3df;
    color: #9a651b;
}

.severity-high {
    background: var(--qt-danger-bg);
}

.severity-medium {
    background: var(--qt-warning-bg);
}

.analysis-hero {
    background:
        radial-gradient(circle at top right, rgba(209, 76, 68, 0.18), transparent 35%),
        linear-gradient(140deg, #141d31, #24324d 60%, #31456f);
    color: #fff;
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: 0 28px 60px rgba(19, 28, 46, 0.15);
}


.quote-table {
    width: 100%;
    border-collapse: collapse;
}

.quote-table th,
.quote-table td {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--qt-border);
    vertical-align: top;
}

.quote-table thead th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--qt-muted);
}

.verdict-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    line-height: 1.1;
    vertical-align: middle;
    border-radius: 999px;
    padding: 0.42rem 0.82rem;
    font-size: 0.84rem;
    font-weight: 700;
}

.verdict-display {
    font-size: 0.96rem;
    padding: 0.55rem 0.95rem;
}

.verdict-pill.overpriced {
    background: #fff0f0;
    color: #b03636;
}

.verdict-pill.underpriced {
    background: #eef8f1;
    color: #27754e;
}

.verdict-pill.in-range,
.verdict-pill.within-range {
    background: #eef3ff;
    color: #3859a5;
}

.verdict-pill.needs-review,
.verdict-pill.insufficient-data,
.verdict-pill.unknown {
    background: #f0f2f8;
    color: #60708d;
}

.footer-shell {
    color: var(--qt-muted);
}

.small-meta {
    font-size: 0.92rem;
    color: var(--qt-muted);
}


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

.small-link:hover,
.small-link:focus {
    color: var(--qt-accent-dark);
}

.history-card .small-meta {
    color: var(--qt-muted);
}

.history-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.85rem;
}

.error-panel {
    background: var(--qt-danger-bg);
    border: 1px solid #efc6c6;
    color: #8d2f2f;
    border-radius: 18px;
    padding: 1rem 1.1rem;
}

.notice-panel {
    background: #eef3ff;
    border: 1px solid #d7e1ff;
    color: #2f4c92;
    border-radius: 18px;
    padding: 1rem 1.1rem;
}

@media (max-width: 991.98px) {
    .hero-shell,
    .analysis-hero {
        border-radius: 20px;
    }
}


.chart-wrap {
    min-height: 250px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.chart-wrap canvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100% !important;
    min-height: 250px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.chart-wrap.is-ready canvas {
    opacity: 1;
}

.chart-loader,
.chart-empty-state {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.7rem;
    text-align: center;
    border-radius: 16px;
    padding: 1rem;
}

.chart-loader {
    background: linear-gradient(180deg, rgba(246, 247, 251, 0.92), rgba(255, 255, 255, 0.96));
    color: var(--qt-muted);
}

.chart-wrap.is-loading .chart-loader {
    display: flex;
}

.chart-empty-state {
    display: none;
    background: linear-gradient(180deg, rgba(246, 247, 251, 0.94), rgba(255, 255, 255, 0.98));
    color: var(--qt-muted);
    border: 1px dashed #d8deea;
}

.chart-wrap.is-ready .chart-loader,
.chart-wrap.is-ready .chart-empty-state {
    display: none;
}

.chart-wrap.is-empty .chart-loader,
.chart-wrap.is-error .chart-loader {
    display: none;
}

.chart-wrap.is-empty .chart-empty-state,
.chart-wrap.is-error .chart-empty-state {
    display: flex;
}

.chart-wrap.is-empty canvas,
.chart-wrap.is-error canvas {
    opacity: 0;
}

.chart-loader-text,
.chart-empty-text {
    max-width: 18rem;
    font-size: 0.95rem;
}

.chart-empty-state strong {
    color: var(--qt-ink);
}
