@font-face {
    font-family: "Cormorant Garamond";
    src: url("/static/fonts/CormorantGaramond-SemiBold.ttf") format("truetype");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Cormorant Garamond";
    src: url("/static/fonts/CormorantGaramond-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("/static/fonts/Manrope-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("/static/fonts/Manrope-Medium.ttf") format("truetype");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("/static/fonts/Manrope-SemiBold.ttf") format("truetype");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

:root {
    --bg-page: #F6F1E8;
    --bg-page-alt: #EFE7DB;
    --surface-1: #FFFDF8;
    --surface-2: #F8F2E9;
    --surface-3: #F1E7D8;
    --text-strong: #171411;
    --text-body: #3C342C;
    --text-muted: #7B6F61;
    --line-soft: rgba(87, 66, 38, 0.12);
    --line-strong: rgba(87, 66, 38, 0.22);
    --accent-bronze: #8A6A36;
    --accent-bronze-strong: #6E5328;
    --accent-bronze-soft: rgba(138, 106, 54, 0.12);
    --success-moss: #5E725D;
    --success-moss-soft: rgba(94, 114, 93, 0.12);
    --warning-amber: #9B7941;
    --warning-amber-soft: rgba(155, 121, 65, 0.12);
    --danger-clay: #9A5A4D;
    --danger-clay-soft: rgba(154, 90, 77, 0.12);

    /* Compatibility aliases for existing runtime markup. */
    --bg-primary: var(--bg-page);
    --bg-secondary: var(--surface-1);
    --bg-card: var(--surface-2);
    --bg-hover: var(--surface-3);
    --gold: var(--accent-bronze);
    --gold-light: #7A5C2F;
    --gold-dark: var(--accent-bronze-strong);
    --gold-glow: var(--accent-bronze-soft);
    --saffron: var(--warning-amber);
    --text-primary: var(--text-strong);
    --text-secondary: var(--text-body);
    --green: var(--success-moss);
    --green-bg: var(--success-moss-soft);
    --yellow: var(--warning-amber);
    --yellow-bg: var(--warning-amber-soft);
    --red: var(--danger-clay);
    --red-bg: var(--danger-clay-soft);
    --border: var(--line-soft);
    --border-light: var(--line-strong);
    --purple: #8A6A36;
    --purple-light: #6E5328;
    --purple-glow: var(--accent-bronze-soft);
    --teal: #5E725D;
    --teal-glow: var(--success-moss-soft);

    --radius-lg: 20px;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --transition: 220ms cubic-bezier(0.22, 1, 0.36, 1);
    --font-body: "Manrope", "Segoe UI", sans-serif;
    --font-display: "Cormorant Garamond", Georgia, serif;
    --shadow-soft: 0 16px 40px rgba(45, 34, 20, 0.06);
    --shadow-float: 0 24px 60px rgba(45, 34, 20, 0.08);
    --shadow-chat: 0 18px 46px rgba(45, 34, 20, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-body);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.64), transparent 38%),
        linear-gradient(180deg, var(--bg-page) 0%, var(--bg-page-alt) 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.32), transparent 28%),
        radial-gradient(circle at 80% 0%, rgba(138, 106, 54, 0.06), transparent 24%),
        repeating-linear-gradient(
            90deg,
            rgba(87, 66, 38, 0.012) 0,
            rgba(87, 66, 38, 0.012) 1px,
            transparent 1px,
            transparent 14px
        );
    opacity: 0.75;
}

img,
svg {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

h1,
h2,
h3,
.app-title,
.card-title,
.chart-heading-title,
.chat-header-name {
    font-family: var(--font-display);
    color: var(--text-strong);
}

p,
li,
td,
th,
label,
input,
select,
textarea,
button {
    font-family: var(--font-body);
}

a {
    color: inherit;
}

strong {
    color: var(--text-strong);
}

/* Utilities */
.is-hidden {
    display: none !important;
}

.status-copy,
.field-note,
.micro-copy,
.meta-copy,
.helper-copy,
.welcome-footnote,
.brand-footnote,
.feedback-status {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

.field-note {
    margin-top: 6px;
}

.helper-copy {
    margin-top: 8px;
}

.centered-copy {
    text-align: center;
}

.brand-footnote {
    opacity: 0.68;
}

.brand-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.brand-link {
    color: var(--accent-bronze-strong);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.brand-link:hover {
    border-color: currentColor;
}

.legal-inline-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.legal-inline-links a {
    color: var(--accent-bronze-strong);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.legal-inline-links a:hover {
    border-color: currentColor;
}

body.consent-pending {
    overflow: hidden;
}

.consent-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 24px;
}

.consent-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 20, 17, 0.38);
    backdrop-filter: blur(6px);
}

.consent-panel {
    position: relative;
    width: min(760px, 100%);
    max-height: min(88vh, 920px);
    overflow: auto;
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(248, 242, 233, 0.98) 100%);
    box-shadow: var(--shadow-float);
}

