* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f5f7;
  color: #1c1e21;
  margin: 0;
  font-size: 14px;
}
a { color: #2953b3; }
h1 { font-size: 22px; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 16px; margin: 24px 0 10px; }
.card h2 { margin-top: 0; }
.wrap { max-width: 900px; margin: 0 auto; padding: 20px 16px 40px; }
.wrap.narrow { max-width: 380px; padding-top: 80px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: #555; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.topbar nav a.on { background: #fff; color: #1c1e21; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.topbar button { color: #555; background: none; border: none; cursor: pointer; font-size: 14px; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.head-row h1 { margin: 0; }
.card { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.card.flush { padding: 0; overflow-x: auto; }
.pad { padding: 20px; margin: 0; }

.stream-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #eee; }
.stream-row:last-child { border-bottom: none; }
.stream-main { flex: 1; min-width: 0; }
.stream-title { font-weight: 600; font-size: 15px; color: #1c1e21; text-decoration: none; }
.stream-main .muted { margin-top: 2px; }

.status { font-size: 12px; padding: 3px 9px; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.status.live { background: #e3f5e6; color: #1e7d33; }
.status.live::before { content: "● "; }
.status.starting, .status.restarting { background: #e8eefc; color: #2953b3; }
.status.stalled { background: #fff4d6; color: #9a6a00; }
.status.failed { background: #fbe3e3; color: #a02020; }
.status.stopped { background: #eee; color: #777; }

.btn { display: inline-block; background: #2953b3; color: #fff; border: none; padding: 9px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn.secondary { background: #eee; color: #333; }
.btn.danger { background: #a02020; }
.btn.wide { width: 100%; }
button.link { background: none; border: none; color: #a02020; cursor: pointer; font-size: 14px; padding: 0 0 0 10px; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

input[type=text], input[type=password], select {
  width: 100%; padding: 9px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; margin-bottom: 14px; background: #fff;
}
label { font-size: 13px; color: #555; display: block; margin-bottom: 4px; }
label.radio { color: #1c1e21; font-size: 14px; margin-bottom: 8px; }
label.radio:last-of-type { margin-bottom: 14px; }

.error { background: #fbe3e3; color: #a02020; padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #eee; vertical-align: top; }
tr:last-child td { border-bottom: none; }
th { font-size: 12px; color: #888; font-weight: 600; }
table.kv th { width: 140px; font-size: 13px; padding-left: 0; }
table.kv td { padding-left: 0; }
.muted { color: #888; font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.break { word-break: break-all; }
form.inline { display: inline; }
pre.log { background: #1c1e21; color: #d6d8db; padding: 14px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow-y: auto; }

@media (max-width: 560px) {
  .stream-row { flex-wrap: wrap; }
  .stream-main { flex-basis: 100%; }
}

.notice { background: #e3f5e6; color: #1e7d33; padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; }
.lead { font-size: 13px; margin: -8px 0 16px; line-height: 1.5; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.small-link { font-size: 13px; margin-left: 8px; }
.stream-title a { color: #1c1e21; text-decoration: none; }
.stream-title .status { margin-left: 6px; vertical-align: 1px; }
form.assign { display: flex; gap: 6px; align-items: center; margin: 0; }
form.assign select { margin: 0; width: auto; max-width: 220px; }
form.assign select.mode { max-width: 110px; }
textarea { width: 100%; }
.logo-cell { width: 56px; padding-right: 0; }
.logo-cell img { width: 44px; height: 30px; object-fit: contain; display: block; }
.probe { font-size: 12px; margin-top: 4px; }
.probe.ok { color: #1e7d33; }
.probe.warn { color: #9a6a00; }
.probe.bad { color: #a02020; }
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; min-width: 200px; padding: 9px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.filters select { width: auto; margin: 0; }
input[type=file] { margin-bottom: 14px; font-size: 13px; }
label.btn { display: inline-block; color: #333; font-size: 14px; margin: 0; }

@media (max-width: 700px) {
  form.assign { flex-basis: 100%; flex-wrap: wrap; }
  form.assign select { max-width: none; flex: 1; }
}
