:root {
    --bg: #f5f7fb;
    --white: #fff;
    --ink: #1e3042;
    --muted: #788b9c;
    --line: #dfe7ee;
    --blue: #328bc4;
    --green: #15966a;
    --green-bg: #e8f7f0;
    --orange: #c47a16;
    --orange-bg: #fff4e2;
    --red: #d34b4b;
    --red-bg: #fff0ef;
    --blue-light: #e8f3fa;
    --radius-panel: 7px;
    --radius-control: 4px;
}

* { box-sizing: border-box; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px Poppins, sans-serif;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }

.site-header {
    position: sticky;
    top: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 20px);
    max-width: 790px;
    height: 62px;
    margin: 10px auto 0;
    padding: 0 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: color-mix(in srgb, var(--white) 76%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 2px 8px rgba(30, 48, 66, .04);
}

.site-header .brand { display: flex; min-width: 0; align-items: center; }
.site-header .brand img { display: block; width: auto; max-width: 100%; height: 30px; }
.home-link { display: inline-flex; align-items: center; margin-left: auto; padding: 8px 10px; border-radius: var(--radius-control); color: var(--muted); font-size: 11px; font-weight: 500; }
.home-link:hover, .home-link:focus-visible { background: var(--blue-light); color: var(--blue); }
.home-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.main { flex: 1; width: min(100% - 36px, 750px); margin: 0 auto 34px; }

.page-heading { margin-bottom: 24px; padding: 46px 0 22px; border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-size: 32px; font-weight: 400; line-height: 1.15; }

.overall-status {
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--white);
    box-shadow: 0 2px 8px rgba(30, 48, 66, .04);
}

.overall-status::before { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px var(--blue-light); content: ''; }
.overall-status.operational::before { box-shadow: 0 0 0 5px var(--green-bg); }
.overall-status.degraded::before { box-shadow: 0 0 0 5px var(--orange-bg); }
.overall-status.unavailable::before { box-shadow: 0 0 0 5px var(--red-bg); }
.overall-status h2 { margin: 0; font-size: 15px; font-weight: 600; }
.overall-status p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.operational { color: var(--green); }
.degraded { color: var(--orange); }
.unavailable { color: var(--red); }

.service-list { display: grid; gap: 9px; }
.service-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 18px; padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--white); box-shadow: 0 2px 8px rgba(30, 48, 66, .035); }
.service-copy { min-width: 0; }
.service-copy h2 { margin: 0; font-size: 13px; font-weight: 600; }
.service-status { display: inline-flex; min-height: 29px; flex: 0 0 auto; align-items: center; padding: 0 9px; border-radius: var(--radius-control); background: var(--green-bg); font-size: 10px; font-weight: 600; }
.service-status.degraded { background: var(--orange-bg); }
.service-status.unavailable { background: var(--red-bg); }
.uptime-history { grid-column: 1 / -1; min-width: 0; }
.uptime-bar { display: grid; min-height: 22px; grid-template-columns: repeat(48, minmax(0, 1fr)); gap: 1px; }
.uptime-bar-mobile { display: none; }
.uptime-segment { position: relative; min-width: 0; min-height: 22px; border-radius: 2px; background: #e5e9ef; }
.uptime-segment.operational { background: var(--green); }
.uptime-segment.degraded { background: #e0a13d; }
.uptime-segment.unavailable { background: var(--red); }
.uptime-segment:hover { z-index: 20; }
.uptime-segment::before, .uptime-segment::after { position: absolute; z-index: 21; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .12s ease, visibility .12s ease; }
.uptime-segment::after { bottom: calc(100% + 8px); left: 50%; width: max-content; max-width: min(280px, calc(100vw - 32px)); padding: 9px 11px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 5px; background: var(--white); box-shadow: 0 4px 14px rgba(30, 48, 66, .14); color: var(--ink); content: attr(data-tooltip); font-size: 11px; font-weight: 500; line-height: 1.5; white-space: normal; }
.uptime-segment::before { bottom: calc(100% + 4px); left: 50%; width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); content: ''; }
.uptime-segment:nth-child(-n+8)::after { left: 0; transform: none; }
.uptime-segment:nth-child(-n+8)::before { left: 5px; transform: rotate(45deg); }
.uptime-segment:nth-last-child(-n+8)::after { right: 0; left: auto; transform: none; }
.uptime-segment:nth-last-child(-n+8)::before { right: 5px; left: auto; transform: rotate(45deg); }
.uptime-segment:hover::before, .uptime-segment:hover::after { visibility: visible; opacity: 1; }
.incident-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.incident-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.incident-heading h2 { margin: 0; font-size: 18px; font-weight: 600; }
.tracking-warning { color: var(--orange); font-size: 10px; font-weight: 600; }
.incident-list { display: grid; gap: 9px; margin: 12px 0 0; padding: 0; list-style: none; }
.incident-list li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: var(--radius-panel); background: var(--white); box-shadow: 0 2px 6px rgba(30, 48, 66, .035); }
.incident-list li > span { display: grid; min-width: 0; gap: 4px; }
.incident-list strong { font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.incident-list small, .no-incidents { color: var(--muted); font-size: 10px; line-height: 1.5; }
.no-incidents { margin: 13px 0 0; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(100% - 20px, 750px); margin: 0 auto 10px; padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--white); box-shadow: 0 2px 8px rgba(30, 48, 66, .04); color: var(--muted); font-size: 11px; }
.site-footer a:hover { color: var(--blue); }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }

@media (max-width: 520px) {
    .site-header { height: 58px; padding: 0 18px; }
    .site-footer { align-items: flex-start; flex-direction: column; width: calc(100% - 20px); padding: 14px; }
    .footer-legal { justify-content: flex-start; gap: 12px; }
    .main { width: min(100% - 28px, 750px); margin-bottom: 28px; }
    .page-heading { padding: 38px 0 18px; }
    h1 { font-size: 27px; }
    .overall-status { min-height: 74px; padding: 14px 16px; }
    .overall-status h2 { font-size: 13px; }
    .service-card { gap: 12px 8px; padding: 13px 12px; }
    .service-copy h2 { font-size: 12px; }
    .service-status { padding: 0 8px; font-size: 9px; }
    .uptime-bar, .uptime-segment { min-height: 18px; }
    .uptime-bar-desktop { display: none; }
    .uptime-bar-mobile { display: grid; grid-template-columns: repeat(36, minmax(0, 1fr)); }
    .incident-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
    .incident-heading h2 { font-size: 16px; }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #111a23;
        --white: #1b2732;
        --ink: #e7eef4;
        --muted: #a4b0ba;
        --line: #35434f;
        --blue: #62b5e3;
        --green: #5bc49a;
        --green-bg: #1f3a32;
        --orange: #e7ae56;
        --orange-bg: #3c3323;
        --red: #f07878;
        --red-bg: #40272a;
        --blue-light: #203847;
    }

    img[src*="logo-banner.png"] { content: url("https://fmplayer.de/assets/img/logo-banner-dark.png"); }
    .uptime-segment { background: #35434f; }
}