.consent-panel h2 {
    font-size: 32px;
    line-height: 1.08;
    margin-bottom: 10px;
}

.consent-summary {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.consent-summary p,
.consent-check span {
    font-size: 14px;
    line-height: 1.7;
}

.consent-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 18px 0;
}

.consent-links a {
    color: var(--accent-bronze-strong);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid currentColor;
}

.consent-check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    margin-top: 8px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.48);
}

.consent-check input {
    margin-top: 5px;
    accent-color: var(--accent-bronze);
}

.consent-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.legal-shell {
    width: min(980px, calc(100vw - 32px));
    margin: 48px auto;
}

.legal-header,
.legal-card,
.analytics-card {
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.legal-header {
    padding: 28px;
    margin-bottom: 20px;
}

.legal-header h1 {
    font-size: 48px;
    line-height: 1.02;
    margin-bottom: 10px;
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.legal-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.62);
    text-decoration: none;
    color: var(--text-body);
}

.legal-card,
.analytics-card {
    padding: 24px;
    margin-bottom: 18px;
}

.legal-card h2,
.analytics-card h2,
.analytics-card h3 {
    font-size: 28px;
    line-height: 1.08;
    margin-bottom: 12px;
}

.legal-card h3 {
    font-size: 20px;
    margin: 18px 0 10px;
}

.legal-list {
    padding-left: 18px;
}

.legal-list li {
    margin: 8px 0;
}

.legal-grid,
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.analytics-value {
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1;
    color: var(--text-strong);
}

.analytics-label {
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.analytics-table-wrap {
    overflow: auto;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.55);
}

.analytics-table th,
.analytics-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: top;
}

.analytics-table th {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-bronze);
}

.analytics-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--accent-bronze-soft);
    color: var(--accent-bronze-strong);
    font-size: 12px;
    font-weight: 600;
}

.analytics-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.analytics-empty {
    color: var(--text-muted);
    font-size: 14px;
}

