/* JARABOT Status: one stylesheet and one look for the public pages and the admin (the design "Historie na očích").
   No framework. Statuses are colored through --tone/--tone-bg, set by the status's class. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #17202c;
  --muted: #596476;
  --border: #e4e8ee;
  --accent: #1d2735;
  --accent-text: #ffffff;
  --radius: 10px;
  --none: #dce1e8;
  /* Each status as text on its soft background (4.5:1 or more) and the soft background. */
  --operational-fg: #24754e;
  --operational-bg: #ecf7f0;
  --maintenance-fg: #1f5fbf;
  --maintenance-bg: #eaf2fe;
  --degraded-fg: #925515;
  --degraded-bg: #fff4e3;
  --partial_outage-fg: #b4430c;
  --partial_outage-bg: #fff0e6;
  --major_outage-fg: #b42318;
  --major_outage-bg: #fdeceb;
  /* Full colors for the uptime bars: the text shades of partial and major outage look alike at 2 px. */
  --maintenance: #2563eb;
  --partial_outage: #ea580c;
  --major_outage: #dc2626;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --surface: #1b212a;
    --text: #edf0f5;
    --muted: #a8b3c2;
    --border: #343d4a;
    --accent: #e8edf5;
    --accent-text: #182230;
    --none: #47515f;
    --operational-fg: #7ed6a4;
    --operational-bg: #20392c;
    --maintenance-fg: #93c5fd;
    --maintenance-bg: #1c2b42;
    --degraded-fg: #f3bd72;
    --degraded-bg: #392c1f;
    --partial_outage-fg: #fdba74;
    --partial_outage-bg: #3d2618;
    --major_outage-fg: #fca5a5;
    --major_outage-bg: #3f1f1f;
  }
}

.overall--operational, .state--operational, .open-incident--operational, .incident--operational { --tone: var(--operational-fg); --tone-bg: var(--operational-bg); }
.overall--maintenance, .state--maintenance, .open-incident--maintenance, .incident--maintenance { --tone: var(--maintenance-fg); --tone-bg: var(--maintenance-bg); }
.overall--degraded, .state--degraded, .open-incident--degraded, .incident--degraded { --tone: var(--degraded-fg); --tone-bg: var(--degraded-bg); }
.overall--partial_outage, .state--partial_outage, .open-incident--partial_outage, .incident--partial_outage { --tone: var(--partial_outage-fg); --tone-bg: var(--partial_outage-bg); }
.overall--major_outage, .state--major_outage, .open-incident--major_outage, .incident--major_outage { --tone: var(--major_outage-fg); --tone-bg: var(--major_outage-bg); }

