/* Status page: plain, readable, mobile first. No external resources. */
:root {
  --bg: #f6f7f9;
  --card: #fff;
  --line: #dde1e6;
  --text: #1f2328;
  --muted: #5f6b76;
  --accent: #2f5d8a;
  --ok: #2e7d4f;
  --maint: #2f6fb3;
  --degraded: #c98a0b;
  --outage: #c0392b;
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 1rem; }
h1 { font-size: 1.5rem; margin: .5rem 0; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; color: var(--muted); }
h3 { font-size: 1rem; margin: .2rem 0; }

.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; gap: .6rem; min-height: 3rem; }
.brand { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; color: var(--text);
  text-decoration: none; font-size: 1.05rem; }
.brand-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok); }
.who { margin-left: auto; display: flex; align-items: center; gap: .5rem; min-width: 0;
  color: var(--muted); font-size: .85rem; }
.who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { white-space: nowrap; text-decoration: none; font-size: .85rem; padding: .25rem .65rem;
  border: 1px solid var(--line); border-radius: 99px; color: var(--text); background: var(--bg); }
.tabs { display: flex; gap: .9rem; overflow-x: auto; scrollbar-width: none; font-size: .88rem; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: .45rem 0 .55rem;
  border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
main { padding-top: 1rem; padding-bottom: 2rem; }
.foot { color: var(--muted); font-size: .85rem; padding-bottom: 2rem; }

.overall {
  display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem;
  border-radius: var(--radius); color: #fff; background: var(--ok); margin-top: .5rem;
}
.overall h1 { margin: 0; font-size: 1.3rem; flex: 1; min-width: 0; line-height: 1.25; }
.overall .dot { flex: none; width: .9rem; height: .9rem; border-radius: 50%; background: #fff; }
.overall .badge.impact-outage { color: var(--outage); border-color: var(--outage); }
.badge.impact-degraded { color: var(--degraded); border-color: var(--degraded); }
.badge.impact-maintenance { color: var(--maint); border-color: var(--maint); }
.badge.internal { flex: none; color: #fff; background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .45); font-weight: 500; }
.overall .overall-state { flex: none; font-size: .95rem; white-space: nowrap; }
.overall-maintenance { background: var(--maint); }
.overall-degraded { background: var(--degraded); }
.overall-outage { background: var(--outage); }

.services { list-style: none; margin: 0; padding: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); }
.service + .service { border-top: 1px solid var(--line); }
.service-link { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem .7rem 1rem;
  color: inherit; text-decoration: none; min-height: 3rem; -webkit-tap-highlight-color: transparent; }
.service-link:hover, .service-link:active { background: var(--bg); }
.service-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.service:first-child .service-link { border-radius: var(--radius) var(--radius) 0 0; }
.service:last-child .service-link { border-radius: 0 0 var(--radius) var(--radius); }
.service:only-child .service-link { border-radius: var(--radius); }
.chevron { flex: none; color: var(--muted); font-size: 1.3rem; line-height: 1; margin-left: -.3rem; }
.svc-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.svc-name { font-weight: 600; }
.svc-desc { color: var(--muted); font-size: .85rem; }
.svc-state { font-size: .9rem; white-space: nowrap; }
.light { width: .8rem; height: .8rem; border-radius: 50%; flex: none; }
.light-operational { background: var(--ok); }
.light-maintenance { background: var(--maint); }
.light-degraded { background: var(--degraded); }
.light-outage { background: var(--outage); }
.state-operational { color: var(--ok); }
.state-maintenance { color: var(--maint); }
.state-degraded { color: var(--degraded); }
.state-outage { color: var(--outage); }

.notice, .card { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .8rem; }
.notice-incident.state-open { border-left: 4px solid var(--outage); }
.notice-maintenance.state-in_progress { border-left: 4px solid var(--maint); }
.notice header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.notice h3 { flex-basis: 100%; }
.meta { color: var(--muted); font-size: .9rem; margin: .3rem 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.body { white-space: pre-line; margin: .4rem 0; }
.svc { background: var(--bg); border-radius: 4px; padding: 0 .4rem; }
.svc.impact-outage { color: var(--outage); }
.svc.impact-degraded { color: var(--degraded); }
.badge { display: inline-block; white-space: nowrap; font-size: .75rem; padding: .05rem .45rem; border-radius: 99px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.badge.kind-incident { color: var(--outage); border-color: var(--outage); }
.badge.kind-maintenance { color: var(--maint); border-color: var(--maint); }
.badge.impact-outage { color: var(--outage); border-color: var(--outage); }
.badge.impact-degraded { color: var(--degraded); border-color: var(--degraded); }
.badge.impact-maintenance { color: var(--maint); border-color: var(--maint); }
.badge.internal { color: #7a4b00; border-color: #e0b860; background: #fff7e0; }
.timeline { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .9rem; }
.timeline li { padding: .3rem 0; border-top: 1px dashed var(--line); }
.timeline time { color: var(--muted); }
.empty { color: var(--muted); }
.back { margin: .2rem 0 0; font-size: .9rem; }
.back a { text-decoration: none; }
.app-facts { display: flex; align-items: center; gap: .4rem .6rem; flex-wrap: wrap; margin: .6rem 0 1rem;
  color: var(--muted); }
.app-facts > span:first-child:not(.badge) { flex-basis: 100%; color: var(--text); }
.more { margin: .4rem 0 0; }
.more .button { display: block; text-align: center; }
.updated { color: var(--muted); font-size: .8rem; }

/* admin */
.actions-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.new-notice { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .2rem 0 1rem; }
.new-notice .button { text-align: center; }
.actions-row h1 { margin-right: auto; }
.button, button {
  display: inline-block; font: inherit; font-size: .95rem; cursor: pointer;
  padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; text-decoration: none;
}
.button.secondary, button.secondary { background: var(--card); color: var(--accent); }
.button.danger, button.danger { background: var(--outage); border-color: var(--outage); }
button.small { padding: .2rem .5rem; font-size: .8rem; }
.form { display: flex; flex-direction: column; gap: .7rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.form.row, .row { flex-direction: row; display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; }
.form label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.form label.check { flex-direction: row; align-items: center; gap: .4rem; }
input, textarea, select { font: inherit; padding: .45rem .5rem; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; max-width: 100%; }
fieldset { border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: .4rem;
  min-width: 0; margin: 0; padding: .6rem .8rem; }
legend { font-weight: 600; padding: 0 .3rem; }
.service-pick { display: flex; flex-direction: column; gap: .4rem; padding: .45rem 0; min-width: 0; }
.service-pick + .service-pick { border-top: 1px solid var(--line); }
.service-pick label.check { flex-wrap: wrap; }
.buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .85rem; }
.warn { color: var(--outage); }
.flash { padding: .6rem .9rem; border-radius: 6px; }
.flash.ok { background: #e6f4ea; color: var(--ok); }
.flash.error { background: #fdecea; color: var(--outage); }
.reach { display: flex; flex-wrap: wrap; gap: .3rem .9rem; background: #eef4fb;
  border-radius: 6px; padding: .5rem .8rem; font-size: .9rem; margin: .5rem 0; }
.steps { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.list { width: 100%; border-collapse: collapse; background: var(--card); font-size: .92rem; }
.list th, .list td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.list .right { text-align: right; }
.inline { display: inline; }
.filters { display: flex; gap: .8rem; }
.filters a.active { font-weight: 700; text-decoration: none; color: var(--text); }
.dispatches { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .2rem; }
.dispatch { font-size: .8rem; padding: 0 .4rem; border-radius: 4px; background: var(--bg); }
.dispatch-sent { color: var(--ok); }
.dispatch-failed { color: var(--outage); }
.dispatch-skipped { color: var(--degraded); }
.dispatch-pending { color: var(--maint); }

@media (max-width: 600px) {
  .list { display: block; overflow-x: auto; }
}

h3.group { font-size: .9rem; color: var(--muted); margin: .6rem 0 0; }
/* level and impact only matter for ticked applications */
.pick-selects { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem;
  padding-left: 1.6rem; }
.pick-selects select { width: 100%; min-width: 0; text-overflow: ellipsis; }
@media (min-width: 40rem) { .pick-selects { grid-template-columns: minmax(0, 1fr) 9rem; } }
.badge.suggested { color: var(--maint); border-color: var(--maint); }
.reach-counts { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.reach { flex-direction: column; }
.reach p { margin: .2rem 0; }
.reach-audiences { margin: .2rem 0 0; padding-left: 1.2rem; }

.notice-link { color: inherit; text-decoration: none; }
.notice-link:hover, .notice-link:focus-visible { text-decoration: underline; }
.notice-link span { color: var(--muted); }
@media (max-width: 24rem) { .who-name { display: none; } }

/* message form: full-width fields, the confirm step has two equally wide buttons */
.actions-row h2 { margin: 0 auto 0 0; }
.message-form input:not([type="checkbox"]), .message-form textarea { width: 100%; box-sizing: border-box; }
.message-form textarea { resize: vertical; }
.buttons.wide > button { flex: 1 1 100%; }
.buttons.split { display: grid; grid-template-columns: 1fr 1fr; }
.buttons.split > button { width: 100%; min-width: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-form .facts { margin: 0; }
.buttons.split > button { white-space: nowrap; padding-left: .4rem; padding-right: .4rem; }
.nowrap { white-space: nowrap; }

/* functions and components */
.service-link.static { cursor: default; }
.service-link.static:hover { background: none; }
.svc-desc .state-operational { color: var(--muted); }
.cgroup { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: .5rem; }
.cgroup > summary { display: flex; align-items: center; gap: .6rem; padding: .65rem 1rem;
  cursor: pointer; list-style: none; min-height: 2.8rem; }
.cgroup > summary::-webkit-details-marker { display: none; }
.cgroup > summary::after { content: "›"; color: var(--muted); font-size: 1.3rem; line-height: 1;
  transition: transform .15s; }
.cgroup[open] > summary::after { transform: rotate(90deg); }
.cgroup-name { flex: 1; min-width: 0; font-weight: 600; }
.cgroup-count { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.cgroup .services { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.affects { margin: 0; padding: 0; list-style: none; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); }
.affects li { padding: .55rem 1rem; }
.affects li + li { border-top: 1px solid var(--line); }
code { font-size: .85em; background: var(--bg); padding: 0 .25rem; border-radius: 4px;
  overflow-wrap: anywhere; }

/* notice form: collapsible groups of components and of the functions of an application */
.pick-group { border-top: 1px solid var(--line); }
.pick-group:last-of-type { border-bottom: 1px solid var(--line); }
.pick-group > summary { display: flex; align-items: center; gap: .5rem; padding: .55rem 0;
  cursor: pointer; list-style: none; font-weight: 600; min-height: 2.6rem; }
.pick-group > summary::-webkit-details-marker { display: none; }
.pick-group > summary > span:first-child { flex: 1; min-width: 0; }
.pick-group > summary::after { content: "›"; color: var(--muted); font-size: 1.3rem; line-height: 1;
  transition: transform .15s; }
.pick-group[open] > summary::after { transform: rotate(90deg); }
.pick-count { flex: none; min-width: 1.5rem; text-align: center; font-size: .78rem; font-weight: 600;
  color: #fff; background: var(--accent); border-radius: 99px; padding: .05rem .45rem; }
.pick-group > .pick-line, .pick-group > .service-pick { padding-left: .2rem; }
.form label.pick-line { flex-direction: row; align-items: center; gap: .55rem; padding: .35rem 0;
  min-height: 2.4rem; font-size: .95rem; }
.pick-line input[type="checkbox"] { flex: none; width: 1.15rem; height: 1.15rem; margin: 0; }
.pick-name { min-width: 0; }
.service-pick { padding: .1rem 0 .35rem; gap: .25rem; }
.service-pick + .service-pick { border-top: 1px dashed var(--line); }
.service-pick:not(:has(input[name="fn"]:checked)) .pick-selects { display: none; }
.service-pick .badge.suggested { white-space: normal; }

/* Automatic incident (Gatus) waiting for stage 2 */
.badge.auto { color: var(--degraded); border-color: var(--degraded); }
.escalation { background: #fff7e6; border: 1px solid var(--degraded); border-left-width: 4px;
  border-radius: var(--radius); padding: .8rem 1rem; margin: 1rem 0; }
.escalation h2 { color: var(--text); margin: 0 0 .4rem; font-size: 1.05rem; }
.escalation p { margin: 0 0 .7rem; }
.escalation-buttons { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.escalation-buttons form { margin: 0; }
.audience-new p { margin: .35rem 0; }

/* reach: persons reached by name, collapsible */
.reach-persons > summary { cursor: pointer; padding: .2rem 0; }
.reach-persons ul { margin: .2rem 0 .3rem; padding-left: 1.2rem; }
.reach-persons li { overflow-wrap: anywhere; }
.reach-person { font-weight: 600; }

/* Notice form: who is notified. Big equal-width segmented buttons ("Nur Admins" | "Betroffene"),
   per application a smaller switch under "Anpassen". */
#functions .pick-selects { grid-template-columns: minmax(0, 16rem); }
.segmented { display: flex; border: 1px solid var(--accent); border-radius: var(--radius);
  overflow: hidden; background: var(--card); }
.form label.segment { flex: 1 1 0; min-width: 0; display: flex; flex-direction: row; gap: 0;
  margin: 0; font-size: 1rem; }
.segment + .segment { border-left: 1px solid var(--accent); }
.segment input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segment span { flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .5rem .6rem; text-align: center; font-weight: 600;
  color: var(--accent); cursor: pointer; user-select: none; }
.segment input:checked + span { background: var(--accent); color: #fff; }
.segment input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -4px; }
.segmented.small span { min-height: 2.5rem; font-size: .9rem; font-weight: 500; }
.segmented.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented.three span { padding-inline: .25rem; white-space: nowrap; }
@media (max-width: 26rem) { .segmented.three span { font-size: .9rem; } }
.reach-none { background: #eef4fb; border-radius: 6px; padding: .5rem .8rem; font-size: .9rem;
  margin: .5rem 0; font-weight: 600; }
.badge.silent { color: var(--muted); border-color: currentColor; border-style: dashed; }
.silent-note { font-size: .85rem; color: var(--muted); margin: 0; }
.reach-adjust > summary { cursor: pointer; color: var(--accent); font-weight: 600;
  padding: .6rem 0; min-height: 2.75rem; display: flex; align-items: center; }
.reach-adjust > summary::before { content: "▸"; margin-right: .4rem; }
.reach-adjust[open] > summary::before { content: "▾"; }
.reach-adjust > summary::-webkit-details-marker { display: none; }
.reach-adjust { list-style: none; }
.reach-app { display: flex; flex-direction: column; gap: .35rem; padding: .55rem 0; }
.reach-app:not([hidden]) ~ .reach-app:not([hidden]) { border-top: 1px solid var(--line); }
.reach-app[hidden] { display: none; }
.reach-app-name { font-weight: 600; font-size: .95rem; }
@media (min-width: 40rem) {
  .reach-app { flex-direction: row; align-items: center; justify-content: space-between; }
  .reach-app .segmented { flex: 0 0 18rem; }
}