.sidebar-kicker,
label,
.mini-label {
    display: block;
    margin-bottom: 6px;
    color: var(--accent-bronze);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.form-group-spaced {
    margin-top: 10px;
}

.btn-bottom-gap {
    margin-bottom: 20px;
}

.panel-result {
    margin-top: 16px;
}

.reading-card {
    line-height: 1.9;
}

.top-gap-sm {
    margin-top: 8px;
}

.top-gap-md {
    margin-top: 16px;
}

.top-gap-lg {
    margin-top: 24px;
}

.bottom-gap-sm {
    margin-bottom: 8px;
}

.bottom-gap-md {
    margin-bottom: 16px;
}

.bottom-gap-lg {
    margin-bottom: 20px;
}

.table-wrap {
    overflow-x: auto;
}

.inline-row,
.chip-row,
.stack-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-row.tight,
.chip-row.tight {
    gap: 8px;
}

.inline-row.between {
    justify-content: space-between;
    align-items: center;
}

.inline-row.start {
    align-items: flex-start;
}

.two-col-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-heading-inline {
    margin-bottom: 12px;
    color: var(--gold-dark);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.section-heading-inline.success {
    color: var(--green);
}

.section-heading-inline.danger {
    color: var(--red);
}

.muted-copy {
    color: var(--text-muted);
}

.accent-text {
    color: var(--gold);
}

.success-text,
.tone-green {
    color: var(--green);
}

.warning-text,
.tone-yellow {
    color: var(--yellow);
}

.danger-text,
.tone-red {
    color: var(--red);
}

.score-strong {
    font-weight: 700;
}

.reading-copy {
    line-height: 1.9;
}

.empty-state {
    color: var(--text-muted);
    font-size: 13px;
}

.table-note {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.expandable-meta {
    color: var(--text-muted);
    font-size: 12px;
}

.expandable-subline {
    margin-left: 20px;
    color: var(--text-body);
    font-size: 13px;
    line-height: 1.7;
}

.expandable-subline.is-current {
    color: var(--accent-bronze-strong);
    font-weight: 700;
}

.table-score-cell {
    font-weight: 700;
}

.table-note-cell {
    color: var(--text-muted);
    font-size: 12px;
}

.detail-block {
    margin-bottom: 12px;
    color: var(--text-body);
    line-height: 1.8;
}

.detail-block.soft {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--accent-bronze-soft);
}

.detail-list {
    margin: 6px 0 0 16px;
}

.detail-list li {
    margin: 4px 0;
    font-size: 12px;
}

.expandable-inline-status {
    margin-left: 8px;
    font-weight: 700;
}

.info-badge-inline {
    margin-left: 6px;
}

.retro-mark {
    color: var(--warning-amber);
}

.bubble-error {
    color: var(--danger-clay);
}

.heatmap-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 16px 0;
}

.heatmap-day {
    --day-size: 32px;
    --day-font-size: 0.7rem;
    --day-opacity: 0.8;
    width: var(--day-size);
    height: var(--day-size);
    border-radius: 8px;
    border: 1px solid rgba(87, 66, 38, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--day-font-size);
    font-weight: 600;
    color: var(--text-strong);
    opacity: var(--day-opacity);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.heatmap-day:hover {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 8px 18px rgba(45, 34, 20, 0.14);
}

.heatmap-day.compact {
    --day-size: 22px;
    --day-font-size: 0.6rem;
}

.heatmap-day.today {
    border: 2px solid var(--accent-bronze);
}

.heatmap-day.heatmap-strong {
    background: rgba(94, 114, 93, 0.86);
}

.heatmap-day.heatmap-good {
    background: rgba(138, 106, 54, 0.74);
}

.heatmap-day.heatmap-mixed {
    background: rgba(155, 121, 65, 0.58);
}

.heatmap-day.heatmap-challenging {
    background: rgba(154, 90, 77, 0.56);
}

.best-worst-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 16px 0;
}

.mini-heading,
.trend-heading {
    margin: 16px 0 8px;
    color: var(--accent-bronze-strong);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mini-heading.success {
    color: var(--green);
}

.mini-heading.danger {
    color: var(--red);
}

.remedy-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.highlight-panel {
    padding: 12px;
    margin-bottom: 10px;
    border-left: 3px solid var(--green);
    border-radius: var(--radius-sm);
    background: var(--green-bg);
}

.support-panel {
    margin-top: 16px;
}

.metric-value-link {
    cursor: pointer;
}

.metric-value-link:hover {
    text-decoration: underline;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 338px;
    flex-shrink: 0;
    padding: 28px 24px 30px;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.94) 0%, rgba(248, 242, 233, 0.96) 100%);
    border-right: 1px solid var(--line-soft);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 42px 48px 56px;
    overflow-y: auto;
}

/* Header */
.app-title {
    font-size: 44px;
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: left;
    color: var(--text-strong);
}

.app-subtitle {
    margin-top: 4px;
    margin-bottom: 6px;
    color: var(--accent-bronze);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Forms */
.form-group {
    margin-bottom: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: rgba(255, 253, 248, 0.9);
    color: var(--text-strong);
    padding: 12px 14px;
    min-height: 46px;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background-color var(--transition),
        transform var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: color-mix(in srgb, var(--text-muted) 72%, white 28%);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-bronze);
    box-shadow: 0 0 0 4px rgba(138, 106, 54, 0.08);
    background: var(--surface-1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding: 11px 18px;
    min-height: 44px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition),
        background-color var(--transition),
        color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    width: 100%;
    background: var(--accent-bronze);
    color: var(--surface-1);
    box-shadow: 0 10px 24px rgba(110, 83, 40, 0.16);
}

.btn-primary:hover {
    background: var(--accent-bronze-strong);
    box-shadow: 0 14px 28px rgba(110, 83, 40, 0.18);
}

.btn-secondary {
    background: rgba(255, 253, 248, 0.88);
    color: var(--text-body);
    border-color: var(--line-soft);
}

