@font-face { font-family: 'Anton'; src: url('/static/fonts/Anton-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/static/fonts/Inter-VF.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F3F1EE; --card: #fff; --ink: #141414; --muted: #6B6862; --line: #E4E0DA;
  --red: #E30613; --black: #111; --ok: #12A150; --ok-bg: #E7F6EE; --warn: #C27A00; --warn-bg: #FFF4DC;
  --bad: #D11A2A; --bad-bg: #FDE8EA; --run: #1F6FEB; --run-bg: #E6F0FF;
  --radius: 18px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; min-height: 100vh; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; padding-top: 28px; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.link { color: var(--red); font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }
.center { display: block; text-align: center; margin-top: 4px; }

/* top bar */
.top { background: var(--black); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand span { font-family: 'Anton'; font-size: 20px; letter-spacing: .5px; text-transform: uppercase; }
.who { display: flex; align-items: center; gap: 14px; }
.who .hello { font-weight: 600; opacity: .9; }
.who .link { color: #fff; opacity: .8; font-weight: 600; }
@media (max-width: 640px) { .who .hello, .who .link { display: none; } }

/* buttons, forms, alerts */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; background: var(--red); color: #fff; font: inherit; font-weight: 800; padding: 11px 20px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.06); }
.btn.big { width: 100%; padding: 15px; font-size: 16px; }
.btn.sm { padding: 8px 14px; font-size: 13.5px; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.top .btn.ghost { color: #fff; }
.card .btn.ghost { color: var(--ink); margin-top: 14px; }
.form { display: grid; gap: 14px; margin-top: 18px; }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.form input { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-weight: 500; background: #fff; outline: none; }
.form input:focus { border-color: var(--ink); }
.pw { position: relative; display: block; }
.pw input { padding-right: 48px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; width: 38px; height: 38px; cursor: pointer; opacity: .6; }
.alert { border-radius: 12px; padding: 12px 14px; font-weight: 600; margin: 14px 0 0; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); margin-top: 18px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

/* login */
body.auth { display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 50% 0, #2a2a2a, #0d0d0d 70%); }
.auth-box { width: 100%; max-width: 400px; background: #fff; border-radius: 24px; padding: 32px 26px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.4); text-align: center; }
.auth-box .form { text-align: left; }
.auth-logo { height: 70px; width: auto; margin: 0 auto 14px; }
.auth-box h1 { font-family: 'Anton'; font-weight: 400; font-size: 28px; text-transform: uppercase; letter-spacing: .5px; }
.auth-box .tiny { margin-top: 16px; }

/* dashboard */
main.wrap { padding-bottom: 40px; }
.hero { margin-top: 18px; border-radius: var(--radius); padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: #fff; box-shadow: var(--shadow); }
.hero.ok { background: linear-gradient(135deg, #0f8a45, #14a957); }
.hero.warn { background: linear-gradient(135deg, #b46d00, #e09400); }
.hero.bad { background: linear-gradient(135deg, #b0101e, #e3202f); }
.hero-main { display: flex; align-items: center; gap: 14px; }
.hero h1 { font-family: 'Anton'; font-weight: 400; font-size: 30px; line-height: 1.1; text-transform: uppercase; letter-spacing: .5px; }
.hero p { opacity: .95; font-weight: 500; }
.hero .tiny { opacity: .85; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; flex: none; position: relative; }
.dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid rgba(255,255,255,.6); animation: pulse 1.8s infinite; }
.dot.bad::after { animation-duration: .9s; }
@keyframes pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dot::after { animation: none; } }

.today { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 2px 4px; }
.today .label { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.today strong { font-family: 'Anton'; font-weight: 400; font-size: 24px; text-transform: uppercase; letter-spacing: .3px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.pill.red { background: var(--red); border-color: var(--red); color: #fff; }
.pill.dark { background: var(--black); border-color: var(--black); color: #fff; }
.pill.muted { color: var(--muted); }

.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px 20px; margin-top: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card h2 { font-size: 17px; font-weight: 800; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

.now.live { box-shadow: 0 0 0 3px var(--run), var(--shadow); }
.big-line { font-size: 17px; }
.countdown { font-family: 'Anton'; font-size: 40px; letter-spacing: 1px; margin-top: 6px; line-height: 1.1; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 14px; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: #F6F5F3; color: var(--muted); font-weight: 600; font-size: 14px; }
.steps .ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; flex: none; border: 2px solid var(--line); }
.steps li.done { color: var(--ink); }
.steps li.done .ico { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.now { background: var(--run-bg); color: var(--run); }
.steps li.now .ico { border-color: var(--run); color: var(--run); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.list, .runs, .alerts, .kv { list-style: none; }
.list li, .runs li, .alerts li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child, .runs li:first-child, .alerts li:first-child { border-top: 0; padding-top: 2px; }
.when { font-weight: 800; min-width: 110px; font-size: 14px; }
.what { flex: 1; font-weight: 600; min-width: 140px; }
.list li.paused { opacity: .5; text-decoration: line-through; }
.cd { color: var(--muted); font-weight: 600; }
.err { flex-basis: 100%; color: var(--bad); }
.alerts .txt { flex-basis: 100%; white-space: pre-line; font-size: 14px; }
.calm { color: var(--ok); font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: #F6F5F3; border-radius: 14px; padding: 12px; }
.stat b { display: block; font-family: 'Anton'; font-weight: 400; font-size: 26px; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kv li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv span { color: var(--muted); font-weight: 600; }
.bad-t { color: var(--bad); }

.badge { display: inline-block; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 800; font-style: normal; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.run { background: var(--run-bg); color: var(--run); }
.badge.muted { background: #EEE; color: var(--muted); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.thumb .ph { position: relative; aspect-ratio: 4/5; border-radius: 12px; overflow: hidden; background: #EEE; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.thumb .ph img { width: 100%; height: 100%; object-fit: cover; }
.thumb .count { position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 999px; }
.thumb figcaption { display: grid; gap: 2px; margin-top: 6px; font-size: 13.5px; }
.thumb figcaption span { color: var(--muted); }

.foot { text-align: center; margin-top: 22px; }
@media (max-width: 520px) {
  .hero h1 { font-size: 24px; }
  .countdown { font-size: 32px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat b { font-size: 21px; }
  .when { min-width: 96px; }
}
