:root {
    color-scheme: light;
    --ink: #1e3034;
    --muted: #637078;
    --line: #d9e3e0;
    --soft: #f4f8f6;
    --accent: #006d77;
    --accent-2: #d95d39;
    --accent-3: #5f7f35;
    --warm: #fff5e6;
    --cool: #eaf5f7;
    --paper: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: #eef3f4;
}

a {
    color: #075f9d;
}

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.header-grid {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: var(--accent);
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.main-nav a {
    color: var(--ink);
    text-decoration: none;
}

.page-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    padding: 24px 0 40px;
}

.sidebar,
.content {
    min-width: 0;
}

.panel,
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel {
    padding: 16px;
    margin-bottom: 16px;
}

.panel h2 {
    margin: 0 0 10px;
    font-size: 16px;
}

.panel a {
    display: block;
    padding: 6px 0;
    text-decoration: none;
}

.content {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

h1 {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.15;
}

h2 {
    margin-top: 28px;
    font-size: 22px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .08em;
}

.lead {
    font-size: 18px;
    color: var(--muted);
}

.home-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 22px;
}

.hero-copy,
.calendar-panel,
.content-section {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.hero-copy {
    padding: 24px;
    display: grid;
    align-content: start;
}

.hero-actions,
.impact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 6px;
}

.button-secondary {
    border-color: #b8c7c4;
    background: #fff;
    color: var(--accent);
}

.hero-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.stat-tile,
.comparison-item {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.stat-tile strong,
.comparison-item strong {
    display: block;
    margin: 4px 0;
    color: var(--accent);
    font-size: 22px;
    line-height: 1.15;
}

.calendar-panel {
    padding: 18px;
}

.section-heading {
    display: grid;
    gap: 2px;
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0;
}

.section-heading.compact {
    margin-bottom: 10px;
}

.calendar-scroll {
    overflow-x: auto;
    padding-bottom: 2px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    min-width: 620px;
}

.calendar-weekday {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #9cced9;
    border-radius: 6px;
    background: #d9eef4;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.calendar-cell {
    min-height: 66px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f8faf9;
    font-size: 13px;
    text-align: center;
}

.calendar-cell.empty {
    border-color: transparent;
    background: transparent;
}

.calendar-cell.has-value {
    border-color: #9bc9c5;
    background: var(--cool);
}

.calendar-cell.trend-up {
    border-color: #f09a8e;
    background: #fff0ee;
    color: #b42318;
}

.calendar-cell.trend-down {
    border-color: #9fd19b;
    background: #eef8ed;
    color: #176d2b;
}

.calendar-cell.trend-flat {
    border-color: #b9c7ca;
    background: #f5f8f8;
}

.calendar-cell.is-today {
    outline: 2px solid var(--accent-2);
    outline-offset: 1px;
}

.calendar-cell.is-weekend {
    color: #7d8790;
}

.calendar-day {
    font-weight: 700;
}

.calendar-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--accent);
    font-size: 12px;
    white-space: nowrap;
}

.trend-up .calendar-value,
.trend-up .trend-icon {
    color: #d12418;
}

.trend-down .calendar-value,
.trend-down .trend-icon {
    color: #0b7a32;
}

.trend-flat .calendar-value,
.trend-flat .trend-icon {
    color: #58666b;
}

.trend-icon {
    font-size: 13px;
    line-height: 1;
}

.calendar-average {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #b6d7de;
    border-radius: 7px;
    background: #dff0f5;
    text-align: center;
}

.calendar-average strong {
    color: var(--ink);
}

.content-section {
    padding: 22px;
    margin-top: 16px;
}

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

.impact-grid {
    grid-template-columns: minmax(0, 1fr) 230px;
    align-items: center;
}

.impact-actions {
    margin: 0;
    justify-content: flex-end;
}

.chart-card {
    position: relative;
    min-height: 340px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
}

#euribor30Chart {
    display: block;
    width: 100%;
    height: 320px;
}

.chart-tooltip {
    position: absolute;
    z-index: 2;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(29, 42, 46, .16);
    color: var(--ink);
    font-size: 13px;
    pointer-events: none;
}

.cards-compact .card {
    background: var(--soft);
}

.news-list {
    display: grid;
    gap: 12px;
}

.news-item {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.news-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.news-item h3 {
    margin: 0 0 6px;
}

.faq-section {
    margin-bottom: 4px;
}

.faq-item {
    border-top: 1px solid var(--line);
}

.faq-item summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--ink);
    font-weight: 700;
}

.faq-item p {
    margin-top: 0;
    color: var(--muted);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.card {
    padding: 16px;
}

.metric {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
}

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

.table-wrap {
    overflow-x: auto;
    margin: 18px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper);
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
}

th {
    background: var(--soft);
}

.button,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

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

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.result {
    border-left: 4px solid var(--accent);
    background: var(--soft);
    padding: 14px 16px;
    margin: 18px 0;
}

.chart-img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.bar-list {
    display: grid;
    gap: 8px;
}

.bar-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 80px;
    align-items: center;
    gap: 10px;
}

.bar-track {
    background: var(--soft);
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: var(--accent-2);
}

.site-footer {
    padding: 24px 0;
    color: var(--muted);
}

@media (max-width: 820px) {
    .header-grid,
    .page-grid,
    .home-hero {
        display: block;
    }

    .main-nav {
        margin: 12px 0;
    }

    .cards,
    .form-grid,
    .hero-stat-grid,
    .comparison-grid,
    .impact-grid {
        grid-template-columns: 1fr;
    }

    .hero-copy,
    .calendar-panel,
    .content-section {
        padding: 18px;
    }

    .calendar-panel,
    .content-section {
        margin-top: 16px;
    }

    .impact-actions {
        justify-content: flex-start;
    }

    .sidebar {
        margin-bottom: 18px;
    }
}

@media (max-width: 520px) {
    .wrap {
        width: min(100% - 20px, 1120px);
    }

    .content {
        padding: 14px;
    }

    .calendar-grid {
        gap: 4px;
        min-width: 600px;
    }

    .calendar-cell {
        min-height: 58px;
        padding: 5px;
        font-size: 12px;
    }

    .calendar-cell strong {
        font-size: 11px;
    }

    .chart-card {
        min-height: 300px;
        padding: 8px;
    }

    #euribor30Chart {
        height: 280px;
    }
}