.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--line-strong);
}

.btn-danger {
    background: rgba(154, 90, 77, 0.08);
    color: var(--danger-clay);
    border-color: rgba(154, 90, 77, 0.16);
}

.btn-danger:hover {
    background: rgba(154, 90, 77, 0.14);
    border-color: rgba(154, 90, 77, 0.28);
}

.btn-sm {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tabs */
.tab-nav {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    position: relative;
    flex: 0 0 auto;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    scroll-snap-align: start;
    transition: color var(--transition);
}

.tab-btn::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -11px;
    height: 2px;
    background: transparent;
    transition: background-color var(--transition), transform var(--transition);
    transform: scaleX(0.2);
    transform-origin: center;
}

.tab-btn:hover {
    color: var(--text-body);
}

.tab-btn.active {
    color: var(--text-strong);
}

.tab-btn.active::after {
    background: var(--accent-bronze);
    transform: scaleX(1);
}

.tab-panel {
    display: none;
    animation: fadeIn 220ms ease;
}

.tab-panel.active {
    display: block;
}

/* Surface system */
.card,
.metric-card,
.snapshot-box,
.chart-box,
.expandable,
.feature-card,
.planet-info-card,
.range-day-card,
.chat-container,
.quick-q,
.code-block,
.toast {
    background: rgba(255, 253, 248, 0.86);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-soft);
}

.card,
.chart-box,
.feature-card,
.planet-info-card,
.range-day-card {
    border-radius: var(--radius-lg);
}

.metric-card,
.snapshot-box,
.expandable,
.quick-q,
.code-block {
    border-radius: var(--radius);
}

