/* Look from the mockup: Inter on a light gray page, white cards. */
:root {
  --bg: #F4F5F7; --card: #FFFFFF; --line: #E3E5E9; --line-soft: #EEF0F3;
  --text: #15171A; --muted: #5B616B; --link: #1D4ED8;
  --ok: #166534; --ok-bg: #DCFCE7; --ok-dot: #16A34A;
  --bad: #991B1B; --bad-bg: #FEE2E2; --bad-dot: #DC2626;
  --warn: #92400E; --bar: #2563EB; --bar-bg: #E9EBEF; --soft: #F7F8FA;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, -apple-system, sans-serif; }
a { color: var(--link); }
code { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 28px 0 12px; font-size: 18px; }
h3 { margin: 0; font-size: 17px; }
.page { max-width: 1200px; margin: 0 auto; padding: 20px 16px 56px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.warn { color: var(--warn); }
.label { font-size: 12px; font-weight: 500; color: var(--muted); }
.note { font-size: 12px; color: var(--muted); }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.link-button { background: none; border: 0; padding: 10px 0; color: var(--link); font: inherit; font-size: 14px; cursor: pointer; }

.server + .server { margin-top: 56px; }
.server-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.server-state { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.pill.small { font-size: 12px; padding: 4px 10px; gap: 6px; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill-ok .dot { background: var(--ok-dot); }
.pill-bad .dot { background: var(--bad-dot); }

.problems { margin: 0 0 20px; padding: 14px 18px 14px 36px; background: var(--bad-bg); color: var(--bad); border-radius: 12px; font-weight: 500; }
.problems li + li { margin-top: 4px; }

.card, .tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.tile .value { font-size: 22px; font-weight: 700; }
.bar { height: 6px; background: var(--bar-bg); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 6px; background: var(--bar); border-radius: 3px; }
.bar-warn { background: var(--bad-dot); }

.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 12px; }
.app { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.app-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.app-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.version { background: var(--soft); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.version code { color: var(--link); font-weight: 500; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; font-size: 14px; }
.facts > div { display: flex; flex-direction: column; gap: 2px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th { text-align: left; padding: 12px 18px; font-size: 12px; font-weight: 500; color: var(--muted); }
td { padding: 12px 18px; border-top: 1px solid var(--line-soft); }
td code { font-size: 12px; }
footer { margin-top: 32px; }

.signin { max-width: 360px; margin: 12vh auto 0; padding: 0 16px; }
.signin h1 { margin-bottom: 20px; }
.signin-form { display: flex; flex-direction: column; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.signin-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.signin-form input[type=email], .signin-form input[type=password], .signin-form input[type=text] { font: inherit; padding: 10px 12px; border: 1px solid #C9CDD3; border-radius: 8px; min-height: 44px; }
.button { font: inherit; font-weight: 600; min-height: 44px; border: 0; border-radius: 8px; background: var(--text); color: #fff; cursor: pointer; }
.flash { padding: 12px 14px; border-radius: 8px; }
.flash-alert { background: var(--bad-bg); color: var(--bad); }

/* Detail pages */
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 14px; font-weight: 600; color: var(--text); background: var(--card); border: 1px solid #D9DCE1; border-radius: 8px; padding: 10px 14px; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.topbar .buttons .chip { min-height: 40px; padding: 8px 14px; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.detail-head .muted { font-size: 14px; margin-top: 4px; }
.back { display: inline-block; font-size: 14px; font-weight: 500; margin-bottom: 6px; padding: 6px 0; }
.app-link { color: var(--text); }
.version-link code { color: var(--link); }
.pill-run { background: #DBEAFE; color: #1E40AF; }
.verdict { border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.verdict h2 { margin: 0; font-size: 17px; }
.verdict ul, .verdict p { margin: 8px 0 0; font-size: 14px; }
.verdict ul { padding-left: 20px; }
.verdict-ok { background: var(--ok-bg); color: var(--ok); }
.verdict-look { background: #FFFBEB; border: 1px solid #FCD34D; color: #78350F; }
.chart-card { padding: 20px; margin-top: 16px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.chart-head h2 { margin: 0; font-size: 17px; }
.bars { display: flex; align-items: flex-end; gap: 4px; margin-top: 16px; overflow-x: auto; padding-bottom: 4px; }
.bar-col { flex: 1 0 22px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.bar-count { font-size: 10px; color: var(--muted); min-height: 13px; }
.bar-v { width: 100%; background: #3B82F6; border-radius: 3px 3px 0 0; min-height: 1px; }
.bar-label { font-size: 10px; color: var(--muted); border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 4px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 12px; margin-top: 16px; }
.card-title { margin: 0; padding: 18px 18px 6px; font-size: 17px; }
table.narrow { min-width: 320px; }
.num { text-align: right; }
th.num { text-align: right; }
.nowrap { white-space: nowrap; }
.tile .value.bad { color: var(--bad); }
.running-deploy { padding: 20px; border-color: #BFDBFE; margin-bottom: 16px; }
.running-deploy h2 { margin: 8px 0 4px; font-size: 22px; }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; font-size: 14px; font-weight: 600; }
.steps li { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.step-done { background: #F0FDF4; border-color: #BBF7D0 !important; color: var(--ok); }
.step-wait { background: var(--soft); color: #4B5563; }

/* Live deploys */
.deploy-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.deploy-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.deploy-name { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.deploy-name h2 { margin: 0; }
.deploy-clock { text-align: right; }
.clock { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-big { height: 8px; margin-top: 16px; }
.bar-big .bar-fill { height: 8px; }
.steps li { display: flex; flex-direction: column; gap: 4px; }
.step-run { background: #EFF6FF; border-color: #93C5FD !important; color: #1E40AF; }
.output-label { margin: 18px 0 8px; }
.output { margin: 0; background: #111418; color: #D6DAE0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; line-height: 1.6; padding: 12px 14px; border-radius: 8px; overflow-x: auto; white-space: pre; }
.detail-row td { border-top: 0; padding-top: 0; }
details summary { cursor: pointer; color: var(--link); font-size: 13px; padding: 4px 0 8px; }
