:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #687385;
  --line: #dfe4ea;
  --accent: #146c94;
  --accent-strong: #0f4d6b;
  --danger: #aa3f2d;
  --undecided: #81631d;
  --normal: #1f6b48;
  --auto: #844293;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

a {
  color: inherit;
}

button,
input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

button {
  cursor: pointer;
  font-weight: 650;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.warning {
  border-color: var(--danger);
  color: var(--danger);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.topbar nav a {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 64px;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px 14px;
}

.message.success {
  border-color: #a7d3bc;
}

.message.error {
  border-color: #e1aaa0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.search,
.inline-form,
.settings-form {
  display: flex;
  gap: 10px;
}

.search input {
  width: min(420px, 40vw);
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 650;
}

.filter-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.show-list,
.activity-list,
.season-list {
  display: grid;
  gap: 10px;
}

.show-row,
.season-row,
.activity-row,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.show-row,
.season-row,
.danger-zone,
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.show-row {
  padding: 14px;
}

.show-row.needs-attention {
  border-color: #d2ad55;
  background: #fffaf0;
  box-shadow: inset 4px 0 0 #b47b0c;
}

.show-main {
  min-width: 220px;
}

.show-title {
  font-weight: 800;
  text-decoration: none;
}

.show-main p,
.season-row p,
.activity-row p,
.danger-zone p {
  margin: 6px 0 0;
}

.muted {
  color: var(--muted);
}

.state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-left: 8px;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.state.undecided {
  background: var(--undecided);
}

.state.normal {
  background: var(--normal);
}

.state.auto {
  background: var(--auto);
}

.series-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-left: 8px;
  border: 1px solid #cbd3dc;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef1f4;
  color: #44505f;
  font-size: 13px;
  font-weight: 750;
}

.series-status.continuing {
  border-color: #95c8ab;
  background: #e7f5ec;
  color: #1f6b48;
}

.series-status.upcoming {
  border-color: #9abed1;
  background: #e8f3f8;
  color: #0f5d7d;
}

.series-status.ended {
  border-color: #c7cbd0;
  background: #f1f2f3;
  color: #59616b;
}

.panel {
  margin-bottom: 16px;
  padding: 18px;
}

.detail-head {
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.settings-form {
  align-items: end;
}

.settings-form label {
  display: grid;
  flex: 1;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.season-row,
.activity-row {
  padding: 12px;
}

.activity-row time {
  color: var(--muted);
  font-size: 13px;
}

.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.activity-filter {
  display: flex;
}

.empty {
  color: var(--muted);
}

.login-panel {
  max-width: 380px;
  margin: 64px auto;
}

.login-panel h1 {
  margin-bottom: 24px;
  font-size: 24px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  font-weight: 650;
}

.login-form input {
  width: 100%;
  min-width: 0;
}

.login-form button {
  margin-top: 12px;
}

@media (max-width: 520px) {
  .topbar {
    flex-wrap: wrap;
    padding: 14px 16px;
  }
}

@media (max-width: 860px) {
  .toolbar,
  .show-row,
  .inline-form,
  .settings-form,
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .activity-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .search {
    flex: 1;
    flex-direction: column;
  }

  .search input {
    width: 100%;
  }

  .filter-check {
    min-height: 32px;
  }
}