.card {
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    margin-bottom: 14px;
    color: var(--text-strong);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section-subtitle {
    margin-bottom: 16px;
    color: var(--text-body);
    font-size: 15px;
    line-height: 1.75;
}

.chart-heading {
    text-align: center;
    margin-bottom: 26px;
}

.chart-heading-title {
    font-size: 40px;
    line-height: 1.08;
    font-weight: 600;
}

.chart-heading-meta {
    margin-top: 10px;
    color: var(--accent-bronze);
    font-size: 13px;
    line-height: 1.5;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.metric-card,
.snapshot-box {
    padding: 18px 16px;
    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.metric-card:hover,
.snapshot-box:hover,
.feature-card:hover,
.chart-box:hover,
.planet-info-card:hover,
.range-day-card:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
}

.metric-card h4,
.snapshot-box h4 {
    margin-bottom: 8px;
    color: var(--accent-bronze);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.metric-card p,
.snapshot-box p {
    font-size: 18px;
    line-height: 1.25;
    color: var(--text-strong);
    font-weight: 700;
}

.metric-card p.tone-green,
.snapshot-box p.tone-green,
.panel-title.tone-green,
.koot-bar .score.tone-green,
.result-score.tone-green,
.result-verdict.tone-green {
    color: var(--green);
}

.metric-card p.tone-yellow,
.snapshot-box p.tone-yellow,
.panel-title.tone-yellow,
.koot-bar .score.tone-yellow,
.result-score.tone-yellow,
.result-verdict.tone-yellow {
    color: var(--yellow);
}

.metric-card p.tone-red,
.snapshot-box p.tone-red,
.panel-title.tone-red,
.koot-bar .score.tone-red,
.result-score.tone-red,
.result-verdict.tone-red {
    color: var(--red);
}

.snapshot-copy {
    margin-top: 12px;
    color: var(--text-body);
    font-size: 13px;
    line-height: 1.7;
}

.vedic-quote,
.learn-more {
    margin: 16px 0;
    padding: 16px 18px;
    border-radius: var(--radius);
}

.vedic-quote {
    background: linear-gradient(180deg, rgba(241, 231, 216, 0.74), rgba(248, 242, 233, 0.94));
    border: 1px solid rgba(138, 106, 54, 0.16);
    border-left: 3px solid var(--accent-bronze);
    color: var(--text-body);
    font-style: italic;
}

.vedic-quote.quote-success {
    border-left-color: var(--green);
}

.vedic-quote.quote-warning {
    border-left-color: var(--yellow);
}

.vedic-quote.quote-danger {
    border-left-color: var(--red);
}

.learn-more {
    background: rgba(255, 253, 248, 0.84);
    border: 1px solid var(--line-soft);
    color: var(--text-body);
}

.learn-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(138, 106, 54, 0.18);
    background: rgba(138, 106, 54, 0.06);
    color: var(--accent-bronze-strong);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.info-badge.badge-danger {
    border-color: rgba(154, 90, 77, 0.24);
    background: rgba(154, 90, 77, 0.08);
    color: var(--danger-clay);
}

.info-badge.badge-success {
    border-color: rgba(94, 114, 93, 0.22);
    background: rgba(94, 114, 93, 0.08);
    color: var(--success-moss);
}

.info-badge.badge-warning {
    border-color: rgba(155, 121, 65, 0.24);
    background: rgba(155, 121, 65, 0.1);
    color: var(--warning-amber);
}

.divider {
    border-top: 1px solid var(--line-soft);
    margin: 18px 0;
}

.divider-ornament {
    position: relative;
    margin: 28px 0 24px;
    text-align: center;
}

.divider-ornament::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    border-top: 1px solid var(--line-soft);
}

.divider-ornament span {
    position: relative;
    padding: 0 12px;
    background: transparent;
    color: var(--accent-bronze);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* Expandable */
.expandable {
    overflow: hidden;
    margin-bottom: 12px;
}

.profile-expandable {
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: rgba(255, 253, 248, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.expandable-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    cursor: pointer;
    color: var(--text-body);
    transition: background-color var(--transition), color var(--transition);
}

.expandable-header:hover {
    background: rgba(138, 106, 54, 0.04);
}

.expandable-header strong {
    color: var(--text-strong);
}

.expandable-header .arrow {
    color: var(--accent-bronze);
    font-size: 11px;
    transition: transform var(--transition);
}

.expandable.open .arrow {
    transform: rotate(90deg);
}

.expandable-body {
    max-height: 0;
    overflow: hidden;
    padding: 0 16px;
    transition:
        max-height 280ms ease,
        padding 280ms ease;
}

.expandable.open .expandable-body {
    max-height: 4000px;
    padding: 0 16px 16px;
}

.profile-list-body {
    display: none;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.profile-expandable.open .profile-list-body {
    display: block;
    max-height: 268px;
    padding-top: 6px;
}

.ai-status-panel {
    margin: 4px 0 10px;
    pointer-events: none;
}

/* Tables */
.data-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-strong);
    color: var(--accent-bronze);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: left;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(87, 66, 38, 0.08);
    color: var(--text-body);
    vertical-align: top;
    font-size: 13px;
    line-height: 1.6;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.42);
}

/* Charts and analysis widgets */
.charts-row {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 4px;
}

.chart-box {
    padding: 20px;
}

.chart-box h4 {
    margin-bottom: 14px;
    color: var(--accent-bronze);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.planet-info-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 16px;
    margin-bottom: 12px;
}

.planet-icon {
    font-size: 28px;
    line-height: 1;
}

.planet-desc {
    color: var(--text-body);
    font-size: 13px;
    line-height: 1.7;
}

.transit-alert {
    margin: 16px 0;
    padding: 16px 18px;
    background: rgba(155, 121, 65, 0.08);
    border: 1px solid rgba(155, 121, 65, 0.18);
    border-left: 3px solid var(--warning-amber);
    border-radius: var(--radius);
    color: var(--text-body);
}

.compat-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
}

.compat-result-card {
    padding: 22px;
}

.result-center {
    text-align: center;
}

.result-score {
    font-size: 42px;
    line-height: 1;
    font-weight: 700;
    color: var(--text-strong);
}

.result-verdict {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 600;
}

.result-copy {
    margin-bottom: 20px;
    color: var(--text-body);
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
}

.koot-bar {
    display: grid;
    gap: 12px;
    grid-template-columns: 120px 1fr 62px;
    align-items: center;
    margin-bottom: 10px;
}

.koot-bar .name {
    color: var(--text-body);
    font-size: 13px;
}

.koot-bar .bar-bg,
.fav-bar,
.progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: rgba(87, 66, 38, 0.1);
}

.koot-bar .bar-fill,
.fav-bar .fill,
.progress-bar .fill {
    height: 100%;
    border-radius: inherit;
    transition: width 240ms ease;
}

