* { box-sizing: border-box; }
body {
    font-family: -apple-system, Segoe UI, Roboto, sans-serif;
    background: #f4f4f6;
    color: #222;
    margin: 0;
}
nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #2b2d42;
    color: #fff;
}
nav .logo { height: 28px; }
nav a { color: #fff; text-decoration: none; opacity: 0.85; }
nav a:hover { opacity: 1; text-decoration: underline; }
nav .title { font-weight: 600; margin-right: auto; opacity: 1; }
nav .title:hover { text-decoration: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

.stat-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.card {
    flex: 1 1 140px;
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}
.card .label { font-size: 0.8rem; color: #777; }
.card .value { font-size: 1.5rem; font-weight: 600; }

.charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 900px) {
    .charts {
        grid-template-columns: 1fr 1fr;
    }
}
.chart-container {
    position: relative;
    height: 380px;
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.settings-form {
    max-width: 480px;
    margin: 24px auto;
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.settings-form label {
    display: block;
    margin-top: 14px;
    font-size: 0.85rem;
    color: #555;
}
.settings-form input {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.settings-form button {
    margin-top: 20px;
    padding: 10px 18px;
    background: #3d5a80;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.settings-form .hint { font-size: 0.75rem; color: #888; }
.settings-form .switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #333;
}
.settings-form .switch-label input { width: auto; margin: 0; }
.settings-form .btn-secondary {
    background: #fff;
    color: #3d5a80;
    border: 1px solid #3d5a80;
    margin-top: 14px;
}
.settings-form .btn-secondary:hover { background: #eef1f6; }

.section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #cdd6e0;
    color: #2b2d42;
    font-size: 0.75rem;
    font-style: italic;
    font-weight: 700;
    font-family: Georgia, serif;
    cursor: help;
    outline: none;
}
.info-icon:hover, .info-icon:focus {
    background: #3d5a80;
    color: #fff;
}
.info-icon .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 10;
    top: 26px;
    left: 0;
    width: 300px;
    background: #2b2d42;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: opacity 0.15s ease;
}
.info-icon .tooltip code {
    display: inline-block;
    margin-top: 4px;
    word-break: break-all;
    color: #f2cc8f;
    font-size: 0.7rem;
}
.info-icon:hover .tooltip, .info-icon:focus .tooltip {
    visibility: visible;
    opacity: 1;
}
.saved-banner {
    max-width: 480px;
    margin: 16px auto 0;
    padding: 10px 14px;
    background: #d8f0dc;
    color: #256029;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.6;
}
.saved-banner.banner-ok { background: #d8f0dc; color: #256029; }
.saved-banner.banner-warn { background: #fbf0d4; color: #8a6d00; }
.saved-banner.banner-fail { background: #f7dde1; color: #a4243b; }