/* Base */
* { box-sizing: border-box; }
/* The hidden attribute wins over a class's display (the subscribe button stays hidden without JavaScript). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 14px; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -.8px; margin-bottom: 12px; overflow-wrap: anywhere; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 .75rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.note { font-size: 12px; color: var(--muted); margin: 0; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; }
.icon { flex: none; }

.container { max-width: 820px; margin: 0 auto; padding: 0 30px; }
.container--wide { max-width: 1200px; }
main.container { padding-top: 28px; }
.section { margin: 0 0 24px; }
.narrow { max-width: 440px; margin: 16px auto; }

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header__inner { max-width: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 17px 30px; }
.brand { text-decoration: none; display: flex; align-items: center; gap: 11px; font-size: 17px; }
.brand__mark { font-weight: 700; letter-spacing: .5px; }
.brand__name { font-size: 13px; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--border); }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { text-decoration: none; }
.site-nav__quiet { color: var(--muted); }
.site-nav__quiet:hover { color: var(--text); }
.site-nav__subscribe { font-size: 12px; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-top: 20px; padding-bottom: 28px; font-size: 11px; color: var(--muted); }
.site-footer__end { display: flex; flex-wrap: wrap; gap: 14px; }

/* The admin's menu */
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav__link { text-decoration: none; padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.nav__link:hover { color: var(--text); background: var(--bg); }
.nav__link--active { color: var(--text); background: var(--bg); font-weight: 600; }
.whoami { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }

/* Panels */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h2 { margin-bottom: 12px; }
.card + .section, .card + .card { margin-top: 22px; }
.card > .facts:first-child { margin-top: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: clip; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header h1 { margin: 0; }
.page-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h1 + p.muted { margin-top: -4px; margin-bottom: 20px; }
.page-title { margin-bottom: 20px; }
.page-title h1 { margin: 0; }
.page-title p { margin: 7px 0 0; }
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-title h2 { margin: 0; }

/* A status as a chip: icon and name on the status's soft background */
.state { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 11px; font-weight: 500; line-height: 1.4;
  color: var(--tone, var(--muted)); background: var(--tone-bg, var(--bg)); border-radius: 5px; padding: 4px 7px; vertical-align: middle; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px;
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; cursor: pointer; text-decoration: none;
  color: var(--accent-text); background: var(--accent); border: 1px solid transparent; border-radius: 8px; }
.button:hover { opacity: .88; color: var(--accent-text); }
.button--small { min-height: 30px; padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.button--ghost, .button--ghost:hover { color: var(--text); background: var(--surface); border-color: var(--border); }
.button--ghost:hover { opacity: 1; background: var(--bg); }
.button--danger, .button--danger:hover { color: var(--major_outage-fg); background: var(--surface);
  border-color: color-mix(in srgb, var(--major_outage-fg) 35%, transparent); }
.button--danger:hover { opacity: 1; background: var(--major_outage-bg); }

/* Forms */
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.field-row > .checkbox { align-self: center; margin: 6px 0 0; }
.field-row .field { flex: 1 1 200px; }
label, .label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 40px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 8px 11px; }
textarea { resize: vertical; }
input[type=text]:focus, input[type=email]:focus, input[type=search]:focus, input[type=number]:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }
.hint { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.hint + .button { margin-top: 12px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox input { width: auto; margin: 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 8px 0 16px; }
.inline-form input[type=search], .inline-form input[type=text] { flex: 1; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 8px 0; }
.component-select { border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; }
.component-select__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 400; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
.component-select__row:last-child { border-bottom: 0; }
.component-select__row select { width: auto; min-width: 12rem; }

/* Messages */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border); }
.flash--notice { background: var(--operational-bg); border-color: color-mix(in srgb, var(--operational-fg) 22%, transparent); }
.flash--alert { background: var(--major_outage-bg); border-color: color-mix(in srgb, var(--major_outage-fg) 22%, transparent); }

/* Incidents: cards in lists, facts and the course of updates */
.incident { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px; }
.incident-list { display: grid; gap: 10px; }
.incident-list .incident { margin: 0; }
.incident__header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.incident__header h3, .incident__header h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.incident__header a, .open-incident h3 a, .resolved__title { text-decoration: none; }
.incident__header a:hover, .open-incident h3 a:hover, .resolved__title:hover { text-decoration: underline; }
.incident__latest { margin-top: 8px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.incident__latest p:last-child { margin-bottom: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; margin: 16px 0; }
.facts dt { color: var(--muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.facts .state { white-space: normal; overflow-wrap: anywhere; }

.timeline { list-style: none; padding: 0; margin: 8px 0 0; }
.timeline__item { padding: 10px 0 10px 16px; border-left: 1px solid var(--border); position: relative; }
.timeline__item::before { content: ""; position: absolute; left: -5px; top: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--none); }
.timeline__item:first-child::before { background: var(--text); }
.timeline__meta { font-size: 12px; color: var(--muted); }
.timeline__meta strong { color: var(--text); font-weight: 600; }
.timeline__body { margin-top: 2px; overflow-wrap: anywhere; }
.timeline__body p:last-child { margin-bottom: 0; }

/* Tables (admin) */
/* Separate borders: a collapsed table loses its outline to the card's radius and overflow. */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table.card { padding: 0; overflow: clip; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding-top: 10px; padding-bottom: 10px; }
.table tr:last-child td { border-bottom: none; }
.table .table__actions { text-align: right; white-space: nowrap; }
.table__actions form, .table__actions a { margin-left: 4px; }
.table td code { overflow-wrap: anywhere; }
.pagination { display: flex; justify-content: space-between; gap: 16px; margin: 16px 0; font-size: 13px; }
.code { background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.token-reveal { background: var(--operational-bg); border-color: color-mix(in srgb, var(--operational-fg) 22%, transparent); margin-bottom: 22px; }

/* The Turnstile check after "Odebírat" */
.dialog { width: min(24rem, calc(100vw - 2rem)); padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); }
.dialog::backdrop { background: rgb(0 0 0 / .5); }
.dialog h2 { margin-top: 0; }
.dialog--subscribe { width: min(28rem, calc(100vw - 2rem)); padding: 20px; }
.dialog--subscribe .subscribe__form { margin: 16px 0 12px; flex-wrap: nowrap; }
.dialog--subscribe .subscribe__form input[type=email] { min-width: 0; }
/* A live region: rendered even when empty, or screen readers would not hear its text appear. */
.dialog__lead { margin: 0; }
.dialog--subscribe .dialog__actions { margin-top: 12px; }
.dialog__check { margin-top: 4px; }
.dialog__widget { display: flex; justify-content: center; min-height: 65px; margin: 8px 0; }
.dialog__error { color: var(--major_outage-fg); }
.dialog__actions { display: flex; justify-content: flex-end; margin: 0; }

/* The status page: the banner, the open incident, the services with their 90 days, resolved incidents, subscribing */
.overall { display: flex; align-items: flex-start; gap: 14px; padding: 16px 19px; margin-bottom: 18px; border-radius: var(--radius);
  background: var(--tone-bg); border: 1px solid color-mix(in srgb, var(--tone) 22%, transparent); }
.overall__icon { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: var(--radius); color: var(--tone);
  background: color-mix(in srgb, var(--tone) 11%, var(--tone-bg)); }
.overall h2 { font-size: 18px; line-height: 1.4; letter-spacing: -.25px; margin: 0; overflow-wrap: anywhere; }
.overall p { color: var(--muted); font-size: 13px; margin: 3px 0 0; }

.open-incident { border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 20px; }
.open-incident__kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase; color: var(--tone); }
.kicker-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.open-incident h3 { font-size: 15px; margin: 0 0 6px; overflow-wrap: anywhere; }
.open-incident__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: 12px; color: var(--muted); }
.open-incident__latest { margin-top: 10px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.open-incident__latest p { margin: 0 0 .5rem; }
.open-incident__latest p:last-child { margin: 0; }
.public details summary { list-style: none; margin: 0; }
.public details summary::-webkit-details-marker { display: none; }
.open-incident__course { margin-top: 10px; }
.open-incident__course summary { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; font-size: 12px; font-weight: 500; color: var(--tone); }
.chevron { transition: transform .15s; }
details[open] > summary .chevron { transform: rotate(90deg); }
.open-incident__course .timeline { margin: 12px 0 0 4px; padding-left: 15px; border-left: 1px solid var(--border); }
.open-incident__course .timeline__item { border-left: 0; padding: 0 0 14px; font-size: 12px; color: var(--muted); }
.open-incident__course .timeline__item::before { display: none; }
.open-incident__course .timeline__body p { margin: 0 0 .4rem; }

.service { padding: 12px 19px; }
.service + .service { border-top: 1px solid var(--border); }
.service__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.service__name { margin: 0; overflow-wrap: anywhere; }
.service__description { margin: 2px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.uptime__bars { display: flex; gap: 2px; height: 12px; margin: 8px 0 5px; }
.uptime__bar { flex: 1; min-width: 0; border-radius: 2px; background: var(--none); }
.uptime__bar--operational { background: var(--operational-fg); }
.uptime__bar--maintenance { background: var(--maintenance); }
.uptime__bar--degraded { background: var(--degraded-fg); }
.uptime__bar--partial_outage { background: var(--partial_outage); }
.uptime__bar--major_outage { background: var(--major_outage); }
.uptime__legend { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; color: var(--muted); }
.uptime__percent { text-align: center; }
.under-services { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.under-services .icon { margin-top: 2px; }
.under-services p { margin: 0; }

.resolved__list { list-style: none; margin: 0; padding: 0; }
.resolved__list li { padding: 10px 0; border-top: 1px solid var(--border); }
.resolved__list li:first-child { border-top: 0; padding-top: 0; }
.resolved__title { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.resolved__list .note { margin-top: 3px; }
.resolved__more { margin: 10px 0 0; font-size: 12px; }
.resolved__more a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.resolved__more a:hover { color: var(--text); }

.subscribe { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 25px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); scroll-margin-top: 16px; }
.subscribe__copy { flex: 1 1 220px; }
.subscribe__copy h2 { font-size: 14px; margin: 0; }
.subscribe__copy p { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.subscribe__form { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 320px; margin: 0; }
.subscribe__form input[type=email] { flex: 1 1 180px; width: auto; }
.subscribe__form .button { min-height: 40px; }
.subscribe__privacy { width: 100%; font-size: 11px; }

.back-link { margin: 0 0 12px; font-size: 13px; }
.back-link a { color: var(--muted); }
.incident-detail { padding: 20px; }
.incident-detail h1 { font-size: 22px; letter-spacing: -.4px; }
.incident-detail h2 { margin-top: 8px; }

/* Narrower screens */
@media (max-width: 760px) {
  .container { padding: 0 20px; }
  main.container { padding-top: 23px; }
  .site-header__inner { padding: 15px 20px; }

  /* Admin: name and logout on the first row, the menu one scrollable row below; tables become one card per row. */
  .site-header--admin .whoami { order: 2; }
  .site-header--admin .nav { order: 3; flex: none; width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav__link { white-space: nowrap; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table tr:last-child { border-bottom: none; }
  .table td, .table tr:last-child td { padding: 2px 0; border: none; }
  .table .table__actions { text-align: left; white-space: normal; padding-top: 8px !important; }
  .table__actions form, .table__actions a { margin: 0 4px 4px 0; }
  .component-select__row { flex-wrap: wrap; gap: 4px; }
  .component-select__row select { width: 100%; min-width: 0; }
  .inline-form { flex-wrap: wrap; }
  .card { padding: 16px; }
  .incident__header { flex-wrap: wrap; gap: 6px; }
}
@media (max-width: 460px) {
  .container { padding: 0 14px; }
  main.container { padding-top: 20px; }
  .site-header__inner { padding: 13px 14px; gap: 10px; }
  .public .site-header__inner { flex-wrap: nowrap; }
  .site-nav__quiet { display: none; }
  .site-nav__subscribe { padding: 7px 9px; min-height: 36px; }
  .site-nav__subscribe .icon { display: none; }
  .brand { font-size: 15px; gap: 7px; }
  .brand__name { font-size: 12px; padding-left: 8px; }
  h1 { font-size: 25px; }
  .overall { padding: 16px 14px; gap: 10px; }
  .overall h2 { font-size: 16px; }
  .overall__icon { min-width: 30px; height: 30px; }
  .service { padding: 15px 14px; }
  .service__top { align-items: flex-start; flex-wrap: wrap; gap: 6px; }
  .uptime__bars { gap: 1px; }
  .uptime__percent { order: 3; width: 100%; text-align: left; }
  .subscribe { padding: 16px; gap: 10px; }
}
@media (pointer: coarse) {
  .button, summary { min-height: 44px; }
  input[type=text], input[type=email], input[type=search], input[type=number], select, textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .chevron { transition: none; } }