.koot-bar .score {
    text-align: right;
    color: var(--accent-bronze);
    font-size: 13px;
    font-weight: 700;
}

.fill.green,
.bar-fill.green {
    background: linear-gradient(90deg, rgba(94, 114, 93, 0.92), rgba(118, 138, 117, 0.88));
}

.fill.yellow,
.bar-fill.yellow {
    background: linear-gradient(90deg, rgba(155, 121, 65, 0.9), rgba(138, 106, 54, 0.86));
}

.fill.red,
.bar-fill.red {
    background: linear-gradient(90deg, rgba(154, 90, 77, 0.92), rgba(176, 109, 96, 0.88));
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.green {
    background: var(--green);
}

.status-dot.yellow {
    background: var(--yellow);
}

.status-dot.red {
    background: var(--red);
}

.progress-bar {
    height: 10px;
}

.date-range-controls,
.date-preset-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.date-range-controls {
    margin-bottom: 0;
}

.date-range-controls input[type="date"],
.date-range-controls select {
    width: auto;
    min-width: 168px;
    flex: 1 1 150px;
}

.date-preset {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-pill);
    background: rgba(255, 253, 248, 0.88);
    color: var(--text-body);
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.date-preset:hover,
.date-preset.active {
    background: rgba(138, 106, 54, 0.08);
    border-color: rgba(138, 106, 54, 0.22);
    color: var(--accent-bronze-strong);
}

.panel-tight {
    padding: 16px;
}

.panel-title {
    margin-bottom: 12px;
    color: var(--accent-bronze-strong);
}

.inline-actions,
.inline-actions-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.inline-actions {
    gap: 8px;
}

.inline-actions-compact {
    gap: 6px;
}

.inline-label {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.status-note-centered {
    margin-bottom: 16px;
    text-align: center;
    color: var(--accent-bronze-strong);
    font-size: 13px;
}

.status-note-centered .muted-copy {
    margin-left: 4px;
}

.table-scroll {
    overflow-x: auto;
}

.section-grid-two {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

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

.list-link-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
}

.transit-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.chat-feedback {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chat-feedback-time,
.chat-feedback-status {
    color: var(--text-muted);
    font-size: 12px;
}

.range-day-card {
    padding: 16px;
}

.transit-heatmap-day {
    border: 1px solid rgba(87, 66, 38, 0.16);
    border-radius: 8px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.transit-heatmap-day:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 18px rgba(45, 34, 20, 0.14);
}

/* Chat */
.chat-container {
    display: flex;
    flex-direction: column;
    min-height: 72vh;
    overflow: hidden;
    box-shadow: var(--shadow-chat);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(248, 242, 233, 0.9));
}

.chat-header-left,
.chat-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    background: rgba(138, 106, 54, 0.08);
    border: 1px solid rgba(138, 106, 54, 0.18);
}

.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-header-name {
    font-size: 22px;
    line-height: 1;
    font-weight: 600;
}

.chat-header-status,
.chat-header-context {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    min-height: 380px;
    max-height: min(58vh, 720px);
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.74), rgba(248, 242, 233, 0.78));
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(138, 106, 54, 0.18);
    border-radius: var(--radius-pill);
}

.chat-bubble {
    width: fit-content;
    max-width: min(84%, 760px);
    animation: fadeInUp 220ms ease;
}

.chat-bubble.assistant {
    align-self: flex-start;
    margin-right: auto;
}

.chat-bubble.user {
    align-self: flex-end;
    margin-left: auto;
}

.bubble-body {
    padding: 14px 16px;
    border-radius: 18px;
    line-height: 1.75;
    font-size: 14px;
    word-break: break-word;
}

.chat-bubble.assistant .bubble-body {
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--line-soft);
    color: var(--text-body);
}

.chat-bubble.user .bubble-body {
    background: linear-gradient(180deg, rgba(60, 52, 44, 0.96), rgba(46, 40, 34, 0.96));
    color: rgba(255, 251, 245, 0.94);
}

.bubble-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.bubble-label,
.bubble-time {
    font-size: 11px;
    line-height: 1.4;
}

.bubble-label {
    color: var(--accent-bronze);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.bubble-time {
    color: var(--text-muted);
}

.chat-bubble.user .bubble-label,
.chat-bubble.user .bubble-time {
    color: rgba(255, 245, 233, 0.7);
}

.chat-bubble.assistant strong,
.chat-bubble.assistant .md-h1,
.chat-bubble.assistant .md-h2,
.chat-bubble.assistant .md-h3 {
    color: var(--text-strong);
}

.chat-bubble.assistant p {
    margin: 6px 0;
}

.chat-bubble.assistant ul,
.chat-bubble.assistant ol {
    margin: 10px 0;
    padding-left: 20px;
}

.chat-bubble.assistant li {
    margin: 4px 0;
}

.chat-bubble.assistant .md-quote {
    margin: 10px 0;
    padding: 10px 14px;
    border-left: 3px solid var(--accent-bronze);
    background: rgba(138, 106, 54, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-body);
}

.chat-bubble.assistant .md-rule {
    margin: 14px 0;
    border: none;
    border-top: 1px solid var(--line-soft);
}

.chat-bubble.assistant .md-h1 {
    margin: 14px 0 6px;
    font-size: 22px;
    font-family: var(--font-display);
    font-weight: 600;
}

.chat-bubble.assistant .md-h2 {
    margin: 12px 0 5px;
    font-size: 16px;
    font-weight: 700;
}

.chat-bubble.assistant .md-h3 {
    margin: 10px 0 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.inline-code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(138, 106, 54, 0.08);
    color: var(--accent-bronze-strong);
    font-size: 0.92em;
}

.code-block {
    overflow: hidden;
    margin: 12px 0;
}

.code-lang {
    display: block;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--accent-bronze);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: rgba(138, 106, 54, 0.04);
}

.code-block pre {
    margin: 0;
    padding: 14px;
    overflow-x: auto;
}

.code-block pre code {
    color: #3d3429;
    font-size: 13px;
    line-height: 1.65;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.quick-questions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--line-soft);
    background: rgba(248, 242, 233, 0.92);
}

.quick-q {
    position: relative;
    padding: 8px 12px;
    color: var(--text-body);
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 253, 248, 0.9);
    cursor: pointer;
    transition: all var(--transition);
}

.quick-q:hover {
    background: rgba(138, 106, 54, 0.08);
    border-color: rgba(138, 106, 54, 0.22);
    color: var(--accent-bronze-strong);
}

.chat-input-area {
    padding: 16px 18px 18px;
    border-top: 1px solid var(--line-soft);
    background: rgba(255, 253, 248, 0.98);
}

.chat-input-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: rgba(255, 253, 248, 0.96);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-bronze);
    box-shadow: 0 0 0 4px rgba(138, 106, 54, 0.08);
}

.chat-textarea {
    min-height: 44px;
    max-height: 120px;
    border: none;
    background: transparent;
    padding: 4px 6px 4px 4px;
    resize: none;
    color: var(--text-strong);
}

.chat-textarea:focus {
    box-shadow: none;
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--accent-bronze);
    color: var(--surface-1);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform var(--transition), background-color var(--transition), box-shadow var(--transition);
    box-shadow: 0 12px 24px rgba(110, 83, 40, 0.16);
}

.chat-send-btn:hover {
    transform: translateY(-1px);
    background: var(--accent-bronze-strong);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: typingPremium 1.4s ease infinite;
}

.typing-indicator span:nth-child(1) {
    background: rgba(138, 106, 54, 0.54);
}

.typing-indicator span:nth-child(2) {
    background: rgba(138, 106, 54, 0.76);
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    background: rgba(138, 106, 54, 0.98);
    animation-delay: 0.4s;
}

.chat-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
}

.feedback-btn {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-pill);
    background: rgba(255, 253, 248, 0.9);
    color: var(--text-muted);
    padding: 4px 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition);
}

.feedback-btn:hover {
    background: rgba(138, 106, 54, 0.08);
    border-color: rgba(138, 106, 54, 0.22);
    color: var(--accent-bronze-strong);
}

.feedback-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.chat-feedback-placeholder {
    display: none;
}

/* Welcome */
.welcome {
    max-width: 980px;
    padding-top: 12px;
}

.welcome h1 {
    font-size: 56px;
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.welcome .tagline {
    margin-bottom: 22px;
    color: var(--accent-bronze);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.welcome .welcome-quote {
    max-width: 720px;
    margin-bottom: 34px;
    padding: 22px 24px;
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid rgba(138, 106, 54, 0.14);
    border-left: 3px solid var(--accent-bronze);
    border-radius: var(--radius-lg);
    color: var(--text-body);
    font-size: 15px;
    line-height: 1.9;
}

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

.feature-card {
    padding: 22px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--text-strong);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-body);
    font-size: 14px;
    line-height: 1.75;
}

/* File upload and profile rows */
pre.file-preview,
.file-preview pre {
    white-space: pre-wrap;
    color: var(--text-body);
    font-size: 13px;
    line-height: 1.7;
}

.saved-profile-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
    position: relative;
    isolation: isolate;
}

.saved-profile-row:last-child {
    border-bottom: none;
}

.saved-profile-main {
    min-width: 0;
    justify-content: flex-start;
    width: 100%;
    text-align: left;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-profile-delete {
    min-width: 38px;
    position: relative;
    z-index: 1;
}

/* Toasts */
.toast-container {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 240px;
    max-width: 360px;
    padding: 12px 14px;
    color: var(--text-strong);
    font-size: 13px;
    line-height: 1.5;
    animation: fadeInUp 220ms ease;
}

.toast.success {
    background: rgba(94, 114, 93, 0.12);
    border-color: rgba(94, 114, 93, 0.22);
    color: #3D4B3C;
}

.toast.error {
    background: rgba(154, 90, 77, 0.12);
    border-color: rgba(154, 90, 77, 0.22);
    color: #7A453B;
}

.toast.info {
    background: rgba(138, 106, 54, 0.08);
    border-color: rgba(138, 106, 54, 0.16);
    color: var(--accent-bronze-strong);
}

/* Spinner and motion */
.spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: currentColor;
    animation: spin 1s linear infinite;
}

.fade-in-up {
    animation: fadeInUp 220ms ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes typingPremium {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 106, 54, 0.18) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(138, 106, 54, 0.18);
    border-radius: var(--radius-pill);
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/* Responsive */
@media (max-width: 1280px) {
    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--line-soft);
    }

    .main-content {
        padding: 34px 24px 44px;
    }

    .compat-grid,
    .charts-row,
    .learn-grid,
    .two-col-grid,
    .section-grid-two,
    .split-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 28px 18px 38px;
    }

    .sidebar {
        padding: 22px 18px 24px;
    }

    .app-title {
        font-size: 38px;
    }

    .welcome h1,
    .chart-heading-title {
        font-size: 42px;
    }

    .features-grid,
    .metrics-row,
    .form-row,
    .best-worst-grid,
    .remedy-grid {
        grid-template-columns: 1fr;
    }

    .card,
    .chart-box,
    .feature-card {
        padding: 20px;
    }

    .tab-nav {
        gap: 10px 14px;
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 8px;
    }

    .chat-container {
        min-height: 68vh;
    }

    .chat-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .chat-header-context {
        max-width: 58%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-bubble {
        max-width: 100%;
    }

    .koot-bar {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .profile-expandable.open .profile-list-body {
        max-height: 240px;
    }

    .date-range-controls,
    .inline-actions,
    .inline-actions-compact {
        gap: 10px;
    }

    .date-range-controls input[type="date"],
    .date-range-controls .btn,
    .inline-actions .btn,
    .inline-actions-compact .date-preset,
    .inline-actions-compact .btn {
        width: 100%;
        justify-content: center;
    }

    .inline-actions .inline-label {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .welcome h1,
    .chart-heading-title {
        font-size: 34px;
    }

    .tab-nav {
        gap: 8px 12px;
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 8px;
    }

    .tab-btn {
        font-size: 12px;
        padding-bottom: 3px;
    }

    .tab-btn::after {
        display: none;
    }

    .tab-btn.active {
        border-bottom: 1px solid var(--accent-bronze);
    }

    .chat-header-context {
        max-width: 52%;
    }

    .chat-messages {
        padding: 16px;
        max-height: 52vh;
    }

    .profile-expandable.open .profile-list-body {
        max-height: 210px;
    }

    .quick-questions,
    .chat-input-area {
        padding-left: 14px;
        padding-right: 14px;
    }

    .heatmap-day {
        --day-size: 28px;
        --day-font-size: 0.66rem;
    }

    .heatmap-day.compact {
        --day-size: 20px;
        --day-font-size: 0.56rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
